3

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?

1
  • 2
    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
3

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.

2
  • So it's missing a \RequirePackage? – Mohan Sep 14 '12 at 21:16
  • 1
    @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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.