TeX - LaTeX Asked on March 27, 2021
I have a big book with a lot of index entries. I’m getting some overprinting in the index, like this:
I’ve created a MWE:
documentclass[12pt]{article}
usepackage{makeidx}
makeindex
begin{document}
This is the first page.
index{European Organization for Nuclear Research (CERN)}
index{fable book}
index{fable forger}
index{fable-framing}
index{fable play}
index{fable teller}
index{fabrication tax}
index{fabric spring}
index{fabric tire}
index{face-about}
index{face-ache}
index{face ague}
index{face angle}
index{face-arbor}
index{face bath}
index{face-bedded}
index{face bone}
index{face brick}
index{face card}
index{face-centered}
index{face chuck}
index{face cleat}
index{face cog}
index{face cord}
index{face cover}
index{face cream}
index{faced-lined}
index{face dresser}
index{face dressing}
index{face enamel}
index{face gear}
index{face guard}
index{face hammer}
index{face-harden}
index{face joint}
index{face lathe}
index{face lifting}
index{face mask}
index{face massage}
index{face milling}
index{face mite}
index{face mold}
index{face molder}
index{face-off}
index{face-on}
index{face paint}
index{face painter}
index{face painting}
index{face par}
index{face pit}
index{faceplate coupling}
index{faceplate jaw}
index{face powder}
index{face presentation}
index{face rouge}
index{face-saving}
index{face side}
index{face spanner}
index{face specialist}
index{face sponge}
index{face stone}
index{face string}
index{face towel}
index{face urn}
index{face value}
fontsize{9}{10}selectfont
printindex
end{document}
Without the 12pt
, the index looks like this:
With the 12pt
, it looks like this:
I’m compiling this with:
$ latexmk -pdfxe -bibtex idemo.tex ; open idemo.pdf
(I get the same results with -pdf
instead of pdfxe
)
I'd use imakeidx
, which internally uses multicol
instead of the standard two-column format. It also doesn't require a separate run of makeindex
.
documentclass[12pt]{article}
usepackage{imakeidx}
makeindex
indexsetup{othercode=fontsize{9}{10}selectfont}
begin{document}
This is the first page.
index{European Organization for Nuclear Research (CERN)}
index{fable book}
[...other index entries omitted...]
printindex
end{document}
You can also consider three column format:
documentclass[12pt]{article}
usepackage{imakeidx}
makeindex[columns=3]
indexsetup{othercode=fontsize{9}{10}selectfont}
begin{document}
[...the rest is the same...]
Correct answer by egreg on March 27, 2021
It's not really related to indexing or the document class option, just that some sequences of words are hard to break at some line widths.
Using either
fontsize{9}{10}selectfontraggedright
or
fontsize{9}{10}selectfontsloppy
allows it to break without being over full and sticking in to the next column, the effects are diffeent though you could choose which you prefer.
Answered by David Carlisle on March 27, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP