6

Consider the following MWE

\documentclass[border=10 pt]{standalone}
\usepackage{mathtools,setspace}

\begin{document}
$\displaystyle
{\setstretch{1.5}
\begin{array}{ccccccccccccccccccccccc} 
^{12} \mathrm{C}&+&^{1} \mathrm{H} &\longrightarrow& ^{13}\mathrm{N}&+&\gamma\\
&&&&^{13} \mathrm{N}& \longrightarrow&^{13} \mathrm{C}&+&e^{+}&+&\nu\\
&&&&&&^{13} \mathrm{C}&+&^{\mathrm{l}} \mathrm{H}& \longrightarrow&^{14} \mathrm{N}&+&\gamma\\
&&&&&&&&&&^{14} \mathrm{N}&+&^{\mathrm{l}} \mathrm{H}& \longrightarrow&^{15} \mathrm{O}&+&\gamma\\
&&&&&&&&&&&&&&^{15} \mathrm{O}& \longrightarrow&^{15} \mathrm{N}&+&e^{+}&+&\nu\\
&&&&&&&&&&&&&&&&^{15} \mathrm{N}&+&^{1} \mathrm{H} &\longrightarrow&^{12} \mathrm{C}&+&^{4} \mathrm{He}
\end{array}}
$ 
\end{document}

with the output enter image description here The output is pretty much what I'm looking for, but the way I get it seems rather clunky to me... Is there a better way to get the same output? The only relevant part here is that the same elements in each reaction need to be below each other... The spacing of the other parts doesn't have to be the same as in the picture..

4

It's a matter of opinion whether this is less clunky...it eliminates all & tab characters, but requires multiple \stackunders and some bracing.

The appearance is a bit different, however "the same elements of each reaction are below each other", as requested by the OP. While there are no other alignments that apply one may observe that the spacing on any given line is "correct".

\documentclass[border=10 pt]{standalone}
\usepackage{mathtools,setspace,stackengine}
\begin{document}
\renewcommand\stackalignment{l}
\renewcommand\stacktype{L}
\setstackgap{L}{1.4\baselineskip}
\stackMath
$\displaystyle
^{12}\mathrm{C}+^{1}\mathrm{H}\longrightarrow             \stackunder{^{13}\mathrm{N}+\gamma}{
 ^{13}\mathrm{N}\longrightarrow                        \stackunder{^{13}\mathrm{C}+e^{+}+\nu}{
  ^{13}\mathrm{C}+^{\mathrm{l}}\mathrm{H}\longrightarrow  \stackunder{^{14}\mathrm{N}+\gamma}{
   ^{14}\mathrm{N}+^{\mathrm{l}}\mathrm{H}\longrightarrow \stackunder{^{15}\mathrm{O}+\gamma}{
    ^{15}\mathrm{O}\longrightarrow                     \stackunder{^{15}\mathrm{N}+e^{+}+\nu}{
     ^{15}\mathrm{N}+^{1}\mathrm{H}\longrightarrow           ^{12}\mathrm{C}+^{4}\mathrm{He}
}}}}}
$
\end{document}

enter image description here

6

Enough simple?

\documentclass{report}
\usepackage{mhchem,parskip}
\def\a{\phantom{\ce{^12C + ^1H ->}}}
\def\b{\phantom{\ce{^13N ->}}}
\begin{document}
\ce{^12C + ^1H -> ^13N + \gamma}\par
\a\ce{^13N -> ^13C + $e^+$ + \nu}\par
\a\b\ce{^13C + ^1H -> ^14N + \gamma}
\end{document}

mwe

  • Thank you very much for the answer! I choose Steven B. Segletes solution since it doesn't require new commands for every reaction, nevertheless a very nice solution. – Sito May 24 at 11:28
3

I suggest to align your entries like the way I did (using Tab) to make it easier to read and modify if needed. I have used \newcommand to create a way for you to enter the data of a row and every cell in the array is encapsulated by \mathrm{...}. Also, I changed the 23 cs you had in the array to *{23}{c}.

Output

\documentclass[border=10 pt]{standalone}
\usepackage{mathtools,setspace}
% Usage:
% \data{operand-1}{operator-1}{operand-2}{operator-2}{operand-3}{operator-3}{operand-4}
% Simple example:
% \data{a}{+}{b}{-}{c}{*}{d}
\newcommand{\data}[7]{%
    \ensuremath{%
        \mathrm{#1} & \mathrm{#2} & \mathrm{#3} & \mathrm{#4} & \mathrm{#5} & \mathrm{#6} & \mathrm{#7}
    }%
}%
\begin{document}
$\displaystyle
{\setstretch{1.5}
\begin{array}{*{23}{c}} 
                    \data{^{12} C}{+}               {^{1} H}    {\longrightarrow}   {^{13} N}   {+}{\gamma} \\
&&&&                \data{^{13} N}{\longrightarrow} {^{13} C}   {+}                 {e^{+}}     {+}{\nu}    \\
&&&&&&              \data{^{13} C}{+}               {^{1} H}    {\longrightarrow}   {^{14} N}   {+}{\gamma} \\
&&&&&&&&&&          \data{^{14} N}{+}               {^{1} H}    {\longrightarrow}   {^{15} O}   {+}{\gamma} \\
&&&&&&&&&&&&&&      \data{^{15} O}{\longrightarrow} {^{15} N}   {+}                 {e^{+}}     {+}{\nu}    \\
&&&&&&&&&&&&&&&&    \data{^{15} N}{+}               {^{1} H}    {\longrightarrow}   {^{12} C}   {+}{^{4} He}\\
\end{array}}
$
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.