13

I'm currently writing some blog content on Ghost, which uses Markdown similar to the SE Network. Unfortunately however, when attempting to subscript in math mode i.e. $3_{x}$, the underscore is interpreted by Markdown as italicizing text, and prevents my math from showing up correctly.

Having already filed a support ticket, for the time being I was wondering if there is any other way to nicely subscript in math mode in LaTeX.

1
  • 2
    You could also try escaping the Markdown character with a backslash: $3\_{x}.
    – ComFreek
    Commented Sep 27, 2015 at 10:37

2 Answers 2

20

_ is equal to \sb. Just use $3\sb{x}$.

5
  • 1
    And ^ is equal to \sp.
    – Manuel
    Commented Sep 26, 2015 at 21:22
  • 1
    Or you can define your own with \let\whatever_ or \def\whatever{_} (in this last case, it's not equal, but just expands to _).
    – Manuel
    Commented Sep 26, 2015 at 21:40
  • Yeah for some reason \sb had issues as well, so I ended up just writing a little macro in the script for the template that expands to _. Thanks for your help!
    – miradulo
    Commented Sep 26, 2015 at 21:41
  • 1
    What problems did \sb give you?
    – Manuel
    Commented Sep 26, 2015 at 21:48
  • 1
    Undefined control sequence, I suppose it is because I'm using a MathJax script?
    – miradulo
    Commented Sep 26, 2015 at 21:50
2

On the platform I'm using, \sb was undefined, perhaps because it's using MathJax like @miradulo said. At least on my platform though, I was able to "escape" the underscore.

Before:

$$|A\rangle=\alpha_u|u\rangle+\alpha_d|d\rangle$$

enter image description here

After:

$$|A\rangle=\alpha\_u|u\rangle+\alpha\_d|d\rangle$$

enter image description here

5
  • 1
    Sorry but this answer is wrong. It might work on your "platform" (whatever that may be) but not in TeX.
    – campa
    Commented May 2, 2023 at 13:37
  • 1
    I agree but when I searched my problem on Google, this was the first hit. So I thought it might help others. Commented May 2, 2023 at 14:30
  • 1
    @campa: This site is for TeX, LaTeX and friends — i.e. closely related systems. MathJax (which this looks like) is generally considered borderline, as described in its tag description; questions about its LaTeX-like input language are usually accepted as on-topic (as opposed to eg installation issues for it, which are not). Commented May 2, 2023 at 17:18
  • 1
    @PeterLeFanuLumsdaine I disagree. A MathJax answer might be borderline on topic if at least it works the same way in TeX. However, this answer will fail in TeX systems, and as such I consider it off-topic. Please note that I haven't downvoted or flagged the answer; but I've stated my point of view (maybe too harshly, and I apologize for that) and I stand by it.
    – campa
    Commented May 2, 2023 at 19:12
  • MathJax and Katex clearly state that they don't support full LaTeX and would try to provide only most used commands.
    – gildux
    Commented Sep 16, 2023 at 1:19

You must log in to answer this question.

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