[LaTeX] isotopes - how to align left indices?

Click For Summary

Discussion Overview

The discussion revolves around formatting isotopes in LaTeX, specifically how to align left indices in chemical equations for proper rendering in MathJax. Participants explore various methods to achieve visually appealing and correctly formatted equations.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses dissatisfaction with the left alignment of indices in the equation and suggests that manual alignment using spaces may not be appropriate.
  • Another participant proposes using the mhchem package for better formatting, though it is noted that it must be rendered properly by MathJax.
  • A workaround is suggested using the \phantom{} macro to create uniform spacing for sub and superscripts, which can help with alignment issues.
  • Some participants discuss the effectiveness of using \phantom{} versus \mspace{8mu}, with one noting that \phantom{} may be easier and less reliant on trial and error.
  • There is a suggestion to attach sub and superscripts to an empty group to resolve alignment problems with the right arrow in the equation.
  • One participant emphasizes the importance of using \mathrm for chemical symbols to avoid misinterpretation as variables.

Areas of Agreement / Disagreement

Participants generally agree on the need for proper formatting and explore multiple methods to achieve this, but there is no consensus on the best approach, as different techniques are proposed and discussed.

Contextual Notes

Some methods discussed may depend on specific LaTeX packages or rendering capabilities, and participants express uncertainty about the effectiveness of certain approaches without the mhchem package.

Borek
Mentor
Messages
29,203
Reaction score
4,625
So, I have this equation:

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

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:

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

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,

^{137}_{\mspace{8mu} 55}\mathrm{Cs} \rightarrow ^{137}_{\mspace{8mu}56}\!\mathrm{Ba} + \mathrm e^- + \bar{\mathrm{\nu}}_e
 
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
.

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

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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K