ReferencetupleList

<tupleList>

A list of math tuples, parsed from parenthesized comma-separated pieces

<tupleList> is a math-list component that stores a list of math tuples — parenthesized, comma-separated groups such as (1, 2) or (a, b, c). It is a specialized form of <mathList> in which each list item must be written as a parenthesized group.

When creating a <tupleList>, separate items by spaces, not commas. The component will default to displaying the list with commas. (The commas inside each pair of parentheses are part of one tuple, not separators between items.)

Because <tupleList> extends <mathList>, all of the attributes and properties of <mathList> are also available here (unordered, maxNumber, asList, mergeMathLists, numComponents, latex, text, etc.).

Attributes and Properties

Attributes for <tupleList>

Other (13)
asList

boolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).

avoidScientificNotation

Whether to render numbers in full decimal form rather than scientific notation.

displayDecimals

Number of decimal places to display when rendering this number.

displayDigits

Number of significant digits to display when rendering this number.

displaySmallAsZero

Threshold below which numbers are displayed as zero.

functionSymbols

textList. Default value: ["f","g"]. Symbols treated as function names when parsing items.

number. Default value: Infinity. Maximum number of items to retain in the list.

mergeMathLists

boolean. Whether nested math-list children should be flattened into this list.

padZeros

Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

parseScientificNotation

boolean. Default value: false. Whether to parse expressions like 1e3 as scientific notation.

referencesAreFunctionSymbols

reference. References whose names should be treated as function symbols when parsing items.

splitSymbols

boolean. Default value: true. Whether multi-character symbols are split into a product of variables.

boolean. Default value: false. Whether the order of items in this list should be treated as unordered (e.g. for matching).

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

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

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 <tupleList name="t">

Other (8)
$t.functionSymbols

textList. Symbols treated as function names when parsing items.

$t.maxNumber

number. Maximum number of items to retain in the list.

$t.mergeMathLists

boolean. Whether nested math lists are merged into the parent list.

$t.numComponents

number. The number of items in the math list.

$t.numValues

number. The number of math expressions in the list.

$t.parseScientificNotation

boolean. Whether to parse expressions like 1e3 as scientific notation.

$t.splitSymbols

boolean. Whether multi-character symbols are split into a product of variables.

$t.unordered

boolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).

Common to all components (3)
$t.doenetML

text. The DoenetML source code that produced this component.

$t.hide

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

$t.styleNumber

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

Examples

Example: Defining a <tupleList> and retrieving a tuple

Each parenthesized group becomes one math tuple. Spaces between the groups separate the items; the commas inside each (...) are part of one tuple. Individual tuples are accessed by index.


Example: A <tupleList> of 3-tuples

Tuples may have any number of components. Each tuple is itself a math expression and its components can be indexed individually.


Example: Mixed-arity items

The items in a <tupleList> do not need to share the same arity or the same content type.

Attribute Examples

Attribute Example: unordered

The unordered attribute makes comparisons (e.g., inside a <boolean> or an <award>) ignore the order of the items.


Attribute Example: maxNumber

The maxNumber attribute limits the number of tuples retained in the list, regardless of how many are supplied.

Comparison with <mathList>

The difference between <tupleList> and <mathList> is in how the children are parsed:

  • <mathList>x y z</mathList> → a list of 3 maths (x, y, z). Commas inside the body would create a single tuple math instead.
  • <tupleList>(1, 2) (3, 4)</tupleList> → a list of 2 tuples ((1,2), (3,4)). Non-parenthesized text is not accepted as an item.

Use <tupleList> when every item must be a tuple — for example, a list of coordinate pairs that should not specifically be a list of <point> or <interval> components.