When I define multiple terms that contain an underscore and begin with the same string ex_ 1, ex_ 2 (as shown in the example below) I get the following error:
! TeX capacity exceeded, sorry [input stack size=5000]. \expandafter l.30 \end{frame}
However, when I define the term e2 using the commented out line below (e2_ 2) it compiles fine. If I just remove the escaped underscores (see below) that works as well. Can someone tell me how to work around this?
\documentclass[16pt,pdftex]{beamer}
\usepackage[T1]{fontenc}
\makeatletter
% beamer doesn't define \@idxitem, but it's used by the
% \printterms "index" style, so define it:
\newcommand\@idxitem{\par\hangindent40pt}
\makeatother
\usepackage{datagidx}
\newgidx{index}{Index}
\DTLgidxSetDefaultDB{index}
% this fails:
\newterm[label=e1]{ex\_ 1}
\newterm[label=e2]{ex\_ 2}
% this works
%\newterm[label=e1]{ex\_ 1}
%\newterm[label=e2]{e2\_ 2}
% this works
%\newterm[label=e1]{ex 1}
%\newterm[label=e2]{ex 2}
\begin{document}
\begin{frame}
\frametitle{example}
\gls{e1}
\gls{e2}
\end{frame}
\begin{frame}[allowframebreaks]
\frametitle{Index}
\printterms[style=index]
\end{frame}
\end{document}
\newterm[label=e1,sort={ex1}]{ex\_ 1}
– Nicola Talbot Nov 11 '13 at 19:36