![对齐环境中的错误-失控参数?](https://linux22.com/image/241034/%E5%AF%B9%E9%BD%90%E7%8E%AF%E5%A2%83%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF-%E5%A4%B1%E6%8E%A7%E5%8F%82%E6%95%B0%EF%BC%9F.png)
可能重复:
对齐环境中的空行
\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
,以最小化示例。)