![“!不完整的 \ifx”错误是什么意思?](https://linux22.com/image/241045/%E2%80%9C%EF%BC%81%E4%B8%8D%E5%AE%8C%E6%95%B4%E7%9A%84%20%5Cifx%E2%80%9D%E9%94%99%E8%AF%AF%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F%20.png)
\documentclass[12pt,a4paper]{article}
\usepackage[version=3]{mhchem}
\usepackage{siunitx}
\begin{document}
\begin{align*}
\ce{PH &= -\log \ce{[H+]}} \\
-\ce{PH} &= \log \ce{[H+]} \\
10^{-\ce{PH}} &= \ce{[H+]} \\
\end{align*}
\end{document}
给出
(/home/peter/texlive/2011/texmf-dist/tex/latex/siunitx/config/siunitx-abbreviat
ions.cfg)
(/home/peter/texlive/2011/texmf-dist/tex/latex/siunitx/config/siunitx-binary.cf
g)
! Incomplete \ifx; all text was ignored after line 11.
<inserted text>
\fi
l.11 \end{align*}
怎么了?
答案1
第一个\ce
缺少}
,而第二个多了一个。因此您应该
\begin{align*}
\ce{PH} &= -\log \ce{[H+]} \\
-\ce{PH} &= \log \ce{[H+]} \\
10^{-\ce{PH}} &= \ce{[H+]} \\
\end{align*}