<t-var>
Declares a variable without showing anything. Use it for values that only appear in formulas, or to keep a variable's settings out of the prose.
A
The formula's m and v are draggable. They show their symbols until you
drag them. The sentence holds two plain <t-num> views of the same variables, and
hovering one highlights its twin in the formula.
Attributes
| Attribute | Default | Description |
|---|---|---|
name | required | The variable to declare. |
value | undefined | The starting value. Ignored if the variable was already given a value. |
min, max | unbounded | The range for every control bound to this variable. |
step | 1 | The drag and keyboard increment, and the default display precision. |
format | from step | The default format wherever the variable is shown, including \tangle{} in formulas. |
color | accent color | One CSS color, or two separated by a space for light and dark mode. |
label | the name | The accessible name. |
pixels-per-step | 5 | Drag sensitivity. |
previous | A variable to hold the value from before the last drag or edit (useful for \tangle{} parameters and <t-jsxgraph> points). |
These are the same settings as <t-num>; a <t-var>
simply doesn't render.
When to use it
- Formula parameters. A
\tangle{a}in a formula needs its range and step from somewhere. Declare them with a<t-var>next to the formula. - Constants. A value the reader shouldn't change, but that you want to name, such as
<t-var name="g" value="9.81">. Expressions can then useg. - Cleaner prose. Put all of a post's declarations in one place, and use bare
<t-num name="…">views in the text.