ReferenceasList

<asList>

Renders its children as a comma-separated list

<asList> is an inline component that renders its children as a comma-separated list. Unlike typed list components such as <mathList> or <textList>, the children of an <asList> are not collected into an indexable list of values — the component is purely for display, joining the rendered text of its children with , between them.

<asList> is a legacy display helper. When you want to display a single array property (e.g. $eig.eigenvalues, $ode.rhss, $choiceInput.selectedValues), the property already renders as a comma-separated list on its own — no wrapper is needed. Use <asList> only when joining a fixed set of individually-named components with commas between them.

Attributes and Properties

Attributes for <asList>

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <asList name="a">

Other (6)
$a.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$a.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$a.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$a.hidden

boolean. Whether this component is hidden from the rendered output.

latex. The children rendered as a comma-separated LaTeX string.

$a.text

text. The children rendered as a comma-separated text string.

Common to all components (4)
$a.doenetML

text. The DoenetML source code that produced this component.

$a.hide

boolean. Whether to hide this component from the rendered output.

$a.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$a.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: Joining individually-named children with commas

Each child is rendered in place; <asList> inserts , between them. Without the wrapper, the three references would be separated only by the whitespace of the surrounding markup.


Example: Mixing component types

<asList> accepts any inline children — numbers, maths, texts, booleans, references, and so on — and joins their rendered output with commas.

Property Examples

Property Example: text

The text property exposes the rendered list as a single comma-separated text string, suitable for downstream text processing.


Property Example: latex

The latex property returns the children’s LaTeX representations joined with commas, suitable for further LaTeX processing.