MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Question: Removing content added via tex2chtml

Open mayurankv opened this issue 2 years ago • 1 comments

Hi, I was wondering if there was a way to remove tex definitions added via MathJax.tex2chtml(texString)? If there is not aw way to specifically remove such a set of loaded commands, is there a way to remove all such commands (reset all commands to default)?

mayurankv avatar Dec 15 '23 11:12 mayurankv

There is no current mechanism to remove definitions (the begingroup has not yet been ported to v3). But your question is perhaps more subtle than you may realize, as definitions can be made in a variety of ways, not just from \newcommand or \def, but also from auto-loading extensions, or from explicit \require{package} commands. The begingroup extension is not likely to remove those, so if you want a truly reset TeX input jax, your best bet is to use

MathJax.startup.getComponents();

This will build new instances of the input and output jax, as well as the document handler and adaptor. Perhaps that is what you are looking for.

dpvc avatar Dec 16 '23 17:12 dpvc