# Mathjax: how to ignore certain commands? [closed]

I'm writing a document in emac's org-mode, which exports both to Latex and to HTML. For the HTML portion, it uses Mathjax.

Now, I have some equation that uses the \textsc{x} command. This works fine within Latex, but not in Mathjax as it is not supported.

I want to tell Mathjax to simply ignore the \textsc commands, and just use whatever is inside "plainly". I.e. \textsc{x} = x. Is this possible?

Edit: to clarify: I want to export to both Latex and HTML. I want the textsc to be in my Latex pdf, but ignored by Mathjax. Removing all textsc therefore is not a solution, as then it will be absent in the Latex pdf as well.

• Questions about MathJax outside of its use on math.stackexchange.com are off-topic here. Stackoverflow has a mathjax tag and MathJax has an official user group for general support. Jan 2 '20 at 17:02
• @Trevor it's also in LaTeX as easy as \iflatextrue ... \else ...\fi
– user645636
Jan 3 '20 at 20:54

Yes. Do not type the \textsc part into your answer, and if you copy-paste, then remove it.

If you want a less-manual hack, go to the start of your text:

M-x replace-regexp <RET> \\textsc{$$[^\}]*$$} <RET> \1 <RET>

This should do the trick.

• I still want to be able to export to Latex pdf with the textsc in place. Removing it therefore is not an option. I have updated my question to reflect this situation Jan 2 '20 at 16:52
• Here's a partial solution for you.
– Asaf Karagila Mod
Jan 2 '20 at 17:16
• why not set a if* up so you can turn it true or false for the document ? you want...
– user645636
Jan 3 '20 at 3:00