I am writing a document that is specifying a language with associated grammar and semantics. For this I have written the specification in Latex, using a method very similar to the one presented here.
That is: it heavily uses Latex's \newcommand
macros. However, the contents of the commands themselves are nothing fancy and falls within the subset of Latex that MathJax supports.
I am slowly rewriting my documentation to Org mode, partially because of the HTML backend, allowing me to not only generate the original-ish PDF, but also a HTML page containing the same.
Now my question is: how can I export my (big list of) Latex \newcommand
macros to Org
such that they get compiled back to their originals on the Latex backend, but to their MathJax equivalent when exporting with the HTML backend?
Bonus question: Is it possible to redefine macros in MathJax? My original version contains several iterations of the same things, and overloads the macros by simply calling \renewcommand
. Ideally, I would replicate this in MathJax, but it is not a dealbreaker: I can "simply" append some version id to each new iteration of the command, i.e. \somecommandA
, \somecommandB
etc.