可能重复:
对齐环境中的空行
\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}
给出
Runaway argument?
\ce {K_a} & = \frac {\ce {[H3O+][A^-]}}{\ce {[HA]}} \\
! Paragraph ended before \align* was complete.
<to be read again>
\par
l.8
?
答案1
align*
在(或align
) 环境中,或者在显示数学中,你不能有空行。因此你想要
\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}
或者
\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}
(我直接使用amsmath
,而不是加载它通过 siunitx
,以最小化示例。)