TeX - LaTeX Asked on May 29, 2021
As the title suggests, given an index, say
produced by the code
documentclass[12pt]{book}
usepackage{imakeidx}
makeindex
usepackage{idxlayout}
begin{document}
newpage Another sentenceindex{Heading@!Entry-1}
newpage Another sentenceindex{Heading@!Entry-2}
newpage Another sentenceindex{Heading@!Entry-3}
idxlayout{columns=1}
printindex
end{document}
I would like to able to display the page numbers in bold? Can this be done collectively? Can this be done selectively? If so, can someone indicate how to do this? I found no posts which anser this question.
Thank you.
From the makeindex
documentation (section 2.2 The Basics, p 5):
In some indexes, certain page numbers are specially formatted - for example, an italic page number may indicate the primary reference, and an
n
after a page number may denote that the item appears in a footnote on that page. MakeIndex makes it easy to format an individual page number any way you want. For any string of charactersσ
, the commandindex{...|σ}
produces a page number of the formσ{n}
. Similarly, the commandindex{...|(σ}
may produce a page number of the formσ{n–m}
.
So, to make an individual entry's page number appear bold, use index{Heading@!Entry-1|textbf}
. To make all page numbers appear bold, you could do this:
documentclass{article}
usepackage{imakeidx}
makeindex
usepackage{idxlayout}
% Make all page numbers in index bold
letoldindexindex
renewcommand{index}[1]{%
oldindex{#1|textbf}%
}%
begin{document}
newpage Another sentenceindex{Heading@!Entry-1}
newpage Another sentenceindex{Heading@!Entry-2}
newpage Another sentenceindex{Heading@!Entry-3}
idxlayout{columns=1}
printindex
end{document}
Correct answer by Werner on May 29, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP