document.addEventListener("DOMContentLoaded", function() { var macros = { ",": (context) => context.future()?.text === " " ? "{\\char`,}" : "\\char`,", "\\qty": "{#1\\,\\mathrm{#2}}", "\\qtyrange": "{#1\\text{--}#2\\,\\mathrm{#3}}", "\\unit": "{\\mathrm{#1}}", "\\num": "{#1}", "\\squared": "{^{2}}", "\\cubed": "{^{3}}", "\\per": "/", "\\percent": "\\%", "\\tera": "\\text{T}", "\\giga": "\\text{G}", "\\mega": "\\text{M}", "\\kilo": "\\text{k}", "\\dezi": "\\text{d}", "\\centi": "\\text{c}", "\\milli": "\\text{m}", "\\micro": "\\text{μ}", "\\nano": "\\text{n}", "\\pico": "\\text{p}", "\\kilogram": "\\text{kg}", "\\gram": "\\text{g}", "\\meter": "\\text{m}", "\\second": "\\text{s}", "\\hour": "\\text{h}", "\\ampere": "\\text{A}", "\\kelvin": "\\text{K}", "\\mol": "\\text{mol}", "\\bel": "\\text{B}", "\\dezibel": "\\text{dB}", "\\dB": "\\text{dB}", "\\dBm": "\\text{dBm}", "\\dBu": "\\text{dBu}", "\\dBW": "\\text{dBW}", "\\dBi": "\\text{dBi}", "\\dBd": "\\text{dBd}", "\\candela": "\\text{cd}", "\\newton": "\\text{N}", "\\hertz": "\\text{Hz}", "\\pascal": "\\text{Pa}", "\\volt": "\\text{V}", "\\watt": "\\text{W}", "\\joule": "\\text{J}", "\\henry": "\\text{H}", "\\farad": "\\text{F}", "\\coulomb": "\\text{C}", "\\ohm": "\\Omega", "\\Ohm": "\\Omega", "\\weber": "\\text{Wb}", "\\tesla": "\\text{T}", "\\bit": "\\text{b}", "\\baud": "\\text{Bd}", "\\degree": "^\\circ", "\\degreeCelsius": "^\\circ\\text{C}", }; renderMathInElement(document.body, { delimiters: [ {left: '$$', right: '$$', display: true}, // Note: $$ has to come before $ {left: '$', right: '$', display: false}, {left: '\\[', right: '\\]', display: true}, {left: "\\(", right: "\\)", display: false}, ], throwOnError : false, macros: macros }); });