diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-common-mathjax-siunitx.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-common-mathjax-siunitx.sty | 381 |
1 files changed, 381 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-common-mathjax-siunitx.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-common-mathjax-siunitx.sty new file mode 100644 index 00000000000..877fa487e04 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-common-mathjax-siunitx.sty @@ -0,0 +1,381 @@ +%% +%% This is file `lwarp-common-mathjax-siunitx.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lwarp.dtx (with options: `common-mathjax-siunitx') +%% This is a generated file. +%% Copyright 2016-2022 Brian Dunn +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. + + +\begin{warpMathJax} +\LWR@infoprocessingmathjax{siunitx} +\CustomizeMathJax{\newcommand{\tothe}[1]{^{#1}}} +\CustomizeMathJax{\newcommand{\raiseto}[2]{{#2}^{#1}}} +\CustomizeMathJax{\newcommand{\LWRsiunitxEND}{}} +\CustomizeMathJax{\def\LWRsiunitxang#1;#2;#3;#4\LWRsiunitxEND{% + \ifblank{#1}{}{\num{#1}\degree}% + \ifblank{#2}{}{\num{#2}^{\unicode{x2032}}}% \prime + \ifblank{#3}{}{\num{#3}^{\unicode{x2033}}}% \dblprime +}} +\CustomizeMathJax{\newcommand{\ang}[2][]{\LWRsiunitxang#2;;;\LWRsiunitxEND}} +\ExplSyntaxOn +\AtBeginDocument{ +\ifdefstring{\l__siunitx_output_decimal_tl}{{,}} + {\CustomizeMathJax{\def\LWRsiunitxdecimal{,}}} + {\CustomizeMathJax{\def\LWRsiunitxdecimal{.}}} +} +\ExplSyntaxOff +\CustomizeMathJax{\def\LWRsiunitxdistribunit{}} +\CustomizeMathJax{\newcommand{\LWRsiunitxENDTWO}{}} + +\CustomizeMathJax{\def\LWRsiunitxprintdecimalsubtwo#1,#2,#3\LWRsiunitxENDTWO{% + \ifblank{#1}{0}{\mathrm{#1}}% + \ifblank{#2}% + {}% + {% + {\LWRsiunitxdecimal}% + \mathrm{#2}% + }% +}} +\CustomizeMathJax{\def\LWRsiunitxprintdecimalsub#1.#2.#3\LWRsiunitxEND{% + \LWRsiunitxprintdecimalsubtwo#1,,\LWRsiunitxENDTWO% + \ifblank{#2}% + {}% + {% + {\LWRsiunitxdecimal}% + \LWRsiunitxprintdecimalsubtwo#2,,\LWRsiunitxENDTWO% + }% +}} + +\CustomizeMathJax{\newcommand{\LWRsiunitxprintdecimal}[1]{% + \LWRsiunitxprintdecimalsub#1...\LWRsiunitxEND% +}} +\CustomizeMathJax{\def\LWRsiunitxnumplus#1+#2+#3\LWRsiunitxEND{% + \ifblank{#2}% + {% + \LWRsiunitxprintdecimal{#1}% + }% no plus + {% + \ifblank{#1}% + {\LWRsiunitxprintdecimal{#2}}% leading plus, ignore + {% a+b + \LWRsiunitxprintdecimal{#1}% + \unicode{x02B}% plus sign + \LWRsiunitxprintdecimal{#2}% + }% + }% + \LWRsiunitxdistribunit% +}} +\CustomizeMathJax{\def\LWRsiunitxnumminus#1-#2-#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumplus#1+++\LWRsiunitxEND}% + {% + \ifblank{#1}{}{\LWRsiunitxprintdecimal{#1}}% + \unicode{x02212}% mathematical minus sign + \LWRsiunitxprintdecimal{#2}% + \LWRsiunitxdistribunit% + }% +}} +\CustomizeMathJax{\def\LWRsiunitxnumpmmacro#1\pm#2\pm#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumminus#1---\LWRsiunitxEND}% + {% + \LWRsiunitxprintdecimal{#1}% + \unicode{x0B1}% \pm + \LWRsiunitxprintdecimal{#2}% + \LWRsiunitxdistribunit% + }% +}} +\CustomizeMathJax{\def\LWRsiunitxnumpm#1+-#2+-#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumpmmacro#1\pm\pm\pm\LWRsiunitxEND}% + {% + \LWRsiunitxprintdecimal{#1}% + \unicode{x0B1}% \pm + \LWRsiunitxprintdecimal{#2}% + \LWRsiunitxdistribunit% + }% +}} +\CustomizeMathJax{\newcommand{\LWRsiunitxnumscientific}[2]{% + \ifblank{#1}% + {}% + {% + \ifstrequal{#1}{-}% + {-}% + {\LWRsiunitxprintdecimal{#1}\times}% + }% + 10^{\LWRsiunitxprintdecimal{#2}}% + \LWRsiunitxdistribunit% +}} +\CustomizeMathJax{\def\LWRsiunitxnumD#1D#2D#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumpm#1+-+-\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} +\CustomizeMathJax{\def\LWRsiunitxnumd#1d#2d#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumD#1DDD\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} +\CustomizeMathJax{\def\LWRsiunitxnumE#1E#2E#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumd#1ddd\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} +\CustomizeMathJax{\def\LWRsiunitxnume#1e#2e#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumE#1EEE\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} +\CustomizeMathJax{\def\LWRsiunitxnumx#1x#2x#3x#4\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnume#1eee\LWRsiunitxEND}% + {% + \ifblank{#3}% + {% + \LWRsiunitxnume#1eee\LWRsiunitxEND% + \times% + \LWRsiunitxnume#2eee\LWRsiunitxEND% + }% + {% + \LWRsiunitxnume#1eee\LWRsiunitxEND% + \times% + \LWRsiunitxnume#2eee\LWRsiunitxEND% + \times% + \LWRsiunitxnume#3eee\LWRsiunitxEND% + }% + }% +}} +\CustomizeMathJax{\newcommand{\num}[2][]{% + \LWRsiunitxnumx#2xxxxx\LWRsiunitxEND% +}} +\CustomizeMathJax{\newcommand{\si}[2][]{% + \mathrm{\gsubstitute{#2}{~}{\,}}% +}} +\CustomizeMathJax{\def\LWRsiunitxSIopt#1[#2]#3{% + \def\LWRsiunitxdistribunit{\,\si{#3}}% + {#2}\num{#1}% + \def\LWRsiunitxdistribunit{}% +}} + +\CustomizeMathJax{\newcommand{\LWRsiunitxSI}[2]{% + \def\LWRsiunitxdistribunit{\,\si{#2}}% + \num{#1}% + \def\LWRsiunitxdistribunit{}% +}} +\CustomizeMathJax{\newcommand{\SI}[2][]{% + \ifnextchar[% + {\LWRsiunitxSIopt{#2}}% + {\LWRsiunitxSI{#2}}% +}} +\CustomizeMathJax{\newcommand{\numlist}[2][]{\text{#2}}} +\CustomizeMathJax{\newcommand{\numrange}[3][]{% + \num{#2}\ \LWRsiunitxrangephrase\ \num{#3}% +}} +\CustomizeMathJax{\newcommand{\SIlist}[3][]{\text{#2}\,\si{#3}}} +\CustomizeMathJax{\newcommand{\SIrange}[4][]{% + \num{#2}\,#4\ \LWRsiunitxrangephrase\ \num{#3}\,#4% +}} +\CustomizeMathJax{\newcommand{\tablenum}[2][]{\mathrm{#2}}} +\CustomizeMathJax{\newcommand{\ampere}{\mathrm{A}}} +\CustomizeMathJax{\newcommand{\candela}{\mathrm{cd}}} +\CustomizeMathJax{\newcommand{\kelvin}{\mathrm{K}}} +\CustomizeMathJax{\newcommand{\kilogram}{\mathrm{kg}}} +\CustomizeMathJax{\newcommand{\metre}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\mole}{\mathrm{mol}}} +\CustomizeMathJax{\newcommand{\second}{\mathrm{s}}} +\CustomizeMathJax{\newcommand{\becquerel}{\mathrm{Bq}}} +\CustomizeMathJax{\newcommand{\degreeCelsius}{\unicode{x2103}}} +\CustomizeMathJax{\newcommand{\coulomb}{\mathrm{C}}} +\CustomizeMathJax{\newcommand{\farad}{\mathrm{F}}} +\CustomizeMathJax{\newcommand{\gray}{\mathrm{Gy}}} +\CustomizeMathJax{\newcommand{\hertz}{\mathrm{Hz}}} +\CustomizeMathJax{\newcommand{\henry}{\mathrm{H}}} +\CustomizeMathJax{\newcommand{\joule}{\mathrm{J}}} +\CustomizeMathJax{\newcommand{\katal}{\mathrm{kat}}} +\CustomizeMathJax{\newcommand{\lumen}{\mathrm{lm}}} +\CustomizeMathJax{\newcommand{\lux}{\mathrm{lx}}} +\CustomizeMathJax{\newcommand{\newton}{\mathrm{N}}} +\CustomizeMathJax{\newcommand{\ohm}{\mathrm{\Omega}}} +\CustomizeMathJax{\newcommand{\pascal}{\mathrm{Pa}}} +\CustomizeMathJax{\newcommand{\radian}{\mathrm{rad}}} +\CustomizeMathJax{\newcommand{\siemens}{\mathrm{S}}} +\CustomizeMathJax{\newcommand{\sievert}{\mathrm{Sv}}} +\CustomizeMathJax{\newcommand{\steradian}{\mathrm{sr}}} +\CustomizeMathJax{\newcommand{\tesla}{\mathrm{T}}} +\CustomizeMathJax{\newcommand{\volt}{\mathrm{V}}} +\CustomizeMathJax{\newcommand{\watt}{\mathrm{W}}} +\CustomizeMathJax{\newcommand{\weber}{\mathrm{Wb}}} +\CustomizeMathJax{\newcommand{\day}{\mathrm{d}}} +\CustomizeMathJax{\newcommand{\degree}{\mathrm{^\circ}}} +\CustomizeMathJax{\newcommand{\hectare}{\mathrm{ha}}} +\CustomizeMathJax{\newcommand{\hour}{\mathrm{h}}} +\CustomizeMathJax{\newcommand{\litre}{\mathrm{l}}} +\CustomizeMathJax{\newcommand{\liter}{\mathrm{L}}} +\CustomizeMathJax{\newcommand{\arcminute}{^\prime}} +\CustomizeMathJax{\newcommand{\minute}{\mathrm{min}}} +\CustomizeMathJax{\newcommand{\arcsecond}{^{\prime\prime}}} +\CustomizeMathJax{\newcommand{\tonne}{\mathrm{t}}} +\CustomizeMathJax{\newcommand{\astronomicalunit}{au}} +\CustomizeMathJax{\newcommand{\atomicmassunit}{u}} +\CustomizeMathJax{\newcommand{\bohr}{\mathit{a}_0}} +\CustomizeMathJax{\newcommand{\clight}{\mathit{c}_0}} +\CustomizeMathJax{\newcommand{\dalton}{\mathrm{D}_\mathrm{a}}} +\CustomizeMathJax{\newcommand{\electronmass}{\mathit{m}_{\mathrm{e}}}} +\CustomizeMathJax{\newcommand{\electronvolt}{\mathrm{eV}}} +\CustomizeMathJax{\newcommand{\elementarycharge}{\mathit{e}}} +\CustomizeMathJax{\newcommand{\hartree}{\mathit{E}_{\mathrm{h}}}} +\CustomizeMathJax{\newcommand{\planckbar}{\mathit{\unicode{x210F}}}} +\CustomizeMathJax{\newcommand{\angstrom}{\mathrm{\unicode{x212B}}}} +\CustomizeMathJax{\let\LWRorigbar\bar} +\CustomizeMathJax{\newcommand{\bar}{\mathrm{bar}}} +\CustomizeMathJax{\newcommand{\barn}{\mathrm{b}}} +\CustomizeMathJax{\newcommand{\bel}{\mathrm{B}}} +\CustomizeMathJax{\newcommand{\decibel}{\mathrm{dB}}} +\CustomizeMathJax{\newcommand{\knot}{\mathrm{kn}}} +\CustomizeMathJax{\newcommand{\mmHg}{\mathrm{mmHg}}} +\CustomizeMathJax{\newcommand{\nauticalmile}{\mathrm{M}}} +\CustomizeMathJax{\newcommand{\neper}{\mathrm{Np}}} +\CustomizeMathJax{\newcommand{\yocto}{\mathrm{y}}} +\CustomizeMathJax{\newcommand{\zepto}{\mathrm{z}}} +\CustomizeMathJax{\newcommand{\atto}{\mathrm{a}}} +\CustomizeMathJax{\newcommand{\femto}{\mathrm{f}}} +\CustomizeMathJax{\newcommand{\pico}{\mathrm{p}}} +\CustomizeMathJax{\newcommand{\nano}{\mathrm{n}}} +\CustomizeMathJax{\newcommand{\micro}{\mathrm{\unicode{x00B5}}}} +\CustomizeMathJax{\newcommand{\milli}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\centi}{\mathrm{c}}} +\CustomizeMathJax{\newcommand{\deci}{\mathrm{d}}} +\CustomizeMathJax{\newcommand{\deca}{\mathrm{da}}} +\CustomizeMathJax{\newcommand{\hecto}{\mathrm{h}}} +\CustomizeMathJax{\newcommand{\kilo}{\mathrm{k}}} +\CustomizeMathJax{\newcommand{\mega}{\mathrm{M}}} +\CustomizeMathJax{\newcommand{\giga}{\mathrm{G}}} +\CustomizeMathJax{\newcommand{\tera}{\mathrm{T}}} +\CustomizeMathJax{\newcommand{\peta}{\mathrm{P}}} +\CustomizeMathJax{\newcommand{\exa}{\mathrm{E}}} +\CustomizeMathJax{\newcommand{\zetta}{\mathrm{Z}}} +\CustomizeMathJax{\newcommand{\yotta}{\mathrm{Y}}} +\CustomizeMathJax{\newcommand{\percent}{\mathrm{\%}}} +\CustomizeMathJax{\newcommand{\meter}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\metre}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\gram}{\mathrm{g}}} +\CustomizeMathJax{\newcommand{\kg}{\kilo\gram}} +\CustomizeMathJax{\newcommand{\of}[1]{_{\mathrm{#1}}}} +\CustomizeMathJax{\newcommand{\squared}{^2}} +\CustomizeMathJax{\newcommand{\square}[1]{\mathrm{#1}^2}} +\CustomizeMathJax{\newcommand{\cubed}{^3}} +\CustomizeMathJax{\newcommand{\cubic}[1]{\mathrm{#1}^3}} +\CustomizeMathJax{\newcommand{\per}{\,\mathrm{/}}} +\CustomizeMathJax{\newcommand{\celsius}{\unicode{x2103}}} +\CustomizeMathJax{\newcommand{\fg}{\femto\gram}} +\CustomizeMathJax{\newcommand{\pg}{\pico\gram}} +\CustomizeMathJax{\newcommand{\ng}{\nano\gram}} +\CustomizeMathJax{\newcommand{\ug}{\micro\gram}} +\CustomizeMathJax{\newcommand{\mg}{\milli\gram}} +\CustomizeMathJax{\newcommand{\g}{\gram}} +\CustomizeMathJax{\newcommand{\kg}{\kilo\gram}} +\CustomizeMathJax{\newcommand{\amu}{\mathrm{u}}} +\CustomizeMathJax{\newcommand{\pm}{\pico\metre}} +\CustomizeMathJax{\newcommand{\nm}{\nano\metre}} +\CustomizeMathJax{\newcommand{\um}{\micro\metre}} +\CustomizeMathJax{\newcommand{\mm}{\milli\metre}} +\CustomizeMathJax{\newcommand{\cm}{\centi\metre}} +\CustomizeMathJax{\newcommand{\dm}{\deci\metre}} +\CustomizeMathJax{\newcommand{\m}{\metre}} +\CustomizeMathJax{\newcommand{\km}{\kilo\metre}} +\CustomizeMathJax{\newcommand{\as}{\atto\second}} +\CustomizeMathJax{\newcommand{\fs}{\femto\second}} +\CustomizeMathJax{\newcommand{\ps}{\pico\second}} +\CustomizeMathJax{\newcommand{\ns}{\nano\second}} +\CustomizeMathJax{\newcommand{\us}{\micro\second}} +\CustomizeMathJax{\newcommand{\ms}{\milli\second}} +\CustomizeMathJax{\newcommand{\s}{\second}} +\CustomizeMathJax{\newcommand{\fmol}{\femto\mol}} +\CustomizeMathJax{\newcommand{\pmol}{\pico\mol}} +\CustomizeMathJax{\newcommand{\nmol}{\nano\mol}} +\CustomizeMathJax{\newcommand{\umol}{\micro\mol}} +\CustomizeMathJax{\newcommand{\mmol}{\milli\mol}} +\CustomizeMathJax{\newcommand{\mol}{\mol}} +\CustomizeMathJax{\newcommand{\kmol}{\kilo\mol}} +\CustomizeMathJax{\newcommand{\pA}{\pico\ampere}} +\CustomizeMathJax{\newcommand{\nA}{\nano\ampere}} +\CustomizeMathJax{\newcommand{\uA}{\micro\ampere}} +\CustomizeMathJax{\newcommand{\mA}{\milli\ampere}} +\CustomizeMathJax{\newcommand{\A}{\ampere}} +\CustomizeMathJax{\newcommand{\kA}{\kilo\ampere}} +\CustomizeMathJax{\newcommand{\ul}{\micro\litre}} +\CustomizeMathJax{\newcommand{\ml}{\milli\litre}} +\CustomizeMathJax{\newcommand{\l}{\litre}} +\CustomizeMathJax{\newcommand{\hl}{\hecto\litre}} +\CustomizeMathJax{\newcommand{\uL}{\micro\liter}} +\CustomizeMathJax{\newcommand{\mL}{\milli\liter}} +\CustomizeMathJax{\newcommand{\L}{\liter}} +\CustomizeMathJax{\newcommand{\hL}{\hecto\liter}} +\CustomizeMathJax{\newcommand{\mHz}{\milli\hertz}} +\CustomizeMathJax{\newcommand{\Hz}{\hertz}} +\CustomizeMathJax{\newcommand{\kHz}{\kilo\hertz}} +\CustomizeMathJax{\newcommand{\MHz}{\mega\hertz}} +\CustomizeMathJax{\newcommand{\GHz}{\giga\hertz}} +\CustomizeMathJax{\newcommand{\THz}{\tera\hertz}} +\CustomizeMathJax{\newcommand{\mN}{\milli\newton}} +\CustomizeMathJax{\newcommand{\N}{\newton}} +\CustomizeMathJax{\newcommand{\kN}{\kilo\newton}} +\CustomizeMathJax{\newcommand{\MN}{\mega\newton}} +\CustomizeMathJax{\newcommand{\Pa}{\pascal}} +\CustomizeMathJax{\newcommand{\kPa}{\kilo\pascal}} +\CustomizeMathJax{\newcommand{\MPa}{\mega\pascal}} +\CustomizeMathJax{\newcommand{\GPa}{\giga\pascal}} +\CustomizeMathJax{\newcommand{\mohm}{\milli\ohm}} +\CustomizeMathJax{\newcommand{\kohm}{\kilo\ohm}} +\CustomizeMathJax{\newcommand{\Mohm}{\mega\ohm}} +\CustomizeMathJax{\newcommand{\pV}{\pico\volt}} +\CustomizeMathJax{\newcommand{\nV}{\nano\volt}} +\CustomizeMathJax{\newcommand{\uV}{\micro\volt}} +\CustomizeMathJax{\newcommand{\mV}{\milli\volt}} +\CustomizeMathJax{\newcommand{\V}{\volt}} +\CustomizeMathJax{\newcommand{\kV}{\kilo\volt}} +\CustomizeMathJax{\newcommand{\W}{\watt}} +\CustomizeMathJax{\newcommand{\uW}{\micro\watt}} +\CustomizeMathJax{\newcommand{\mW}{\milli\watt}} +\CustomizeMathJax{\newcommand{\kW}{\kilo\watt}} +\CustomizeMathJax{\newcommand{\MW}{\mega\watt}} +\CustomizeMathJax{\newcommand{\GW}{\giga\watt}} +\CustomizeMathJax{\newcommand{\J}{\joule}} +\CustomizeMathJax{\newcommand{\uJ}{\micro\joule}} +\CustomizeMathJax{\newcommand{\mJ}{\milli\joule}} +\CustomizeMathJax{\newcommand{\kJ}{\kilo\joule}} +\CustomizeMathJax{\newcommand{\eV}{\electronvolt}} +\CustomizeMathJax{\newcommand{\meV}{\milli\electronvolt}} +\CustomizeMathJax{\newcommand{\keV}{\kilo\electronvolt}} +\CustomizeMathJax{\newcommand{\MeV}{\mega\electronvolt}} +\CustomizeMathJax{\newcommand{\GeV}{\giga\electronvolt}} +\CustomizeMathJax{\newcommand{\TeV}{\tera\electronvolt}} +\CustomizeMathJax{\newcommand{\kWh}{\kilo\watt\hour}} +\CustomizeMathJax{\newcommand{\F}{\farad}} +\CustomizeMathJax{\newcommand{\fF}{\femto\farad}} +\CustomizeMathJax{\newcommand{\pF}{\pico\farad}} +\CustomizeMathJax{\newcommand{\K}{\mathrm{K}}} +\CustomizeMathJax{\newcommand{\dB}{\mathrm{dB}}} +\CustomizeMathJax{\newcommand{\kibi}{\mathrm{Ki}}} +\CustomizeMathJax{\newcommand{\mebi}{\mathrm{Mi}}} +\CustomizeMathJax{\newcommand{\gibi}{\mathrm{Gi}}} +\CustomizeMathJax{\newcommand{\tebi}{\mathrm{Ti}}} +\CustomizeMathJax{\newcommand{\pebi}{\mathrm{Pi}}} +\CustomizeMathJax{\newcommand{\exbi}{\mathrm{Ei}}} +\CustomizeMathJax{\newcommand{\zebi}{\mathrm{Zi}}} +\CustomizeMathJax{\newcommand{\yobi}{\mathrm{Yi}}} +\end{warpMathJax} +\endinput +%% +%% End of file `lwarp-common-mathjax-siunitx.sty'. |