带有 Idxlayout 的消失索引条目

带有 Idxlayout 的消失索引条目

过去,我曾整理过一些内容相当大的索引条目,而没有遇到任何问题。

但是,我发现当我添加一些颜色时,条目的容量似乎受到限制。

考虑 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}

生成索引

在此处输入图片描述

但是,当我想添加\textbf{\color{blue}{\textit{Some Quotes of Will Rogers}}}条目时:

\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}

整个索引消失,仅显示第一页:

在此处输入图片描述

事实上,在这种特殊情况下,如果我不按照我刚才描述的方式做,而只是将标题从“我想扩展这个”改为“我想扩展这个条目”,那么整个索引也会消失。

评论:如果索引包含多个条目,则索引应该保持可见,但较长的索引将会消失。

问题:有人知道为什么当内容似乎达到某个点时,这里的整个索引都会消失吗?有没有办法克服这个限制;因为在我的实际文档中,我偶尔会在索引中使用颜色,而当条目很长且包含颜色时,我经常遇到所描述的问题?

谢谢。

答案1

我把例子放在 Overleaf 上

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

这使得尝试各种 texlive 版本(可追溯到 2014 年)变得容易,您的索引在 2018 年或更早的版本中失败,但在 texlive 2019 年及更高版本中有效


在 texlive 2018 中,如果你查看 makeindex 日志(ilg),你会看到

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.

大概新的 makeindex 已经用更大的输入缓冲区进行了编译。

答案2

我使用 TexLive2022 时也遇到过类似的问题。当我决定ìdxlayout在之前加载时,问题就解决了ìmakeidx

相关内容