d2-rs-math 0.1.0

Rust port of D2's d2latex package and mathjax-go: LaTeX layout and SVG.
Documentation
// Copyright (c) 2017-2022 The MathJax Consortium
// SPDX-License-Identifier: Apache-2.0
// Source-derived from pinned mathjax-go 94d80186bfd7; MathJax 3.2.2.
// Generated by tools/translate-font-bindings.py; see licenses/.
pub(super) fn wrapper(name: &str) -> Option<&'static str> {
    Some(match name {
        "mathrm" => "normal",
        "mathup" => "normal",
        "mathnormal" => "",
        "mathbf" => "bold",
        "mathbfup" => "bold",
        "mathit" => "-tex-mathit",
        "mathbfit" => "bold-italic",
        "mathbb" => "double-struck",
        "Bbb" => "double-struck",
        "mathfrak" => "fraktur",
        "mathbffrak" => "bold-fraktur",
        "mathscr" => "script",
        "mathbfscr" => "bold-script",
        "mathsf" => "sans-serif",
        "mathsfup" => "sans-serif",
        "mathbfsf" => "bold-sans-serif",
        "mathbfsfup" => "bold-sans-serif",
        "mathsfit" => "sans-serif-italic",
        "mathbfsfit" => "sans-serif-bold-italic",
        "mathtt" => "monospace",
        "mathcal" => "-tex-calligraphic",
        "mathbfcal" => "-tex-bold-calligraphic",
        "symrm" => "normal",
        "symup" => "normal",
        "symnormal" => "",
        "symbf" => "bold",
        "symbfup" => "bold",
        "symit" => "italic",
        "symbfit" => "bold-italic",
        "symbb" => "double-struck",
        "symfrak" => "fraktur",
        "symbffrak" => "bold-fraktur",
        "symscr" => "script",
        "symbfscr" => "bold-script",
        "symsf" => "sans-serif",
        "symsfup" => "sans-serif",
        "symbfsf" => "bold-sans-serif",
        "symbfsfup" => "bold-sans-serif",
        "symsfit" => "sans-serif-italic",
        "symbfsfit" => "sans-serif-bold-italic",
        "symtt" => "monospace",
        "symcal" => "-tex-calligraphic",
        "symbfcal" => "-tex-bold-calligraphic",
        _ => return None,
    })
}
pub(super) fn declaration(name: &str) -> Option<&'static str> {
    Some(match name {
        "rm" => "normal",
        "mit" => "italic",
        "oldstyle" => "-tex-oldstyle",
        "cal" => "-tex-calligraphic",
        "it" => "-tex-mathit",
        "bf" => "bold",
        "bbFont" => "double-struck",
        "scr" => "script",
        "frak" => "fraktur",
        "sf" => "sans-serif",
        "tt" => "monospace",
        _ => return None,
    })
}