class

MathJax::TeX::Parser

Inherits Reference < Object

Constants

ACCENTS = {"vec" => "→", "hat" => "^", "widehat" => "^", "bar" => "¯", "tilde" => "~", "widetilde" => "~", "dot" => "˙", "ddot" => "¨", "breve" => "˘", "check" => "ˇ", "acute" => "´", "grave" => "`", "mathring" => "˚"}
ALIGN_ENVS = {"aligned", "align", "align*", "split", "alignedat", "alignat", "alignat*", "flalign", "flalign*"}
ARROW_MERGE = {"↑", "↓"}

Operators MathJax merges when repeated.

BIG_SIZES = {"big" => "1.2em", "Big" => "1.623em", "bigg" => "2.047em", "Bigg" => "2.47em"}

\big(, \Big[, ... -> <mo minsize maxsize> (MathJax delimiter sizes)

INFIX_FRACS = {"over", "atop", "choose", "above", "overwithdelims", "atopwithdelims", "abovewithdelims"}
MATRIX_FENCES = {"pmatrix" => {"(", ")"}, "bmatrix" => {"[", "]"}, "Bmatrix" => {"{", "}"}, "vmatrix" => {"|", "|"}, "Vmatrix" => {"‖", "‖"}}
MAX_DEPTH = 50
MAX_EXPANSIONS = 1000
PHYSICS_MACROS = {"abs" => Macro.new(1, "\\left| #1\\right|"), "norm" => Macro.new(1, "\\left\\|#1\\right\\|"), "eval" => Macro.new(1, "\\left.#1\\right|"), "order" => Macro.new(1, "\\mathcal{O}\\left(#1\\right)"), "comm" => Macro.new(2, "\\left[#1,#2\\right]"), "acomm" => Macro.new(2, "\\left\\{#1,#2\\right\\}"), "pb" => Macro.new(2, "\\left\\{#1,#2\\right\\}"), "bra" => Macro.new(1, "\\left\\langle #1\\right|"), "ket" => Macro.new(1, "\\left| #1\\right\\rangle"), "braket" => Macro.new(1, "\\left\\langle #1\\right\\rangle"), "ketbra" => Macro.new(2, "\\left| #1\\right\\rangle\\!\\left\\langle #2\\right|"), "dyad" => Macro.new(2, "\\left| #1\\right\\rangle\\!\\left\\langle #2\\right|"), "mel" => Macro.new(3, "\\left\\langle #1\\middle|#2\\middle|#3\\right\\rangle"), "matrixel" => Macro.new(3, "\\left\\langle #1\\middle|#2\\middle|#3\\right\\rangle"), "expval" => Macro.new(1, "\\left\\langle #1\\right\\rangle"), "dd" => Macro.new(0, "\\,\\mathrm{d}"), "dv" => Macro.new(2, "\\frac{\\mathrm{d} #1}{\\mathrm{d}#2}"), "pdv" => Macro.new(2, "\\frac{\\partial #1}{\\partial #2}"), "fdv" => Macro.new(2, "\\frac{\\delta#1}{\\delta#2}"), "absval" => Macro.new(1, "\\left| #1\\right|")}

Constructors

new(string : String, display : Bool = false, macros : Hash(String, Macro) = {} of String => Macro, depth : Int32 = 0, physics : Bool = false)
Source

Instance methods

parse

Entry point: full expression -> node

Source

Nested types