math_spec.typesetting.markdown
GitHub-flavoured Markdown. GitHub renders math with MathJax, so the math is :class:LatexFormat's and only the document layer differs.
Both delimiters are the verbatim pair — $`…`$ inline and a math fence
for a block — because GitHub runs Markdown's escape pass inside a $…$
span, stripping the backslash from every escape TeX needs: \mathrm{gen\_bus}
reached MathJax as \mathrm{gen_bus}, a subscript, and \{0, 1\} as a
group with no braces. The verbatim pair hands the span over untouched, so the
math this prints is the math :mod:~math_spec.typesetting.latex prints, and
stays what every other MathJax and KaTeX reads too.
MarkdownFormat
#
Bases: LatexFormat
See :class:math_spec.typesetting.format.Format. Math is LaTeX's; prose is not.
dash = '—'
class-attribute
#
document(blocks, *, standalone)
#
No preamble: standalone adds the heading a fragment is pasted under.
Source code in src/math_spec/typesetting/markdown.py
equations(lines, *, numbered)
#
One fenced block per equation, with the name outside the math.
A label is the name the file gives the line rather than a symbol, so it
sets as the code span prose has and math does not, and aligned has
nothing to line up across one-equation blocks. numbered is ignored:
aligned cannot carry numbers.
Source code in src/math_spec/typesetting/markdown.py
escape(prose)
#
Prose with every special escaped, as the other two notations do, and a backtick span kept as the code span it is.