<ion>
<ion> is a Subject-specific
component that represents a charged ion. It renders the element symbol with its
charge as a superscript, and exposes the same chemical properties as
<atom> along with charge and the appropriate ion name.
Attributes and Properties
Attributes for <ion>
Other (3)
integer. The atomic number of the element.
integer. The charge of the ion (positive for cations, negative for anions).
text. The chemical symbol of the element (e.g. "Na", "Cl").
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 <ion name="i">
Other (18)
$i.atomicNumberinteger. The atomic number of the element.
$i.backgroundColortext. Human-readable name for this component's background color, derived from the active style and theme.
$i.chargeinteger. The charge of the ion.
$i.disabledboolean. Whether this component is disabled and cannot be interacted with.
$i.fixedboolean. Whether this component's value is fixed and cannot be modified.
$i.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$i.groupinteger. The group number of the underlying element in the periodic table.
$i.groupNametext. The descriptive name of the underlying element's periodic group.
$i.latexlatex. The ion rendered as a LaTeX string.
$i.mathmath. The ion rendered as a math expression (element symbol with charge).
$i.metalCategorytext. The metal category of the underlying element (e.g. alkali metal, transition metal, nonmetal).
$i.nametext. The full name of the ion (e.g. "sodium ion").
$i.periodinteger. The period number of the underlying element in the periodic table.
$i.symboltext. The chemical symbol of the element.
$i.texttext. The ion rendered as a plain text string.
$i.textColortext. Human-readable name for this component's text color, derived from the active style and theme.
$i.textStyleDescriptiontext. Human-readable description of this component's text styling (color and any background color).
Common to all components (4)
$i.doenetMLtext. The DoenetML source code that produced this component.
$i.hideboolean. Whether to hide this component from the rendered output.
$i.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$i.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Define an <ion> by symbol and charge
An <ion> may be specified by either its chemical symbol or its
atomicNumber, together with a charge. If charge is omitted, the element’s
most common ion charge is used. The name property automatically adjusts to
the ion’s chemistry naming convention (e.g. oxide for ).
Example: Default charge uses the most common ion
When charge is not specified, <ion> uses the element’s
chargeOfCommonIon as its default. For elements without a common ion (e.g.
noble gases), the default charge is zero.
Example: Provide the element as an <atom> child
Instead of symbol or atomicNumber, an <ion> may take an
<atom> child. This is useful when the element has already been
defined elsewhere in the document.
Attribute Examples
Attribute Example: symbol
The symbol attribute takes the chemical symbol of the underlying element. The
symbol is case-insensitive on input but is rendered with the canonical
capitalization.
Attribute Example: atomicNumber
The atomicNumber attribute identifies the underlying element by its number of
protons.
Attribute Example: charge
The charge attribute is an integer (positive for cations, negative for
anions). When the underlying element supports multiple oxidation states (e.g.
transition metals), the name property includes a Roman-numeral oxidation
state suffix.
Property Examples
Property Example: name, charge, symbol, atomicNumber
symbol, atomicNumber, and charge echo the values used to define the ion;
name is the full IUPAC-style name, including a Roman-numeral oxidation state
where applicable.
Property Example: math, latex, text
math is a math expression that can be used in computations,
latex is a LaTeX string suitable for rendering, and text is a plain-text
fallback.
Property Example: periodic-table properties of the underlying element
The group, groupName, period, and metalCategory properties report
periodic-table information about the underlying element (the same values you
would get from an <atom> of that element).