# Balancing columns, last page of index (using memoir class)

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!

-

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}
\fi
\indexmark
\ifnoindexintoc\else
\phantomsection
\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.

-
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

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}


-