ReferenceextractMath

<extractMath>

<extractMath> is a General Operator component that extracts data from mathematical expresssions. (See also, the <matchesPattern> component for an alternative method for extracting data.)

The types of data that can be extracted with <extractMath> are:

  • the number of operands in the expression
  • the individual operands themselves
  • the functions involved in an expression
  • the function arguments

Attributes and Properties

Attributes for <extractMath>
AttributeTypeValues
anchor = "…"point
argumentNumber = "…"number
createIntervals = "…"boolean"true" "false"
createVectors = "…"boolean"true" "false"
displayBlanks = "…"boolean"true" "false"
displayDecimals = "…"integer
displayDigits = "…"integer
displaySmallAsZero = "…"number
draggable = "…"boolean"true" "false"
expand = "…"boolean"true" "false"
format = "…"text"text" "latex"
functionSymbols = "…"textList
layer = "…"number
operandNumber = "…"number
padZeros = "…"boolean"true" "false"
parseScientificNotation = "…"boolean"true" "false"
positionFromAnchor = "…"text"upperright" "upperleft" "lowerright" "lowerleft" "top" "bottom" "left" "right" "center"
referencesAreFunctionSymbols = "…"
renderMode = "…"text
simplify = "…"text"none" "full" "numbers" "numberspreserveorder"
splitSymbols = "…"boolean"true" "false"
type = "…""operand" "function" "functionargument" "numoperands" "recursiveoperands"
unordered = "…"boolean"true" "false"
Props for <extractMath name="e">
PropertyType
$e.anchorpoint
$e.argumentNumbernumber
$e.backgroundColortext
$e.createIntervalsboolean
$e.createVectorsboolean
$e.disabledboolean
$e.displayBlanksboolean
$e.displayDecimalsinteger
$e.displayDigitsinteger
$e.displaySmallAsZeronumber
$e.draggableboolean
$e.expandboolean
$e.fixedboolean
$e.fixLocationboolean
$e.formattext
$e.functionSymbolstextList
$e.hiddenboolean
$e.isNumberboolean
$e.isNumericboolean
$e.latexlatex
$e.layernumber
$e.list[ math ]
$e.matrix[ math ]
$e.matrixSizenumberList
$e.numbernumber
$e.numColumnsinteger
$e.numDimensionsinteger
$e.numListItemsinteger
$e.numRowsinteger
$e.operandNumbernumber
$e.padZerosboolean
$e.parseScientificNotationboolean
$e.positionFromAnchortext
$e.renderModetext
$e.simplifytext
$e.splitSymbolsboolean
$e.texttext
$e.textColortext
$e.textStyleDescriptiontext
$e.unorderedboolean
$e.valueextractMath
$e.vector[ math ]
$e.xmath
$e.ymath
$e.zmath

Example: Extracting operands and number of operands

To extract an operand, you must also specify the operandNumber.


Example: Extracting functions and function arguments

To extract a function or functionArgument, you must first extract the operand under consideration. In order to extract an individual functionArgument in the case of a multivariable function; the argumentNumber must be provided as well.

Note that Doenet recognizes ff and gg as function symbols by default. If other symbols are to represent functions, they can be defined within the <math> component using the functionSymbols attribute.


Attribute Example: type

The type attribute specifies the value to be extracted; it takes one of four possible inputs: operand, numOperands, function, and functionArgument.


Attribute Example: operandNumber

The operandNumber attribute is necessary when the operand type is extracted. It specifies the location of the requested operand within the expression.


Attribute Example: argumentNumber

When function arguments are extracted from a math expression, the argumentNumber attribute specifies the location of the requested argument.