我正在使用 biblatex 创建索引,但想过滤掉出版物标题。目标是在作者索引中只包含作者姓名,目前我最终获得了所需的所有作者条目,但他们的书籍或文章的标题会在索引文件中创建额外的条目。如何抑制这些列表?
MWE 如下:
\documentclass[a4paper,
12pt,
twoside,
]{scrbook}
\usepackage{filecontents}
\begin{filecontents}{\bibliography.bib}
@ARTICLE{article,
author = {Nachname, Vorname},
title = {Titel des Zeitschriftenartikels},
journal = {Zeitschrift},
year = {2006},
volume = {6},
pages = {19--75}
}
@BOOK{book,
author = {Buchautor, Hans-Wilhelm},
title = {Irgendein Buch},
address = {Buch am Wald},
year = {2000}
}
\end{filecontents}
\usepackage{scrpage2}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{mathptmx}
\usepackage[ngerman]{babel}
\usepackage[split,makeindex]{splitidx}
\newindex[List of authors]{aut}
\usepackage[%bibencoding=utf8,
backend=bibtex8,
natbib=true,
style=authoryear-icomp,
maxnames=3, minnames=1,
sorting=nyt,
indexing=true,
abbreviate=false,
dashed=true,
eprint=false,
block=none,
%bibencoding=auto
]{biblatex}
%
\begin{document}
The example is really short MWE \parencite{article}. Maybe something is missing, please correct me if I forgot something as mentioned by \textcite{book}.
%
\printbibliography
\printindex
\end{document}
另外一个问题是(我把它从 MWE 中遗漏了):
在当前形式中,文中引用的每个人都被编入索引。我正在为其准备这本书的出版商希望只索引正文中引用的作者姓名:
如何从索引中过滤出脚注中引用的作者?
答案1
biblatex 文档中的三个示例(20-22)说明:
- 单一索引
makeidx
, - 多个索引
index
,以及 - 带有的多级索引
imakeidx
。
要创建内联引用作者的单个索引,只需加载 biblatexindexing=cite
并重新定义citeindex
参考书目宏:
\renewbibmacro*{citeindex}{%
\ifboolexpr{ test {\ifciteindex} and not test {\iffootnote} }
{\indexnames{author}}{}}
当作者列表缺失时,您可能希望索引编辑或翻译。为此,请替换author
为labelname
。
下面是一个演示两个索引的示例——一个用于作者,另一个用于标题。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[indexing=cite,maxnames=3,backend=bibtex,style=authoryear-icomp]{biblatex}
\usepackage{splitidx}
\makeindex
\newindex[List of authors]{author}
\newindex[List of Titles]{title}
\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\sindex[author]}{#1}{#3}{#5}{#7}}
\DeclareIndexFieldFormat{indextitle}{%
\usebibmacro{index:title}{\sindex[title]}{#1}}
\renewbibmacro*{citeindex}{%
\ifboolexpr{ test {\ifciteindex} and not test {\iffootnote} }
{\indexnames{author}%
\indexfield{indextitle}}
{}}
\addbibresource{biblatex-examples.bib}
\begin{document}
Filler \parencite{aksin,companion}. Filler.\footcite{bertram}
\Textcite{markey,jaffe}...
\printbibliography
\printindex*
\end{document}
将此文档保存为test.tex
,可以使用以下命令进行编译:
latex test
bibtex test
latex test
latex test
splitindex.pl test
latex test