Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

[LaTeX] isotopes - how to align left indices?

  1. May 2, 2012 #1

    Borek

    User Avatar

    Staff: Mentor

    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.
     
  2. jcsd
  3. May 2, 2012 #2
  4. May 2, 2012 #3

    Borek

    User Avatar

    Staff: Mentor

    I need it on the forum so it must be properly rendered by MathJax, sorry for not being clear.
     
  5. May 2, 2012 #4

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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]
     
  6. May 2, 2012 #5

    Borek

    User Avatar

    Staff: Mentor

    Very funny grumpy_Borek.png .

    So it has to be done manually, by tweaking spacers. Thanks.
     
    Last edited by a moderator: Apr 16, 2017
  7. May 2, 2012 #6

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    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 (Text):

    ^{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}$$
     
  8. May 2, 2012 #7

    Borek

    User Avatar

    Staff: Mentor

    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?
     
  9. May 2, 2012 #8

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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.

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: [LaTeX] isotopes - how to align left indices?
  1. Latex alignment (Replies: 2)

Loading...