3

Currently, there is a large gap between the 2 segments of a line, causing its index to be pushed to the following line. How can I prevent this?

\documentclass{article}

\usepackage{amsmath}
\usepackage{mhchem}
\usepackage{amssymb}

\begin{document}
Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)} \\
\begin{alignat}{2}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} &\Delta H &=  -786 kJ\\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} &\Delta H &= -858 kJ\\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} &\Delta H &= 1560 kJ\\
\nonumber \ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} &\indent \Delta H &= -786-858+1560\\ 
\nonumber & &&= -84 kJ \\
\nonumber &&\therefore \Delta H_{f(C_2H6)}^0 &= -84kJ 
\end{alignat}{2}
\end{document}

enter image description here

1
  • 1
    Other typography issues: Write phyical units (kJ) upright and separated by a space. H_{f(C_2H6)}^0 is wrong on several levels: subscript f should be upright, subscript formula should be upright (use \ce), superscript is not a 0, but \circ. IUPAC recommendation (Green Book) is to write \Delta_{\mathrm{f}}H^\circ (\ce{C2H6}). Lastly, are you sure about your calculation? Unit of standard enthalpy is not kJ.
    – mhchem
    Jun 10, 2019 at 5:48

4 Answers 4

4

Here, I use \mathllap on the last line. But as you can see, there is still one remaining margin issue that you need to consider.

Also, the \end{alignat} does not take an argument.

\documentclass{article}
\usepackage[pass,showframe]{geometry}
\usepackage{mathtools}
\usepackage{mhchem}
\usepackage{amssymb}

\begin{document}
Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)} \\
\begin{alignat}{2}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} &\Delta H &=  -786 kJ\\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} &\Delta H &= -858 kJ\\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} &\Delta H &= 1560 kJ\\
\nonumber \ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} &\indent \Delta H &= -786-858+1560\\ 
\nonumber & &&= -84 kJ \\
\nonumber &&\mathllap{\therefore \Delta H_{f(C_2H6)}^0} &= -84kJ 
\end{alignat}
\end{document}

enter image description here

You could try to break up the remaining long line, but there may be other approaches, too...

I also made your kJ units upright, though, as marmot points out, the siunitx package is tailor made for applying units to quantities.

\documentclass{article}
\usepackage[pass,showframe]{geometry}
\usepackage{mathtools}
\usepackage{mhchem}
\usepackage{amssymb}

\begin{document}
Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)} \\
\begin{alignat}{2}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} &\Delta H &=  -786 \mathrm{\,kJ}\\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} &\Delta H &= -858 \mathrm{\,kJ}\\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} &\Delta H &= 1560 \mathrm{\,kJ}\\
\nonumber \ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} &\indent \Delta H &= -786-858\\\nonumber&&&\phantom{{}={}}+1560\\ 
\nonumber & &&= -84 \mathrm{\,kJ} \\
\nonumber &&\mathllap{\therefore \Delta H_{f(C_2H6)}^0} &= -84\mathrm{\,kJ} 
\end{alignat}
\end{document}

enter image description here

4
  • You need another \nonumber in the second iteration; the last equation isn't numbered in the original. Jun 10, 2019 at 2:25
  • 2
    Wouldn't that be a nice opportunity to advertize siunitx for kJ?
    – user121799
    Jun 10, 2019 at 2:34
  • Thank you, @barbarabeeton Jun 10, 2019 at 3:19
  • 2
    Regarding H_{f(C_2H6)}^0 part: a. According to IUPAC, standard state should be denoted with either a superscript circle (^\circ) or a superscript Plimsoll symbol (^⦵ + xelatex compiler), not a zero; b. subscript f ("formation") should be upright, e.g. \mathrm{f}; c. It would be nice to fix typesetting for ethane (proper indices and upright font), e.g. with \ce{C2H6}. I also agree with @marmot that using siunitx would make the answer look more professional.
    – andselisk
    Jun 10, 2019 at 4:00
2

Use of fullpage style (must be the shortest CTAN manual that nobody reads :-)
you could just add in preamble

\usepackage{fullpage}

enter image description here

\documentclass{article}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{mhchem}
\usepackage{amssymb}

\begin{document}
Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)} \\
\begin{alignat}{2}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} &\Delta H &=  -786 kJ\\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} &\Delta H &= -858 kJ\\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} &\Delta H &= 1560 kJ\\
\nonumber \ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} &\indent \Delta H &= -786-858+1560\\ 
\nonumber & &&= -84 kJ \\
\nonumber &&\therefore \Delta H_{f(C_2H6)}^0 &= -84kJ 
\end{alignat}
\end{document}
0

This does steal a bit of the left margin, if that is not acceptable I think you would need to wrap the final term over two lines.

enter image description here

\documentclass{article}

\usepackage{amsmath}
\usepackage{mhchem}
\usepackage{amssymb}

\begin{document}
Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)}%Underfull \hbox (badness 10000) \\
\begin{alignat}{2}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} &\Delta H &=  -786 kJ\\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} &\Delta H &= -858 kJ\\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} &\Delta H &= 1560 kJ\\
\nonumber\hspace*{-250pt}\ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} &\Delta H &= -786-858+1560\\ 
\nonumber & &&= -84 kJ \\
\nonumber &\therefore& \Delta H_{f(C_2H6)}^0  &= -84kJ 
\end{alignat}{2}
\end{document}

Note I moved the \therefore back a bit so it's not so cramped (and so the display is a bit narrower and requires less overhang). Also never use \\ before a display.

2
  • Hi, can you elaborate a little bit on what you meant when you said "never use \\ before a display"? Was there an extra \\ in my document where there shouldn't have been one?
    – David Lu
    Jun 12, 2019 at 5:00
  • 1
    @DavidLu yes latex must have screamed badness 10000 at you:-) (that is it's maximum level in its assessment of the poor quality of the output), the \\ before \begin{alignat} on the first line after C2H6(g)} is wrong. Jun 12, 2019 at 13:05
0

If you have space constraints, you can use more lines:

\documentclass{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}
\usepackage{siunitx}

\newcommand{\move}[2]{\hspace{#1}\makebox[0pt][r]{$\displaystyle#2$}}

\begin{document}

Overall formation of ethane thingy: \ce{2 C(s) + 3 H2(g) -> C2H6(g)}, in units~\si{\kilo\joule}
\begin{align}
\ce{2C(s) + 2O2(g) &-> 2CO2(g)} \\
  \nonumber &\move{6em}{\Delta H} = -786 \\
\ce{3H2(g) + 3/2 O2(g) &-> H2O(l)} \\
  \nonumber & \move{6em}{\Delta H} = -858 \\
\ce{2 CO2(g) + 3 H2O(l) &-> C2H6(g) + 7/2 O2 (g)} \\
  \nonumber & \move{6em}{\Delta H} = 1560 \\
\ce{2 C(s) + 3 H2(g) + 7/2 O2(g) &-> C2H6(g) + 7/2 O2(g)} \\
  \nonumber & \move{6em}{\Delta H} = -786-858+1560\\ 
  \nonumber & \move{6em}{} = -84 \\
  \nonumber & \move{6em}{\therefore \Delta H_{f(\ce{C_2H6})}^0} = \SI{-84}{\kilo\joule}
\end{align}

\end{document}

enter image description here

You must log in to answer this question.

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