使用 LaTeX 中的 imakeidx 进行作者索引

使用 LaTeX 中的 imakeidx 进行作者索引

我根本不是 LaTeX 专家;几个月前我第一次使用它来修改已经存在的脚本来编写会议论文集。

我正在尝试使用个性化的作者和附属机构索引来完善今年版会议记录的最终方面。

我使用imakeidxLaTeX 软件包,我想知道是否可以:1)用冒号替换索引条目与索引中第一个页码之间的默认逗号;例如,我希望

爱因斯坦阿尔伯特:1、2、3

而不是预定义的

爱因斯坦·阿尔伯特,1,2,3

2)控制索引中第一行之后的行的缩进;使用预定义的设置,我得到了类似的结果

Einstein Albert, 1, 2, 3, 4, 5,
       6, 7, 8

有什么提示吗?

答案1

为了获取冒号,您需要定义一个新的 MakeIndex 样式;这非常简单:只需31083.ist在与主文档相同的文件夹中准备以下文件,其中包含一行

delim_0 ": "

因为delim_0是索引条目和首页号(如果有)之间插入的标记的容器。然后您必须指示imakeidx使用新定义的样式。

为了控制以下行的缩进,您必须修改 ; 的定义\@idxitem,例如

\makeatletter
\renewcommand{\@idxitem}{\par\hangindent=20pt }
\makeatother

将使用 20pt,而不是默认的 40pt。

完整例子。

\documentclass{book}
\usepackage{imakeidx}
\makeindex[name=people,title=Index of People,options=-s 31083.ist -r]

\makeatletter
\renewcommand{\@idxitem}{\par\hangindent=20pt }
\makeatother

\begin{document}
\mainmatter
\chapter{Relativity}

Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\newpage
Einstein\index[people]{Einstein, Albert}
Zorro\index[people]{Zorro}

\printindex[people]

\end{document}

我还使用了禁用隐式范围形成的选项-r,否则示例将显示“1-8”,因此不会转到第二行。您可能希望将其删除。

在此处输入图片描述

相关内容