<md>
<md> is a Display Math
component that renders a block of aligned display mathematics when used in combination
with the <mrow> component.
Attributes and Properties
Attributes for <md>
Positioning (2)
anchorpoint. Default value: . Coordinates of the anchor point used to position this component on a graph.
positionFromAnchorkeyword. Where this component sits relative to its anchor point.
| Value | Description |
|---|---|
upperRightAdded in 0.7.10 | Place the component above and to the right of the anchor point. |
upperLeftAdded in 0.7.10 | Place the component above and to the left of the anchor point. |
lowerRightAdded in 0.7.10 | Place the component below and to the right of the anchor point. |
lowerLeftAdded in 0.7.10 | Place the component below and to the left of the anchor point. |
top | Place the component directly above the anchor point. |
bottom | Place the component directly below the anchor point. |
left | Place the component directly to the left of the anchor point. |
right | Place the component directly to the right of the anchor point. |
center (default) | Center the component on the anchor point. |
Other (2)
draggableboolean. Default value: true. Whether the math display can be dragged on a graph.
layernumber. Default value: 0. Z-order layer index when shown on a graph.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <md name="m">
Positioning (2)
$m.anchorpoint. The coordinates where this component is anchored on the graph.
$m.positionFromAnchortext. Where this component sits relative to its anchor point.
Other (7)
$m.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$m.draggableboolean. Whether the math display can be dragged on a graph.
$m.latexlatex. The math content rendered as a LaTeX string.
$m.layernumber. Z-order layer index when shown on a graph.
$m.texttext. The math content rendered as a plain text string.
$m.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$m.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
Common to all components (8)
$m.disabledboolean. Whether this component is disabled and cannot be interacted with.
$m.doenetMLtext. The DoenetML source code that produced this component.
$m.fixedboolean. Whether this component's value is fixed and cannot be modified.
$m.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$m.hideboolean. Whether to hide this component from the rendered output.
$m.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$m.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <md> with nested <mrow> children
The data contained within an <md> block must be contained in
an <mrow>. Equations and content will align vertically where
the & symbol is entered in each row.
Example: <md> cannot contain <answer>
An <md> block cannot contain an <answer>. An input on its own can
be written into a row, though, and an <answer> outside the display can
check it — see the next example.
Example: an input inside <md>, checked by an <answer> outside
The input is drawn inside the aligned display where it was written, and the
<answer> refers to it by name and checks what was entered. The input
needs no <shortDescription>: its own row describes it to a screen
reader, as “x = blank”.
Example: filling in a step of a derivation
A <textInput/>, a <mathInput/>, or an inline
<choiceInput/> written inside an <mrow> is rendered in place,
inside the aligned display, so the reader completes the missing step where it
belongs, and the rows stay aligned at the & around it. Use a
<mathInput/> when the missing step is mathematics the reader should
write as mathematics; the display makes room for it as it grows, and closes
back up as it shrinks.
Without a <shortDescription>, the input is described to a screen reader
by its own row alone — here, “f’(x) = blank” — not by the whole display, so no
accessibility violation is reported. In this example, the
<shortDescription> given replaces that default.
The same restrictions apply as inside <m>: a non-inline
<choiceInput/>, an expanded <textInput/> or one given a
relative width (in % or em), and any input in a display drawn on a
<graph> cannot be placed inside the display. Those inputs are not
shown, and a warning explains the problem.
Example: <md> with referenced <math>
Computational DoenetML components, such as <math>, or <derivative>, can be nested within or
referenced within an <md> block.
Exceptions: The <answer> component and other <md> components
cannot be nested within an <md> block.
Example: <md> on a <graph>
An <md> block can be placed on a <graph>. The anchor attribute
can be used to specify its initial location.
Attribute Examples
Attribute Example: Standard graphical attributes
Since an <md> block can be placed on a graph, the standard graphical
attributes draggable, hide, and styleNumber can be used to control its appearance and behavior.
Property Examples
Property Example: latex
The latex property returns the LaTeX code for rendering the equation block.
Property Example: text
The text property returns the text value of the equation block.