# indexing fails in svmono

Buildign the code below (pdflatex, makeindex, pdflatex) causes an error

! LaTeX Error: Environment multicols undefined.


Code:

\documentclass{svmono}
\usepackage{makeidx}
\makeindex
\begin{document}

\frontmatter
\mainmatter
\index{foo}Text

\backmatter
\printindex

\end{document}


I can of course make the error go away using \usepackage{multicol} (and shall note this in an answer below), but I'd like to understand what's happening: has svmono simply failed to declare a dependency?

-
If you change to \usepackage{imakeidx} the index will be built automatically (and multicol loaded). But in case you're submitting the paper, this may be a problem, if the publisher has an old TeX distribution. – egreg Sep 14 '12 at 21:31

svmono.cls contains the lines

\if@threecolind
\begin{multicols}{3}[\chapter*{\indexname}%
\else
\begin{multicols}{2}[\chapter*{\indexname}%
\fi


in the "begin" part of the definition of the index environment. As you can see, the index will be built using the multicols environment and this requires the multicol package.

The documentation for svmono mentions that both the makeidx and multicol packages are required to build an index, so you need to load both packages.

-
So it's missing a \RequirePackage? – Mohan Sep 14 '12 at 21:16
@Mohan I don't think it's missing (see the final remark in my updated answer). In the same way that the class doesn't internally loads makeidx, and leave it to the user, it also doesn't load multicol and the user has to do it. – Gonzalo Medina Sep 14 '12 at 21:19