I think I've found a small bug in the way the showonlyrefs=true
option in mathtools
works. Consider this semi-minimal example:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc} % UFT8 - danske bogstaver og andet godt fra havet
\usepackage[T1]{fontenc}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{mhchem}
\mathtoolsset{showonlyrefs=true} % ingen numerering af equations
\begin{document}
%
Seems fine
\begin{align*}
\Delta S &= \sum(S^{\ominus}(\text{produkter})) - \sum(S^{\ominus} (\text{reaktanter})) \\
\Delta S &= (\SI{214}{\joule\per\kelvin\per\mole} + 2\cdot \SI{33}{\joule\per\kelvin\per\mole}) - (2\cdot \SI{27}{\joule\per\kelvin\per\mole} + \SI{6}{\joule\per\kelvin\per\mole}) \\
\Delta S &= \SI{247}{\joule\per\kelvin\per\mole}
\end{align*}
%
Not so fine
\begin{align}
\Delta S &= \sum(S^{\ominus}(\text{produkter})) - \sum(S^{\ominus}(\text{reaktanter})) \\
\Delta S &= (\SI{214}{\joule\per\kelvin\per\mole} + 2\cdot \SI{33}{\joule\per\kelvin\per\mole}) - (2\cdot \SI{27}{\joule\per\kelvin\per\mole} + \SI{6}{\joule\per\kelvin\per\mole}) \\
\Delta S &= \SI{247}{\joule\per\kelvin\per\mole}
\end{align}
\end{document}
Which gives the following:
In the first set of equations, I've removed the numbering with the *
sign, while in the second set I have not. However, I have the showonlyrefs=true
option set in mathtools
package, which usually removes all numbering of equations, unless it's being refered to. I would guess, that the long equations move the number to the next line, but somehow mathtools
can't remove that space.
Is this a bug or am I missing something here? I rather like the way I can remove numbering when it's not needed, so I'd rather not go back to manually managing which equations I'd like to be numbered.
\textwidth
, as you can check with theshowframe
option ofgeometry. If you set, say,
hmargin=3cm`, it's OK.mathtools
should, in my opinion, work as \begin{align*}, aka remove the line where the number "should" be.