Math & Sciencesiunitx in align* environment

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

siunitx in align* environment

Post by hugovdberg »

I have been searching the internet and this forum for some time but can't find an answer to my problem.

I have this code:

Code: Select all

\documentclass[a4paper, draft]{amsart}

\usepackage{nag}
\usepackage{siunitx}

\begin{document}

\begin{align*}
q_{x}	&= -K_{x,\text{avg}}\frac{\Delta{h}}{\Delta{x}} \\
	&= -\frac{K_{x,A}+K_{x,C}}{2}\frac{\Delta{h}}{\Delta{x}} \\
%	&= -\frac{\SI{0.35}{\metre\per\day}+\SI{0.25}{\metre\per\day}}{2}\frac{\SI{44.50}{\metre}-\SI{44.62}{\metre}}{\SI{100}{\metre}} \\
%	&= \SI{-0.30}{\metre\per\day}\frac{\SI{-0.12}{\metre}}{\SI{100}{\metre}} \\
%	&= \SI{3.6e-4}{\metre\per\day}
\end{align*}

Assuming this specific discharge applies over the full saturated height of the upper sand, estimate the rate of groundwater seepage [\si{\cubic\liter}/T] from the upper sand to the stream, per meter of stream (a strip \SI{1}{\metre} thick in the $y$ direction into the page).

\end{document}
When uncomment any of the three lines inside the align* environment I get the following error:

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   \egroup 
l.14 \end{align*}
                 ^^M
? 
I have double checked the brackets etc. and as far as I can tell they all match. Also it is not an incompatibility between \SI and \frac, because when I only uncomment the last line it still gives this error. Can anyone tell what going wrong here?
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

siunitx in align* environment

Post by Stefan Kottwitz »

Hi,

it works for me with a current version of siunitx (siunitx 2012/01/26 v2.4j):
siunitx-align.png
siunitx-align.png (23.31 KiB) Viewed 4913 times
Check your siunitx version in your .log file, and if it's older consider updating it.

Stefan
LaTeX.org admin
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Re: siunitx in align* environment

Post by hugovdberg »

Apparently Ubuntu 11.10 still ships a very much outdated version of TeX Live (including siunitx version 2009/09/21 v1.3a), so I'm currently downloading TeX Live 2011, hope this fixes the problem. Thanks for your help so far!
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
User avatar
Stefan Kottwitz
Site Admin
Posts: 10344
Joined: Mon Mar 10, 2008 9:44 pm

Re: siunitx in align* environment

Post by Stefan Kottwitz »

Very good idea to install TeX Live 2011. After the installation, perhaps run an update of the TeX Live manager and an update of all packages again to get the most up-to-date installation.

Stefan
LaTeX.org admin
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Re: siunitx in align* environment

Post by hugovdberg »

Updating to the latest version of TeX Live 2011 did solve the problem, thanks a lot!
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Post Reply