4

My MWE is far too long but this is one of my many attempts, none of which worked.

\documentclass{memoir} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% try for 3 column index \newif\ifthreecolindex \newcommand{\threecolindex}{\threecolindextrue} \usepackage{multicol} \makeatletter \renewenvironment{theindex}{% \clearforchapter \ifthreecolindex \begin{multicols}{3} % starting multocols 3 % % threecolindex \else \ifonecolindex \onecolumn onecolindex \else \setlength{\columnseprule}{indexrule}% \setlength{columnsep}{\indexcolsep} \twocolumn{\@makeschapterhead{\indexname} \preindexhook}% 

.........

\threecolindex \printindex \end{document} 

I have thought it best to change my GOM (Grumpy Old Man) signature to GSIOM (Grumpy Semi Incompetent Old Man).

Any help will be much appreciated and who knows, the memoir maintainer (daleif) might even add it to the memoir class, but don't hold your breath.

GSIOM

2
  • your example seems to be missing parts. Commented Jul 16, 2021 at 19:39
  • As Ulrike mentions please make a full example, it is a lot easier to work with Commented Jul 16, 2021 at 20:00

1 Answer 1

3

Unless I'm missing something, this seems to work just fine

\documentclass{memoir} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% try for 3 column index \newif\ifthreecolindex \newcommand{\threecolindex}{\threecolindextrue} \usepackage{multicol} \makeatletter \renewenvironment{theindex}{% \clearforchapter \ifthreecolindex \chapter*{\indexname} \preindexhook \else \if@twocolumn \@restonecolfalse \else \@restonecoltrue \fi \ifonecolindex \onecolumn \chapter*{\indexname} \preindexhook \else \setlength{\columnseprule}{\indexrule}% \setlength{\columnsep}{\indexcolsep}% \twocolumn[\@makeschapterhead{\indexname} \preindexhook]% \fi \fi \indexmark \ifnoindexintoc\else \phantomsection \addcontentsline{toc}{chapter}{\indexname}% \fi \ifthreecolindex \begin{multicols}{3} \fi \thispagestyle{indextitlepagestyle}\parindent\z@ \parskip\z@ \@plus .3\p@\relax \let\item\@idxitem}% { \ifthreecolindex \end{multicols} \else \if@restonecol\onecolumn\else\twocolumn\fi \fi } \makeatother \makeindex \begin{document} test\index{A}\index{B}\index{C} \threecolindex \printindex \end{document} 
3
  • Yes, this worked fine but somehow I screwed up the prologue of the document I wanted to use it in. Any thoughts of adding it to memoir or as a stand-alone package? Commented Jul 18, 2021 at 17:38
  • @PeterWilson, not really. If there had been a need for it, people would have asked for it. I don't think I've ever seen a document with a three col index, you'll run out of space too fast Commented Jul 18, 2021 at 17:45
  • 1
    In my particular document the index entries are very short, one or two words and a page number. If I use a one-column document the regular index takes 49 pages. Using a two-column index it takes 25 pages but a three column index only takes 17 pages --- a significant reduction on the other formats. I certainly need a three-column index, perhaps others as well but they haven't realised it or haven't asked. Anyway, it is obviously up to you. Commented Jul 19, 2021 at 17:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.