Skip to main content
\(\require{cancel}\newcommand{\definiteintegral}[4]{\int_{#1}^{#2}\,#3\,d#4} \newcommand{\myequation}[2]{#1\amp =#2} \newcommand{\indefiniteintegral}[2]{\int#1\,d#2} \newcommand{\testingescapedpercent}{ \% } \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section23Units of Measure

Units of measure can be given xml treatment too with the quantity element. In , the siunitx package is loaded to achive unit handling. Since that package only offers SI units, some other common units will be added by MBX in the preamble. In HTML, the capabilities of siunitx are simulated, weakly. Note that at present, you should not attempt to use the quantity element within a math environment.

The value of gravitational constant \(g\) is 9.8 ms2. Force is measured in kg ms2, also known as one N. A quantity with rather ridiculous units is 23 µha23°C s2. One Hz is the same as 1s. You can have a unitless quantity, like 42, which may help with consistency between such numbers and units in the output. Some non-SI units are available, such as the absurd °F ft lbgal. The command \pi is recognized within mag in conversions to HTML, which is consistent with the behavior with a conversion to , for example there are 2\(\pi\) rad in a full circle.

For a full list of the allowed units and prefixes, see mathbook-units.xsl. If you have a need for more units, they need to be added to mathbook-units.xsl in the section that deals with units which are not part of siunitx by default. Note that the mag element should come first, followed by the unit element, followed by the per element.