11

Possible Duplicate:
Blank lines in align environment

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}

\begin{document}
\begin{align*} 
\ce{K_a} & = \frac{\ce{[H3O+][A^-]}}{\ce{[HA]}} \\

\end{align*}
\end{document}

gives

 Runaway argument?
 \ce {K_a} & = \frac {\ce {[H3O+][A^-]}}{\ce {[HA]}} \\ 
! Paragraph ended before \align* was complete.
<to be read again> 
                   \par 
l.8 

?

4
  • 12
    You can't have a blank line in the align* (or align) environment, or indeed in display math. – Joseph Wright Sep 30 '11 at 8:21
  • I vaguely remember now! Thanks! Post your comment as a solution and I will accept it. – ptrcao Sep 30 '11 at 8:27
  • 1
    @Joseph: I think this question is neither "too localized" nor an "exact duplicate". Please convert your commnet into an answer. – lockstep Sep 30 '11 at 14:59
  • @lockstep Done, in an enlarged form – Joseph Wright Sep 30 '11 at 15:03
14

You can't have a blank line in the align* (or align) environment, or indeed in display math. Thus you want

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}
\usepackage{amsmath}

\begin{document}
\begin{align*} 
  \ce{K_a} & = \frac{\ce{[H3O+][A^-]}}{\ce{[HA]}} \\
  %
\end{align*}
\end{document}

or

\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}
\usepackage{amsmath}

\begin{document}
\begin{align*} 
  \ce{K_a} & = \frac{\ce{[H3O+][A^-]}}{\ce{[HA]}} \\
\end{align*}
\end{document}

(I've used amsmath directly, rather than load it via siunitx, to minimise the example.)

2
  • Using amsmath to "minimise" the example in what sense? – ptrcao Oct 1 '11 at 0:01
  • 1
    @ptrcao The siunitx package is not necessary to see the problem, you only need to ensure that align* is defined. Thus I'm loading the minimum number of packages to show the problem. (Add \listfiles to the original and to my example, and the list of packages will be much shorter for the later.) – Joseph Wright Oct 1 '11 at 6:46

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