Skip to content

Commit

Permalink
feat(math): Add mathcal, mathbb and similar commands in TeX-like math
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Oct 23, 2024
1 parent 9954ec3 commit 01c8f48
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/math/texlike.lua
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,21 @@ compileToMathML(
\def{Phi}{\mi[mathvariant=normal]{Φ}}
\def{Psi}{\mi[mathvariant=normal]{Ψ}}
\def{Omega}{\mi[mathvariant=normal]{Ω}}
% Some calligraphic (script), fraktur, double-struck styles:
% Convenience for compatibility with LaTeX.
\def{mathcal}{\mi[mathvariant=script]{#1}}
\def{mathfrak}{\mi[mathvariant=fraktur]{#1}}
\def{mathbb}{\mi[mathvariant=double-struck]{#1}}
% Some style-switching commands for compatibility with LaTeX math.
% Caveat emptor: LaTeX would allow these to apply to a whole formula.
% We can't do that in MathML, as mathvariant applies to token elements only.
% Also note that LaTeX and related packages may have many more such commands.
% We only provide a few common ('historical') ones here.
\def{mathrm}{\mi[mathvariant=normal]{#1}}
\def{mathbf}{\mi[mathvariant=bold]{#1}}
\def{mathit}{\mi[mathvariant=italic]{#1}}
\def{mathsf}{\mi[mathvariant=sans-serif]{#1}}
\def{mathtt}{\mi[mathvariant=monospace]{#1}}
% Modulus operator forms
\def{bmod}{\mo{mod}}
Expand Down

0 comments on commit 01c8f48

Please sign in to comment.