TransWikia.com

How to Have idxlayout Not Treat dotfill as Part of the Index Entry?

TeX - LaTeX Asked on February 9, 2021

I am trying to incorporate the effect of dotfill in producing an Index with the idxlayout package.

I have tried this very (basic) approach:

documentclass[12pt]{book}
usepackage{imakeidx}
makeindex
usepackage{idxlayout}

begin{document}
Sentenceindex{Index entry1}
newpage Another Sentenceindex{Index entry2 dotfill}
idxlayout{columns=1}
printindex
end{document}

which prodices the following output for the Index:

enter image description here

I can see why Latex is treating dotfill as part of the entry, as evidenced by the comma appearing at the end of the sequence of dots.

My QUESTION is: How may I have the comma appear after `Index entry2′ followed by the sequence of dots leading to the page number?

I would like to be able to mimic somewhat, the Index from a very old book—but would like to be able to incorporate a comma.

enter image description here

Thank you.

One Answer

The formatting of the index is specified in the index style not via index which just specifies the text to be indexed.

enter image description here

The separator before the page number of a top level index entry is delim_0 which is , by default but you can make it dotfill by having an index file say dotted.ist which just has the line

delim_0 " dotfill "

which you can reference using the imakeidx package you are using via the optional argument of makeindex

documentclass[12pt]{book}
usepackage{imakeidx}
makeindex[options=-s dotted]
usepackage{idxlayout}

begin{document}
Sentenceindex{Index entry1}
newpage Another Sentenceindex{Index entry2}
idxlayout{columns=1}
printindex
end{document}

Answered by David Carlisle on February 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP