2

Trying to apply https://tex.stackexchange.com/a/482980/18401, I stumbled upon a strange error. Indeed, while the following MCE compile like a charm:

\documentclass{beamer}

\newenvironment{theindex}{}{}
\usepackage{imakeidx}

\makeatletter
\def\@idxitem{\par}
\def\imki@firstpagestyle{empty}
\makeatother

\makeindex

\begin{document}

\begin{frame}
index1\index{index1}
index2\index{index2}
\end{frame}

\begin{frame}
index1\index{index1}
% foo\index{foo}
\end{frame}

\begin{frame}
\printindex
\end{frame}

\end{document}

But, as soon as the foo\index{foo} line (quite similar to the above one index2\index{index2}) is uncommented, the compilation fails:

! Undefined control sequence.

l.5 \indexspace

Do you understand what's going on?

1
  • 2
    well your new entry starts with a different letter, and \indexspace is used between letter blocks. Give it a definition (see my answer in the question you linked too). Commented 21 hours ago

1 Answer 1

4

This is user error your definition of theindex environment is too minimal,

article.cls has

\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}

this is the space inserted in the index at a change of letter, which is why you get an error on the second entry,

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.