Font Size – \indexsetup{othercode=\FONTSIZE} Not Changing Font Size with Idxlayout

fontsizeidxlayoutimakeidxindexingmakeindex

Consider the code

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
\usepackage{idxlayout}
\usepackage{lipsum}

%\usepackage[font=footnotesize]{idxlayout}
\indexsetup{othercode=\footnotesize}
\begin{document}
\Large

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

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

And the index generated by it:

enter image description here

As one can see, the Index fontsize is not footnotesize.

QUESTION: Can anyone point out what I may be doing wrong with this approach? it seems to me that the code as is should work.

Comment: I can get properly working code if I ignore the \indexsetup command and replace \usepackage{idxlayout} by \usepackage[font=footnotesize]{idxlayout}, but I would like to know why the \indexsetup{othercode=\footnotesize} command is not working in the above code?

Thank you.

Best Answer

If I remove idxlayout I get the expected result.

\documentclass{book}
\usepackage{imakeidx}
\usepackage{lipsum}

\makeindex[columns=1]
\indexsetup{othercode=\footnotesize}

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

\printindex

\end{document}

enter image description here

If you really need idxlayout you need the proper syntax:

\documentclass{book}
\usepackage{imakeidx}
\usepackage{idxlayout}
\usepackage{lipsum}

\makeindex
\idxlayout{columns=1,font=footnotesize}

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

\printindex

\end{document}