I use the leftidx package to get left subscripts typeset acceptably, however, when I tried to use the \leftidx command within a figure caption (\caption) command I get errors compiling. Here is a MWE:



I want $\leftidx{^i}{c}{_{l,m}^{n}}$ in a caption.



If you comment out the \caption line with \leftidx, and uncomment the line below it you'll see that it compiles fine, including the call to \leftidx that is outside of the caption. The error I get with \leftidx inside of the caption is:

! Incomplete \iffalse; all text was ignored after line 17.
<inserted text> 
<*> MWE.tex

The file ended while I was skipping conditional text.
This kind of error happens when you say `\if...' and forget
the matching `\fi'. I've inserted a `\fi'; this might work.

! Emergency stop.
<*> MWE.tex

*** (job aborted, no legal \end found)

1 Answer 1


You need to insert \protect immediately before \leftidx.

  • Yes, it's a fragile command because it starts with \vphantom.
    – egreg
    Commented Jul 2, 2013 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .