mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.01k stars 1.16k forks source link

\LaTeX should not be italic #3246

Open linuxbckp opened 1 week ago

linuxbckp commented 1 week ago

Replace the text below with the details of the issue you are facing.
DO NOT simply erase the form and type a free-form response.

Issue Summary

\LaTeX should not be italic https://t.tutu.to/img/visLz

Steps to Reproduce:

Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?

Technical details:

I am using the following MathJax configuration:

idk

and loading MathJax via

<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

https://decadroid.github.io/mathjax-live-editor/

Supporting information:

dpvc commented 1 week ago

In actual LaTeX, the \LaTeX macro is actually only valid in text mode, not math mode, so what it should produce in math mode is not clear. In text mode, \LaTeX is typeset in the surrounding font, so can be upright, italic, bold, sans-serif, etc., as shown in the table below:

Actual LaTeX

latex

So in math mode, it would be natural to typeset it in the math italic font that would be used in that setting.

In MathJax, you can use \rm or \mathrm to get an upright version; e.g., {\rm\latex} or \mathrm{\LaTeX}. But you can also get a bold or sans-serif, or other version, as in \mathbf{\LaTeX}, \mathsf{\LaTeX}. For example:

MathJax

mj-latex

If the \LaTeX macro were to force upright roman letters, this would not be possible.

If you want to force that yourself, however, you can do

\let\myLaTeX=\LaTeX
\renewcommand{\LaTeX}{\mathrm{\myLaTeX}

once at the top of you page, for example, and then \LaTeX would be upright for the rest of that page.