[{"name":"ETeX.Transform","comment":" ETeX is a lighter notation for mathematics that can be mixed freely with\nordinary TeX. Where TeX has `\\frac{1}{n+1}`, ETeX has `frac(1, n+1)`; bare\nnames such as `alpha` or `int` become `\\alpha` and `\\int`. Plain TeX passes\nthrough unchanged:\n\n    transformETeX Dict.empty \"frac(1, n+1)\" == \"\\\\frac{1}{ n+1}\"\n\n    transformETeX Dict.empty \"\\\\frac{1}{n+1}\" == \"\\\\frac{1}{n+1}\"\n\nInput that cannot be parsed is returned with an `[ETeX error]` marker in front,\nso the problem is visible rather than silently dropped.\n\n\n# Transforming math\n\n@docs transformETeX, evalStr\n\n\n# User-defined macros\n\n@docs MathMacroDict, makeMacroDict, toLaTeXNewCommands\n\n\n# LET ... IN\n\n@docs reduceLet\n\n\n# LaTeX back to ETeX\n\n@docs inverseTransformETeX\n\n","unions":[],"aliases":[{"name":"MathMacroDict","comment":" User-defined macros, as built by `makeMacroDict`.\n","args":[],"type":"ETeX.MathMacros.MathMacroDict"}],"values":[{"name":"evalStr","comment":" Transform ETeX to TeX for display (e.g. by KaTeX): like `transformETeX`,\nbut calls to user-defined macros are expanded in place, since the renderer does\nnot know their definitions.\n","type":"ETeX.Transform.MathMacroDict -> String.String -> String.String"},{"name":"inverseTransformETeX","comment":" Partial inverse of `transformETeX`. Parses LaTeX-flavored input and renders\nit back in ETeX form: braces become parentheses, multi-argument macros use\ncomma-separated arguments, and bare macros drop the leading backslash.\n\n    inverseTransformETeX Dict.empty \"\\\\sin{x^2}\"   == \"sin(x^2)\"\n    inverseTransformETeX Dict.empty \"\\\\frac{1}{2}\" == \"frac(1,2)\"\n    inverseTransformETeX Dict.empty \"\\\\alpha\"      == \"alpha\"\n\nThis is a partial inverse: it handles the simple cases above and passes\nthrough expressions it does not know how to re-express in ETeX form.\n\n","type":"ETeX.Transform.MathMacroDict -> String.String -> String.String"},{"name":"makeMacroDict","comment":" Build a `MathMacroDict` from macro definitions, one per line, in either\nform:\n\n    nat: mathbb N\n    \\newcommand{\\reals}{\\mathbb{R}}\n\nIn the ETeX form, `#1`, `#2`, ... are the arguments. Lines that are not\ndefinitions are ignored.\n","type":"String.String -> Dict.Dict String.String ETeX.MathMacros.MacroBody"},{"name":"reduceLet","comment":" Expand a `LET ... IN` block: each single-letter variable defined between\n`LET` and `IN` is replaced by its definition in the body. Input without a\n`LET` block is returned unchanged. `transformETeX` and `evalStr` do this\nthemselves; use `reduceLet` for math that is not passed through them.\n\n    reduceLet \"LET\\n  A = x^2\\nIN\\n  A + 1\" == \"x^2 + 1\"\n\n","type":"String.String -> String.String"},{"name":"toLaTeXNewCommands","comment":" Turn macro definitions (the same lines `makeMacroDict` reads) into LaTeX\n`\\newcommand`s, for a LaTeX preamble. `\\newcommand` and `\\renewcommand` lines\npass through unchanged.\n","type":"String.String -> String.String"},{"name":"transformETeX","comment":" Transform ETeX to TeX for export: ETeX notation becomes TeX, and calls to\nuser-defined macros are kept as macro calls (`\\name{...}`), to be defined by\nthe `\\newcommand`s that `toLaTeXNewCommands` produces.\n","type":"ETeX.Transform.MathMacroDict -> String.String -> String.String"}],"binops":[]}]