In the following example, when I use the word foo
in the \IndexList
command (with some other words, not lonely), I'll get the following error:
! Missing } inserted.
<inserted text>
}
l.7 \section{foo}
The same error will also occur when I use the tabular
environment. (I've not tried any other commands and environments, so maybe the error appears in there, too.)
Here is my code:
\documentclass{article}
\usepackage{xeindex}
\makeindex
\IndexList{mylist}{hello,foo and bar,hi}
\begin{document}
\section{foo}
\newpage
%\begin{tabular}{c}
%foo
%\end{tabular}
\printindex
\end{document}
How can I solve this problem?
Best Answer
The
xeindex
package seems very buggy in this instance.This problem only occurs if “foo” is not followed by text (
\section
,\printindex
,\end{table}
and\\
don't count).Works:
\section{foo and nothing else}
\section{foo and bar}
Breaks:
\section{foo}
… foo \printindex \end{document}
Help:
f{}oo
work everywhere, but are painful and break hyphenation.\StopIndex{<list>}
,\StopSearching
and\StartSearching
. In sections they need to be\protect
ed.\StopSearching foo \StartSearching
or{\StopSearching foo}
The package provides even
\NoIndex
:but that fails. It needs at least a
\protect
but then it's missing a}
again.The following definition does work but does not typeset anything (no surprise there, just randomly adding
\egroup
s can't be the solution.Therefore, I defined a custom command
\PreventIndex{<to not be indexed>}
which works everywhere (?).Code (MWE)
Output