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 

?

David Carlisle
  • 757,742
ptrcao
  • 6,603

1 Answers1

15

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.)

David Carlisle
  • 757,742
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Using amsmath to "minimise" the example in what sense? – ptrcao Oct 01 '11 at 00: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 01 '11 at 06:46