如何使用 BibLatex 创建两个独立的索引:主题索引和作者索引

如何使用 BibLatex 创建两个独立的索引:主题索引和作者索引

使用 bibtex 生成单独的(作者和主题)索引的文档非常丰富。但是如何使用 BibLatex 生成这两个索引呢?我没有找到任何文档。

答案1

biblatex附带几个示例文件,其中三个与索引有关。

这些文件不仅包含示例代码,还包含大量解释性注释。

21-indexing-multiple.tex下面是使用imakeidx(as )的简化版本22-indexing-subentry.tex

关键是需要定义标准biblatex索引(bib)宏来调用\index可选参数来指定条目应进入哪个索引。

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[american]{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear, indexing]{biblatex}
\addbibresource{biblatex-examples.bib}

\usepackage{imakeidx}
\makeindex
\makeindex[name=names,title={Names}]
\makeindex[name=titles,title={Titles}]

\DeclareIndexNameFormat{default}{%
  \usebibmacro{index:name}{\index[names]}
   {\namepartfamily}
   {\namepartgiven}
   {\namepartprefix}
   {\namepartsuffix}}


\DeclareIndexFieldFormat{indextitle}{%
  \usebibmacro{index:title}{\index[titles]}{#1}%
}

\begin{document}
\cite{sigfridsson,worman,nussbaum,geer,pines}

\index{Example entry}

\printbibliography
\printindex
\printindex[names]
\printindex[titles]
\end{document}

姓名索引

标题索引

答案2

谢谢,这里有一个 MMWE,它创建了两个不同的索引(作者和主题)

\documentclass{article}
    \begin{filecontents}{my.bib}
    @article{sanchez16,
      title={Use of Damage Rating Index to Quantify Alkali-Silica Reaction Damage in Concrete: Fine versus Coarse Aggregate.},
      author={Sanchez, L. and Fournier, B. and Jolin, M. and Bedoya, M. and Bastien, J. and Duchesne, J.},
      journal={ACI Materials Journal},
      volume={113},
      number={4},
      year={2016}
    }
    \end{filecontents}
    \usepackage{csquotes}
    \usepackage[style=numeric,natbib=true,backend=bibtex,sorting=nyt,refsegment=section,defernumbers=true,maxnames=4,indexing=cite
    ]{biblatex}
    \addbibresource{my.bib}
    \usepackage{imakeidx}
    \makeindex
    \makeindex[name=names,title={Names}]
    \DeclareIndexNameFormat{default}{%
      \usebibmacro{index:name}{\index[names]}
       {\namepartfamily}
       {\namepartgiven}
       {\namepartprefix}
       {\namepartsuffix}}
    \renewbibmacro*{citeindex}{%
      \ifciteindex
        {\indexnames{labelname}}
        {}}
    %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    \begin{document}
    \citet{sanchez16} have shown    \index{Damage Rating}
    \printbibliography
    \printindex
    \printindex[names]
    \end{document}

相关内容