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've just received (very final, I hope) editing requests from the production people at CUP, and -- at the last minute -- they are asking for the two columns of the final page of the index of my book to be balanced.

It would be nice to be able to do this. The book is written using the memoir class, and the index generated by a simple \printindex command.

I've tried loading idxlayout.sty but -- even placed at the beginning of the preamble -- it gives an error message: Command \indexcolsep already defined.

So ...

  1. Either, is there another way of getting the two columns on the final page of the index to balance?
  2. Or is there a trick to getting idxlayout to play nicely with memoir?

Apologies if I've missed something I shouldn't have: but I have to return the PDF to the publisher rather snappily!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

I suggest to redefine theindex in order to use the multicols environment:

\makeatletter
\usepackage{multicol}
\renewenvironment{theindex}
 {\clearforchapter 
  \ifonecolindex
    \chapter*{\indexname}
    \preindexhook
  \else
    \setlength{\columnseprule}{\indexrule} 
    \setlength{\columnsep}{\indexcolsep} 
    \begin{multicols}{2}[\@makeschapterhead{\indexname}\preindexhook] 
  \fi
  \indexmark
  \ifnoindexintoc\else
    \phantomsection
    \addcontentsline{toc}{chapter}{\indexname}%
  \fi
  \thispagestyle{indextitlepagestyle}\parindent\z@
  \parskip\z@ \@plus .3\p@\relax
  \let\item\@idxitem} 
 {\ifonecolindex\else\end{multicols}\fi}
\makeatother

This assuming that your book is not in twocolumn format.

share|improve this answer
    
This works to balance the index, thanks. But (oddly?) where {\small\printindex} got the index printed at a smaller size, this no longer works. (And font size is more critical than balanced columns here!) –  Peter Smith Jan 18 '13 at 15:31
    
@PeterSmith Maybe it's better to add \small just at the end of the first part of the definition: \let\item\@idxitem\small –  egreg Jan 18 '13 at 15:35
    
This does this trick nicely. Thanks so very much! [If others want to use this, you might find that you have to tinker with the settings of the pre-index text called by \preindexhook to get it to set as raw memoir did.] –  Peter Smith Jan 18 '13 at 16:00
    
@PeterSmith That's also an option; but since you're redefining theindex anyway ... –  egreg Jan 18 '13 at 16:02
add comment

You could use lockstep's idxlayout package (which is compatible with memoir). It balances the index columns by default, and also features a font option. Allowed values are normalsize, small, footnotesize, and current (the font in effect at the time of \printindex).

EDIT BY LOCKSTEP: The following example works for me:

\documentclass{memoir}

\makeindex

\usepackage{idxlayout}

\begin{document}

Some text.\index{Alpha}\index{Bravo}\index{Charlie}\index{Delta}

\printindex

\end{document}

enter image description here

share|improve this answer
add comment

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.