Indexing – Resolving Disappearing Index Entries with Idxlayout

idxlayoutimakeidxindexinglarge filesmakeindex

In the past, I have put together some rather large index entries in terms of content without encountering any problems.

However, I have discovered that when I add some color, there seems to be a limitation to the capacity of the entry.

Consider the MWE

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

\begin{document}
\Large
A sentence.\index{I WOULD LIKE TO EXPAND THIS@{\textbf{I WOULD LIKE TO EXPAND THIS}}! But It Entirely Disappears@\textbf{But It Entirely Disappears}! {\textit{Some quotes of Will Rogers: I don't make jokes. I just watch the government and report the facts. All I know is just what I read in the papers, and that's an alibi for my ignorance. The only difference between death and taxes is that death doesn't get worse every time Congress meets. We will never have true civilization until we have learned to recognize the rights of others.''} \textbf{\color{red}{\textit{Things ain't what they used to be and never were.}}} Some more of the same: \textit{People who fly into a rage always make a bad landing. Too many people spend money they haven't earned to buy things they don't want to impress people they don't like. Don't gamble; take all your savings and buy some good stock and hold it till it goes up, then sell it. If it don't go up, don't buy it. \textbf{\color{red}{\textit{The best way out of a difficulty is through it.}}} }}} 
%\textbf{\color{blue}{\textit{Some Quotes of Will Rogers}}}

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

which produces the index

enter image description here

However, when I want to add, say, \textbf{\color{blue}{\textit{Some Quotes of Will Rogers}}} to the entry:

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

\begin{document}
\Large
A sentence.\index{I WOULD LIKE TO EXPAND THIS@{\textbf{I WOULD LIKE TO EXPAND THIS}}! But It Entirely Disappears@\textbf{But It Entirely Disappears}! {\textit{Some quotes of Will Rogers: I don't make jokes. I just watch the government and report the facts. All I know is just what I read in the papers, and that's an alibi for my ignorance. The only difference between death and taxes is that death doesn't get worse every time Congress meets. We will never have true civilization until we have learned to recognize the rights of others.''} \textbf{\color{red}{\textit{Things ain't what they used to be and never were.}}} Some more of the same: \textit{People who fly into a rage always make a bad landing. Too many people spend money they haven't earned to buy things they don't want to impress people they don't like. Don't gamble; take all your savings and buy some good stock and hold it till it goes up, then sell it. If it don't go up, don't buy it. \textbf{\color{red}{\textit{The best way out of a difficulty is through it.}}} \textbf{\color{blue}{\textit{Some Quotes of Will Rogers}}}}}} 
%\textbf{\color{blue}{\textit{Some Quotes of Will Rogers}}}

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

the entire index disappears, giving just the first page:

enter image description here

In fact, in this particular case, if instead of doing what I just described, I merely alter the heading from "I WOULD LIKE TO EXPAND THIS" to "I WOULD LIKE TO EXPAND THIS ENTRY", the whole index disappears as well.

Remark: If the index had contained more than one entry, the index should remain visible, save for the long one which would disappear.

QUESTION: Does anyone know why the entire Index here disappears when the content seemingly reaches a certain point? Is there a way to override this limitation; for in my actual document, I am occasionally using color within indices, and I am frequently encountering the described problem when the entry is long and contains color?

Thank you.

Best Answer

I put the example on Overleaf at

https://www.overleaf.com/read/gnzhpncbswqp

which makes it easy to try various texlive releases (back to 2014) your index fails in 2018 or older and works in texlive 2019 and later


In texlive 2018 if you look at the makeindex log (ilg) you see

This is makeindex, version 2.15 [TeX Live 2018] (kpathsea + Thai support).
Scanning input file output.idx...
!! Input index error (file = output.idx, line = 1):
   -- First argument too long (max 1024).
done (0 entries accepted, 1 rejected).
Nothing written in output.ind.
Transcript written in output.ilg.

presumably newer makeindex have been compiled with a larger input buffer.

Related Question