[LaTeX] isotopes - how to align left indices?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 16K views
Messages
29,208
Reaction score
4,632
So, I have this equation:

[tex]^{137}_{55}Cs \rightarrow ^{137}_{56}Ba + e^- + \bar{\nu}_e[/tex]

What I don't like about it is that both 55 and 56 are left aligned and there is a gap between numbers and Ba symbol. I guess I could try to hand align them using spaces and negative spaces, but I also guess that's not the correct way to do it.
 
Physics news on Phys.org
I need it on the forum so it must be properly rendered by MathJax, sorry for not being clear.
 
Borek said:
So, I have this equation:

[tex]^{137}_{55}Cs \rightarrow ^{137}_{56}Ba + e^- + \bar{\nu}_e[/tex]

What I don't like about it is that both 55 and 56 are left aligned and there is a gap between numbers and Ba symbol. I guess I could try to hand align them using spaces and negative spaces, but I also guess that's not the correct way to do it.

As an admin, don't you have the power to make mhchem one of the automatically loaded packages? :devil:

Without this,

[tex]^{137}_{\mspace{8mu} 55}\mathrm{Cs} \rightarrow ^{137}_{\mspace{8mu}56}\!\mathrm{Ba} + \mathrm e^- + \bar{\mathrm{\nu}}_e[/tex]
 
D H said:
As an admin, don't you have the power to make mhchem one of the automatically loaded packages? :devil:

Very funny
grumpy_Borek.png
.

[tex]^{137}_{\mspace{8mu} 55}\mathrm{Cs} \rightarrow ^{137}_{\mspace{8mu}56}\!\mathrm{Ba} + \mathrm e^- + \bar{\mathrm{\nu}}_e[/tex]

So it has to be done manually, by tweaking spacers. Thanks.
 
Last edited by a moderator:
A workround without the package:

You can make the sub and superscripts the same width with the \phantom{} macro, which creates an empty space the size of its parameter. All digits are the same width in any sensible font, so it doesn't matter what digit you use to make the space.

The other alignment problem is because the sub and superscripts are attached to the right arrow. Attach them to an empty group {} instead.
Code:
^{137}_{\phantom{0}55}Cs \rightarrow {}^{137}_{\phantom{0}56}Ba + e^- + \bar{\nu}_e

$$^{137}_{\phantom{0}55}Cs \rightarrow {}^{137}_{\phantom{0}56}Ba + e^- + \bar{\nu}$$
 
I like the \phantom thing more - as far as I can tell it should be easier, as \mspace{8mu} may require trial and error to select correct number of math units?
 
AlephZero said:
You can make the sub and superscripts the same width with the \phantom{} macro
Much better. I forgot all about a phantom zero. I tend to use phantom with a minus sign to make arrays line up better, but phantom works quite nicely with numbers as well.

The other alignment problem is because the sub and superscripts are attached to the right arrow. Attach them to an empty group {} instead.
Nice catch on the problem with barium.

One last thing I would suggest: Standard nomenclature dictates that element names be non-italicized. Those chemical symbols should be in a \mathrm. This cures another problem: Without the \mathrm, sees that "Ba" as the variable B times the variable a, with an implied '*' between the B and the a.