I would like to provide the chapter title and the verse number for each entry in the index. This is unusual but the book I am working on requires such formatting.
In the output I want the chapter title to appear between the indexed text and the verse number. For verses I am using the verse
environment but do not show here.
In the output shown below, the first line is the header, repeated on each page of the index. Then, based on the three example verses, the desired output:
Indexed text, Chapter Name, Verse Number.
Fairest… First… 1
decease… Second… 1
thine… Third… 4
I would like to suppress page numbers in the index.
\documentclass[12pt,a4paper]{book}
\usepackage{index}
\usepackage{idxlayout}
\makeindex
\begin{document}
\printindex
\chapter*{First}
From \index*{fairest} creatures we desire increase,
That thereby beauty's rose might never die ... |1|
\chapter*{Second}
But as the riper should by time \index*{decease},
His tender heir might bear his memory ... |1|
\chapter*{Third}
But thou contracted to \index*{thine} own bright eyes,
Feed'st thy light's flame with self-substantial fuel ... |4|
\end{document}
Best Answer
Maybe:
Note, that you have to replace call of
makeindex
bysplitindex
. So you shouldlatex foo.tex
splitindex foo
latex foo.tex
to get the result with
Index of Verse
. With TeX Livesplitindex
is a link tosplitindex.pl
. If you are using Windows and MiKTeX you may either install Perl or usesplitindex.exe
.If running
splitindex
is a problem for you, you may try optionsplit
loading packagesplitidx
:In this case you have to run makeindex with file
<foo>-vers.idx
:latex foo.tex
makeindex foo-vers
latex foo.tex
Please replace
foo
by the base name of your test file. See manual of splitindex for more information about running the several variants of the programmsplitindex
and the options and macros of packagesplitidx
.Instead of using a second argument at definition of
\vindex
, you may set the verse numbers by setting counter verse e.g. using an environment or command to set the verses.