如何在不同的索引条目下自动索引首字母缩略词?

如何在不同的索引条目下自动索引首字母缩略词?

我想使用亚里士多德作品的缩写(例如 NE 或 EE),但作者(亚里士多德)可能没有具体指明或引用,每次我使用首字母缩略词时,该作者应该自动出现在人物索引中(如果在 biblatex 中使用 indexing=cite 选项,则类似于引用)。因此,亚里士多德作品的个别首字母缩略词应该出现在索引条目“亚里士多德”下,但其他首字母缩略词不应出现在索引中。

所以这里有一个 MWE,也许有人有个想法——那就太好了!

\documentclass[12pt,a4paper]{scrreport}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[natbib=true,backend=biber,style=authoryear]{biblatex}
\usepackage{hyperref}
\usepackage{acronym}
\usepackage{csquotes}

\usepackage{imakeidx}
\usepackage{etoolbox}
\makeindex[columns=2,title=Titelregister]
\makeindex[columns=2,name=personenregister,title=Index of Persons]
\makeindex[columns=2,name=sachregister,title=Index of Subjects]
\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\index[personenregister]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}

\begin{document}

\chapter*{Scribal Abbreviations}
\begin{acronym}[SIP]
 \acro{SIP}{\textit{Super Important Problem}} 
  \acro{EE}{\textit{Eudemian Ethics}}. 
  \acro{NE}{\textit{Nicomachean Ethics}}. 
\end{acronym}

\newpage

Aristoteles\index[personenregister]{Aristotle} was a student of Plato\index[personenregister]{Plato}

\newpage

In the Eudemian Ethics, there is written: \frqq this and that\flqq\ (\acs{EE}, II.1 1219a19-28).
%should appear in the index of persons under the entry Aristotle

\newpage

I call this problem the \textit{Super Important Problem} (\acs{SIP})
%should not appear in the index of persons

\newpage 

In the Nicomachean Ethics, there is written: \frqq that and this\flqq\ (\acs{NE}, I.9, 1099b32-1100a1).
%should appear in the index of persons under the entry Aristotle

\printindex[personenregister]

\end{document} 

答案1

acro使用而不是 并不太难acronym(如果你不介意切换包的话):

\documentclass[12pt,a4paper]{scrreport}
\usepackage[T1]{fontenc}

\usepackage{acro}
\usepackage{csquotes}

\usepackage{imakeidx}
\makeindex[columns=2,name=personenregister,title=Index of Persons]

\acsetup{
  use-id-as-short ,
  format/long = \itshape ,
  index/use = true ,
  index/cmd = \index[personenregister]
}

\DeclareAcronym{SIP}{long=Super Important Problem,no-index}
\DeclareAcronym{EE}{long=Eudemian Ethics,index=Aristotle} 
\DeclareAcronym{NE}{long=Nicomachean Ethics,index=Aristotle}


\begin{document}

\chapter*{Scribal Abbreviations}
\printacronyms[heading = none]

\newpage

Aristoteles\index[personenregister]{Aristotle} was a student of Plato\index[personenregister]{Plato}

\newpage

In the Eudemian Ethics, there is written: >>this and that<< (\acs{EE}, II.1 1219a19-28).
%should appear in the index of persons under the entry Aristotle

\newpage

I call this problem the \ac{SIP}
%should not appear in the index of persons

\newpage 

In the Nicomachean Ethics, there is written: >>that and this<< (\acs{NE}, I.9, 1099b32-1100a1).
%should appear in the index of persons under the entry Aristotle

\printindex[personenregister]

\end{document}

相关内容