-1
$\begingroup$

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.

$\endgroup$
  • 6
    $\begingroup$ 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. $\endgroup$ – Trevor Gunn Jan 2 at 17:02
  • 1
    $\begingroup$ @Trevor it's also in LaTeX as easy as \iflatextrue ... \else ...\fi $\endgroup$ – Roddy MacPhee Jan 3 at 20:54
3
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – R. Bosman Jan 2 at 16:52
  • $\begingroup$ Here's a partial solution for you. $\endgroup$ – Asaf Karagila Jan 2 at 17:16
  • $\begingroup$ why not set a if* up so you can turn it true or false for the document ? you want... $\endgroup$ – Roddy MacPhee Jan 3 at 3:00

Not the answer you're looking for? Browse other questions tagged .