9
\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}

gives

(/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*}

What is wrong?

David Carlisle
  • 757,742
ptrcao
  • 6,603
  • 3
    this question was closed as too localized, but it actually helped me – simona Apr 19 '13 at 15:36
  • well there are other maybe more general questions e.g. see "related questions" list in https://tex.stackexchange.com/questions/387380/incomplete-iftrue-all-text-was-ignored-after-line. Looks like this particular one is popular (good SEO optimization) though – user202729 May 19 '22 at 00:39

1 Answers1

9

The first \ce is missing a }, while the second one has one too much. So you should have

\begin{align*}
 \ce{PH} &= -\log  \ce{[H+]} \\
 -\ce{PH} &= \log \ce{[H+]} \\
 10^{-\ce{PH}} &= \ce{[H+]} \\
\end{align*}
David Carlisle
  • 757,742
Caramdir
  • 89,023
  • 26
  • 255
  • 291