1

Consider the code

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
%\usepackage{idxlayout}
\usepackage[font=small]{idxlayout}
\usepackage{lipsum}
%\indexsetup{othercode=\large}

\begin{document}
\Large
A sentence.\index{HEADING@\textbf{HEADING}!\textbf{Subheading}!\lipsum[3]}

\idxlayout{columns=1}
\printindex
\end{document}

which produces the Index:

enter image description here

In the above, I have successfully specified the font size of the index to be small. The approach I used will also handle a normalsize font, as well.

Unfortunately, any other font size seems not to be recognized.

In order to accommodate a large font in the index, I have tried using \indexsetup{othercode=\large} at the same time eliminating [font=small]. Although I do not get an error, no change of font size occurs in the index.

QUESTION: How may I specify in the preamble, the font size for the Index for fonts other than normalsize or small. (It seems to me that without any specification, the font size of the index is taken from the font size of the document---but I would like to be able to produce a font size in the index different from that of the document, and not be limited to either a normalsize or small font in the index.) Also---

Does anyone know why the comma and page number in the MWE appear after the lipsum index entry? For future reference, how may I have the comma and page number placed on the ending line of the index entry when using \lipsum?

Thank you.

0

1 Answer 1

2

for normal text the comma is inline but the lipsum macros end with an explicit end of paragraph so the page number and comma are a new paragraph.

For the font, the idxlayout package you are using provides \indexfont so you can use

\renewcommand\indexfont{\Huge}

or whatever you want. The small font key option is just a shorthand for common case, the package has:

\def\ila@fo@small{\renewcommand*{\indexfont}{\small}}

3
  • Many thanks for answering both parts of this question; incidentally, would you know of a simple way to keep the comma and page number on the same line as the entry when using lipsum? or should I, perhaps, pose that as a separate question sometime?
    – DDS
    Commented Jan 1, 2022 at 18:05
  • \lipsum* I think avoids the paragraph, but why do you care it's only dummy text, just write abc xyz unstead. Commented Jan 1, 2022 at 18:35
  • Aesthetics, I guess. Thank you for the suggestion.
    – DDS
    Commented Jan 1, 2022 at 18:36

You must log in to answer this question.

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