Merge pull request #36 from DARC-e-V/feature-add-more-units

feature: add decibel and percent
This commit is contained in:
Matthias Jung
2026-01-04 18:04:03 +04:00
committed by GitHub
+10
View File
@@ -2,10 +2,12 @@ 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}}",
"\\squared": "{^{2}}",
"\\cubed": "{^{3}}",
"\\per": "/",
"\\percent": "\\%",
"\\tera": "T",
"\\giga": "G",
"\\mega": "M",
@@ -22,6 +24,14 @@ document.addEventListener("DOMContentLoaded", function() {
"\\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}",