Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

For reasons of my own (so please don't advise me to simply not do that, I considered that already) I want to have this expression in the title of a section

\section{$\left< a \vphantom{L} \right| \left. b\vphantom{L} \right>$}

but this gives me

! Incomplete \iffalse;

Any idea why that happens? And maybe a workaround?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

The command \vphantom is fragile. You need to protect it:

\section{$\left< a \protect\vphantom{L} \right| \left. b\protect\vphantom{L} \right>$}

However, there's a better way to do it:

\documentclass{article}
\begin{document}

\section{$\left< a \protect\vphantom{L} \right| \left. b\protect\vphantom{L} \right>$}

\section{$\langle a \mid b \rangle$}

\section{$\left< a \;\middle|\; b\right>$}

\end{document}

The first is your code, the second is what I'd prefer, because \left and \right are really doing nothing. The third uses \middle. As you notice, the first has the spacing wrong.

enter image description here

share|improve this answer
    
thanks for the tip with \mid –  fifaltra Jan 24 at 17:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.