Document Classes ⇒ makeindex making indexes in more than two columns?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
makeindex making indexes in more than two columns?
In the meantime the new package idxlayout has been released. It simplifies the format setup of the index.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
NEW: TikZ book now 40% off at Amazon.com for a short time.
makeindex making indexes in more than two columns?
I too made an account so I could respond to this post and hopefully help out the next chap that comes along.
I altered the code slightly for my use.
I wanted the Index to show up in my table of contents using the article document type.
Using \section*{} prevents the table of contents from showing the listing and \section{} produces an unwanted preceding number in the table of contents.
To show the index without a number in the table of contents and produce a bookmark in the correct location I altered the \begin{multicols} line of code to include phantomsection and addcontentsline.
Altered code:
Thanks for the help and I hope this is useful to someone.
I altered the code slightly for my use.
I wanted the Index to show up in my table of contents using the article document type.
Using \section*{} prevents the table of contents from showing the listing and \section{} produces an unwanted preceding number in the table of contents.
To show the index without a number in the table of contents and produce a bookmark in the correct location I altered the \begin{multicols} line of code to include phantomsection and addcontentsline.
Altered code:
Code: Select all
\usepackage{multicol}
\makeatletter
\renewenvironment{theindex}
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\newpage
\setlength{\columnseprule}{0pt}
\setlength{\columnsep}{35pt}
\begin{multicols}{3}[\phantomsection\addcontentsline{toc}{section}{\indexname}\section*{\indexname}]
\markboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
% \thispagestyle{plain} % I don't want the first page of the index to be plain
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.3pt}
\relax
\let\item\@idxitem}%
{\end{multicols}\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother