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.

Can I use multicol to make the index split into two? I tried to use multicol but LaTeX keeps spitting some numbers in square brackets. I had to stop after the numbers count reached 15k.

\documentclass[12pt,a4paper]{book}
\usepackage{xkeyval}
\usepackage{polyglossia}
\usepackage{xcolor}
\usepackage{index}
\usepackage{multicol}

\setmainfont[Script=Devanagari]{Sanskrit 2003}
 \makeindex
\newcommand\alsoindex[1]{\index{#1}#1}
\begin{document}

\begin{multicols}{2}
  \printindex
\end{multicols}

\chapter*{प्रथमाध्यायः}


\index*{धर्मक्षेत्रे कुरुक्षेत्रे} समवेता \index*{युयुत्सव:} । \\
\index*{मामका:} पाण्डावश्चैव \index*{किमकुर्वत सञ्जय }॥ १ ॥
\end{document}
share|improve this question
    
I fail to see how the example in your link is related to your question. –  lockstep Oct 11 '11 at 16:40
    
initially I clubbed both the questions, but then someone told me to make a separate questions. so I did giving the link to minimal example. –  Aku Oct 11 '11 at 16:42
    
But the example does not "spit[...] some numbers". Please provide an example that actually shows the behaviour you describe. –  lockstep Oct 11 '11 at 16:44
    
i edited my question. I just realized after posting this question, would it be easier to split the page into two and use index on that split page rather than using multi-column. –  Aku Oct 11 '11 at 16:53
    
By default, \printindex uses \twocolumn which shouldn't be used inside a multicols environment. I don't have the Devanagiri font, but replacing it with "Latin" letters doesn't result in the behaviour you describe. Also, what does "make the index split into two" mean? –  lockstep Oct 11 '11 at 17:04
show 3 more comments

1 Answer

up vote 5 down vote accepted

By default, \printindex uses \twocolumn which shouldn't be used inside a multicols environment. If you aim at balanced columns, use my idxlayout package. (Since version 0.4b, idxlayout is compatible with the index package.)

\documentclass{book}

\usepackage{index}
\makeindex

\usepackage{idxlayout}

\begin{document}

\chapter*{foo}\index{foo}

\index*{aa} bb \index*{cc}

\index*{dd} ee \index*{ff}

\printindex

\end{document}
share|improve this answer
    
Thanks for your help, would it be possible to include the chapter name between the index item and page number. should I start a new question for it. If you say its possible then I will start a new question. –  Aku Oct 11 '11 at 17:30
    
@Aku: Special formats for index entries should be possible. Please ask a new question and describe exactly how the entries should look like. (Adding the chapter name to every entry is rather unusual.) Also, don't use special fonts if the question isn't related to them. –  lockstep Oct 11 '11 at 17:34
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.