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.

I attempted to use makeidx.sty in my beamer project.

The first two compilation using latex, the input file can be processed successfully.

Then I execute makeindex, it also run without error.

But when I call latex.exe again, I got an error message saying


!LaTeX Error: Environment theindex undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
1.1 \begin{\theindex}

\documentclass{beamer}
\usepackage{makeidx}
\makeindex

\begin{document}

\begin{frame}{test 1}
\index{Laplace}Laplace transform is...
\LaTeXe\ can make you happy!
\end{frame}

\begin{frame}{test 2}
\printindex
\end{frame}

\end{document}
share|improve this question
3  
Where is the sense of an index in a presentation? Apart from this the error message clearly says there is no theindex environment defined. Thus I'd consider this as a feature. –  Thorsten Donig Dec 9 '10 at 10:00
1  
@Thorsten, thank you for answering. I am writing a math book that will be shipped with a pdf presentation. Indexing is needed because the presentation may contain more than 500 frames. :-) –  xport Dec 9 '10 at 10:12
3  
the context is useful in this sort of situation. Where you're trying to do something that might not normally be done, it's helpful to explain (briefly) why. –  Loop Space Dec 9 '10 at 12:50

1 Answer 1

up vote 5 down vote accepted

You will have to define theindex and the commands used in the theindex-environment. Look e.g. in article.cls for ideas (you shouldn't copy it verbatim, for presentations you need a different look).

\documentclass{beamer}
\usepackage{makeidx}
\makeindex
\newenvironment{theindex}
 {\let\item\par
  %definitions for subitem etc
  }{}
\newcommand\indexspace{}
\begin{document}

\begin{frame}{test 1}
\index{Laplace}Laplace transform is... \LaTeXe\ can make you happy!
\index{Test}
\end{frame}

\begin{frame}{test 2}
\printindex
\end{frame}

\end{document}
share|improve this answer
    
@Ulrike, thank you for the solution. It works. :-) –  xport Dec 9 '10 at 11:07
    
Dear Ulrike (or xport, or someone else), could you please write a slightly more detailed example of how to use printindex in a beamer presentation? I have the same problem as xport, but Ulrike's example did not work in my case. Thanks, Hendrik –  Hendrik Jan 3 '11 at 17:04
    
@Hendrik: Welcome :-) If you've got a question, then you should ask it in a new post. Please do this with the "Ask Question" link. You should link to the question here in your new question. –  Hendrik Vogt Jan 3 '11 at 17:43

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.