7

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.

5
  • 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
    Commented Jan 16, 2013 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. Commented Jan 16, 2013 at 20:27
  • I've added a MWE.
    – twsh
    Commented Jan 16, 2013 at 20:51
  • 1
    So are you writing the index by hand?
    – egreg
    Commented Jan 16, 2013 at 21:01
  • Yes, I'm afraid so.
    – twsh
    Commented Jan 16, 2013 at 21:32

1 Answer 1

6

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

1
  • That's exactly what I'm looking for. Thank-you.
    – twsh
    Commented Jan 17, 2013 at 23:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .