MWE 是仿照 MWE 建立的21-indexing-multiple.tex
,但有两个问题。首先,作者和标题索引有尾随逗号。其次,我更希望只将作品的第一作者 et al 放入作者索引中(例如,只将 Chidiac, P. et al, 2, 3 放入作者索引中,而不将 Beaucourt 和 Quantin 放入作者索引中)
平均能量损失
%
% latex file
% bibtex/biber file
% latex file
% makeindex -o file.ind file.idx (= makeindex file)
% makeindex -o file.nnd file.ndx
% makeindex -o file.tnd file.tdx
% latex file
\documentclass{article}
\usepackage[style=authoryear,indexing,backend=biber,datamodel=\jobname]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{doe1981,
Author = {Doe, John Jack},
indexname = {Doe, John Jack},
Journal = {Journal of Nothing},
Pages = {164--178},
Title = {More Great Stuff},
Volume = {4},
Year = {1981}}
@book{CHID2004,
Author = {Chidiac, P. and Quantin, J.-C. and Beaucourt, D.},
indexname = {Chidiac, P.},
title = {{Un standard pour l'an 2000 - Tome 2}},
language = {francais},
publisher = {Fédération Française de Bridge},
month=jui,
date = {2004}
}
@book{RODW2012,
Author = {Rodwell, E.},
indexname = {Rodwell, E.},
title = {{Eric Rodwell: The Bridge World Interview}},
publisher = {The Bridge World},
page={26},
date = {2012}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\usepackage{index}
\newindex{default}{idx}{ind}{Index}
\newindex{names}{ndx}{nnd}{Index des auteurs}
\newindex{titles}{tdx}{tnd}{Ouvrages cités}
\RequirePackage[unicode=true, psdextra, colorlinks=true, linktoc=all]{hyperref}
\makeatletter
\@ifpackageloaded{biblatex_legacy}
{\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\index[names]}{#1}{#3}{#5}{#7}}}
{\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\index[names]}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}
\makeatother
\DeclareIndexFieldFormat{indextitle}{%
\usebibmacro{index:title}{\index[titles]}{#1}%
}
\renewbibmacro*{bibindex}{%
\ifbibindex
{\indexnames{author}%
\indexnames{editor}%
\indexnames{translator}%
\indexnames{commentator}%
\indexfield{indextitle}}
{}}
\DeclareNameFormat{mygiveninit-family}{%
\usebibmacro{name:given-family}%
{\namepartfamily}%
{\namepartgiveni}%
{\namepartprefix}%
{\namepartsuffix}%
\usebibmacro{name:andothers}}%
\newbibmacro*{cite:fullpartcite}{%
\printnames[mygiveninit-family]{labelname}%
\setunit*{\printdelim{nametitledelim}}%
\printfield[citetitle]{title}%
\setunit{.}%
}%
\DeclareCiteCommand{\Bridgecite}[\mkbibfootnote]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite:fullpartcite}}%
{\multicitedelim}%
{\usebibmacro{postnote}}%
\begin{document}
Cette convention était popularisée par l'équipe Meckwell. \Bridgecite{RODW2012}
\newpage
On suit le livre de \Bridgecite{CHID2004}
\newpage
% We print the printbibliography...
\printbibliography
% ...and the indexes
\raggedright
\printindex % the general index
\printindex[names] % the name index
\printindex[titles] % the title index
\end{document}
答案1
手册页https://www.systutorials.com/docs/linux/man/1-makeindex/文件
"Delimiter to be inserted between a level 0 key and its first page number is delim_0 <string> ", "(default: comma followed by a blank)"
因此,在 .ist 文件中将其更改为 delim_0 ": " 应该可以工作。
这里以 myfile.ist 为例:
preamble
"\\documentstyle[11pt]{book}
\\begin{document}
\\begin{theindex}
{\\small\n"
postamble
delim_0 ": "
"\n\n}
\\end{theindex}
\\end{document}\n"
运行makeindex -s myfile.ist authors
作者索引可得到所需结果
Index des auteurs
Lévy, A.: 5
Fédération Française de Bridge: 3
Rodwell, E.: 11
关于如何索引作者和标题的第二个问题 - 有人希望有一个命令可以同时执行引用和作者/标题索引。在 BibLaTeX 中一定有办法做到这一点,但我选择了一种更简单的解决方案,类似于
\newcommand{\Bridgeciteindex}[1]{\Bridgecite{#1}\sindex[aut]{\authorGet{#1}}\sindex[tit]{\titleGet{#1}}}
第一个元素是自定义的脚注引文,后两个元素\usepackage[makeindex]{splitidx}
分别用于作者和标题。它们从预生成的查找表中获取键值对,该查找表可以从 .bib 文件中生成。这些看起来像
\authorPut{RODW2012}{{Rodwell, E.}}
\titlePut{RODW2012}{{Eric Rodwell: The Bridge World Interview}}
整个表成为一个输入文件。
Put/Get 代码复制自执行查找表时超出容量
输出看起来像
Ouvrages cités
Eric Rodwell: The Bridge World Interview, 1
Un standard pour l’an 2000 - Tome 2, 5
仍然有可能正确但具有误导性的尾随逗号。现已更正 :-)