2

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.

10
  • it would be much better it instead of a working MWE you would present a failing one. If I copy your second snippet into the example it works fine for me on texlive 2021. Nov 26, 2021 at 16:59
  • @Ulrike Fischer I use TexStudio and a version of Latex not as current as yours. Do you think one of those things might be the problem? Because, when I replace the contents of the MWE code after the preamble with the latter, I get only one page of output; namely, the first page only.
    – DDS
    Nov 26, 2021 at 17:07
  • texstudio is never related to a tex error it's just the editor you used to write the source file. As Ulrike says provide an example of the problem that we can run without having to guess how to paste together the fragments. Nov 26, 2021 at 17:09
  • @David Carlisle O.K. I should have it posted in several minutes.
    – DDS
    Nov 26, 2021 at 17:10
  • the entry ending in Blue works with no error. What does the makindex log (.ilg) report for you? Nov 26, 2021 at 17:17

2 Answers 2

4

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.

9
  • Thank you. But when I "recompile" it, I still get the same 1-page output without the index?
    – DDS
    Nov 26, 2021 at 17:25
  • check in the left hand menu, you probably tried it while it was set to texlive 2018 so I got the error log I pasted above. If you try 2019,2020 or 2021 it works. @mlchristians Nov 26, 2021 at 17:27
  • Thank you; but unfortunately, the menu does not give me any of those options. Besides, even if it did, would I be able to run a document which contains thousands of lines in the same manner as the MWE?
    – DDS
    Nov 26, 2021 at 17:32
  • It sounds like the menu drop down on Overleaf is different on my end than on yours.
    – DDS
    Nov 26, 2021 at 17:34
  • @mlchristians oh probably because I only gave read access to the project you probably don't have that menu, but really Overleaf is just a side issue, I just used it as a convenient way to use an old texlive. You can do pretty big documents on overleaf but they do have a timeout for the free version you can always try...) Nov 26, 2021 at 17:34
0

I have had a similar problem, using TexLive2022. It was solved when I decided to load ìdxlayout before ìmakeidx.

You must log in to answer this question.

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