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.

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?

share|improve this question
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

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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

 
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.