0

I have a document, in which I use the makeidx package for creating and index. What I need to do is make the index 2 column, while my document is 1 column and also put it on the same page as my bibliography.

How to make index without a page breaks before and after I found in this question but there is nothing about how to make it 2 column in 1 column document.

Also I would like to make sure that all the entries in index will be always split in half between left and right column, so it takes up as little space as possible.

\documentclass[a4paper, slovak, twwoside]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[letterpaper, portrait, margin=3cm]{geometry}

% Index
\usepackage{makeidx}
\makeindex

% Redefine theindex enviroment so it won't place index on new page
% This also makes the index 1 columns, which I don't want
\makeatletter
\renewenvironment{theindex}
               {\section*{\indexname}%
                \@mkboth{\MakeUppercase\indexname}%
                        {\MakeUppercase\indexname}%
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \columnseprule \z@
                \columnsep 35\p@
                \let\item\@idxitem}
               {}
\makeatother

\begin{document}
Some one\index{one} column\index{column} block\index{block} of text...

% 2 column index on the same page
\printindex

One column bibliography...
\end{document}

So from this example I would like to get a 2 line, 2 column index on the same page as Some text... and One column bibliography....

Unewen line spacing: enter image description here

3
  • Please share a MWE Dec 6, 2017 at 7:42
  • if by uneven line spacing, you mean that there is a greater distance between entries that start with different letters than between entries that start with the same letter, that's by design. if you want to get rid of it, just \renewcommand{\indexspace}{} Dec 6, 2017 at 17:36
  • Oh yeah you are right. That's exactly what's happening there :D. It looks kinda bad with so few items but I guess it's right. Dec 6, 2017 at 19:12

1 Answer 1

2

Try with the below suggestion:

\documentclass[a4paper, slovak, twwoside]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[letterpaper, portrait, margin=3cm]{geometry}

% Index
\usepackage{multicol,makeidx}
\makeindex

% Redefine theindex enviroment so it won't place index on new page
% This also makes the index 1 columns, which I don't want
\makeatletter
\renewenvironment{theindex}
               {\section*{\indexname}\begin{multicols}{2}%
                \@mkboth{\MakeUppercase\indexname}%
                        {\MakeUppercase\indexname}%
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \columnseprule \z@
                \columnsep 35\p@
                \let\item\@idxitem}
               {\end{multicols}}
\makeatother

\begin{document}
Some one\index{one} column\index{column} block\index{block} of
text...

% 2 column index on the same page
\printindex

One column bibliography...
\end{document}
1
  • Yes this works nicely. The line spacing isn't even for all the items tho. Dec 6, 2017 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.