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.

I'm typesetting the index for a book. When an entry covers more than one line I would like the lines after the first to be indented some small amount. Is there a simple way to do it by playing with the way paragraphs are indented?

Here's a MWE:

\documentclass[a4paper,10pt]{book}

\usepackage[top=53mm, bottom=45mm, left=40mm, right=40mm]{geometry}

\begin{document}

\noindent arithmetic [VOL I] V, VII-VIII, IX, XIII, 1, 3-4, 39 fn.\,1, [VOL II] 70 fn.\,1, 73, 77-78, 83-84, 86-88, 95, 97-104, 109, 117,  119, 123-125, 139, 139 fn.\,2, 141-142, 146-147, 149, 151-152, 154, 155 fn.\,1, 156-157, 162, 168, 253, 255, 257, 265.\\

\end{document}

I'd like to indent at 83-84 and 151-152. The point is I would like it to happen automatically for a long index rather than add space by hand.

share|improve this question
3  
You should create a minimal working example (MWE) that community members can play with. This should start with \documentclass and end in \end{document}. It just makes it easier to tailor any solutions to your needs. –  Werner Jan 16 '13 at 18:21
2  
The standard classes are indenting the lines after the first line with 40pt. Check the documentation of your class or packages that are responsible for the look of the index. –  Heiko Oberdiek Jan 16 '13 at 20:27
    
I've added a MWE. –  Tom Jan 16 '13 at 20:51
1  
So are you writing the index by hand? –  egreg Jan 16 '13 at 21:01
    
Yes, I'm afraid so. –  Tom Jan 16 '13 at 21:32
add comment

1 Answer

up vote 2 down vote accepted

You may use my idxlayout package to change the hanging indentation of \items in a manually created theindex environment. Note that for a one-column index you have to add \par at the end of the last \item for the settings to take effect. In the following example, I've also added code to remove the "Index" chapter heading and header.

\documentclass[a4paper,10pt]{book}

\usepackage[top=53mm, bottom=45mm, left=40mm, right=40mm]{geometry}

\usepackage[columns=1,hangindent=2em]{idxlayout}

\usepackage{etoolbox}

\makeatletter
\patchcmd{\ila@prologue}{\chapter*{\indexname}}{}{}{}
\patchcmd{\ila@prologue}{\@mkboth}{\@gobbletwo}{}{}
\makeatother

\begin{document}

\begin{theindex}
\item arithmetic [VOL I] V, VII-VIII, IX, XIII, 1, 3-4, 39 fn.\,1, [VOL II] 70 fn.\,1, 73, 77-78, 83-84, 86-88, 95, 97-104, 109, 117,  119, 123-125, 139, 139 fn.\,2, 141-142, 146-147, 149, 151-152, 154, 155 fn.\,1, 156-157, 162, 168, 253, 255, 257, 265.\par
\end{theindex}

\end{document}

enter image description here

share|improve this answer
    
That's exactly what I'm looking for. Thank-you. –  Tom Jan 17 '13 at 23:22
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.