我想通过合并相同作者和年份(但不同的文章)的条目来缩短参考书目,方法是使用比伯的 @set 函数。如果合并两个参考书目条目(Bringmann.2005 和 Bringmann.2005b 到 Bringmann_2005),则输出如下所示:
为了缩短这段代码,Bringmann.2005b 的作者列表应该消失。例如:
G. Bringmann、AJ Price Mortimer、PA Keller、MJ Gresser、J. Garner、M. Breuning,《应用化学国际版》2005,四十四,5384–5427;应用化学2005,117,5518–5563。
我的 .bib 文件更新非常频繁。因此,我将一个 entryset.bib 文件(包含@set-entries;不定期更新)和一个 testbib.bib (包含所有文章、书籍等;经常更新)。
这里有一些代码:
\documentclass[%
paper=A4,
twoside=true,
openright,
parskip=full,
chapterprefix=true,
11pt,
headings=normal,
bibliography=totoc,
listof=totoc,
titlepage=on,
captions=tableabove,
draft=false,
]{scrreprt}%
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,bibencoding=ascii,style=chem-angew]{biblatex}
\bibliography{entryset,testbib}
\begin{document}
This is the text.\cite{Bringmann_2005}
\printbibliography
\end{document}
这条目集-文件看起来像:
@Set{Bringmann_2005,
entryset = {Bringmann.2005, Bringmann.2005b},
}
这测试文件-文件看起来像:
@article{Bringmann.2005,
author = {Bringmann, Gerhard and Price Mortimer, Anne J. and Keller, Paul A. and Gresser, Mary J. and Garner, James and Breuning, Matthias},
year = {2005},
title = {Atroposelective Synthesis of Axially Chiral Biaryl Compounds},
pages = {5384--5427},
volume = {44},
number = {34},
issn = {1433-7851},
journal = {Angewandte Chemie International Edition},
doi = {10.1002/anie.200462661}
}
@article{Bringmann.2005b,
author = {Bringmann, Gerhard and Price Mortimer, Anne J. and Keller, Paul A. and Gresser, Mary J. and Garner, James and Breuning, Matthias},
year = {2005},
title = {Atropselektive Synthese axial-chiraler Biaryle},
pages = {5518--5563},
volume = {117},
number = {34},
issn = {00448249},
journal = {Angewandte Chemie},
doi = {10.1002/ange.200462661}
}
有没有办法操纵 @set 条目或其他方法来解决这个问题?非常感谢大家!
问候,Bernd
答案1
幸运的是,biblatex
已经提供了有效处理这个问题的所有设施(尽管仍然需要相当多的代码)。
书目样式authortitle
有一个选项可以用破折号替换列表中重复的作者,我们复制执行此操作所需的所有宏,并稍微修改一个宏(即bbx:dashcheck
)
\renewcommand{\bibnamedash}{}
\makeatletter
\InitializeBibliographyStyle{%
\global\undef\bbx@lasthash}
\newbibmacro*{bbx:savehash}{%
\savefield{fullhash}{\bbx@lasthash}}
\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
\booltrue{bbx@inset}%
\entryset{}{}%
\newunit\newblock
\usebibmacro{setpageref}%
\finentry}
\renewbibmacro*{begrelated}{%
\booltrue{bbx@inset}}
\renewbibmacro*{endrelated}{%
\usebibmacro*{bbx:savehash}}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{author}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\renewbibmacro*{editor}{%
\usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
\usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}}
{\global\undef\bbx@lasthash}}
\renewbibmacro*{translator}{%
\usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
\usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
\ifboolexpr{
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{translator}}
{\global\undef\bbx@lasthash}}
\newbibmacro*{bbx:dashcheck}[2]{%
\ifboolexpr{
test {\iffieldequals{fullhash}{\bbx@lasthash}}
and
bool {bbx@inset}
and
not test {\iffieldequalstr{entrysetcount}{1}}}
{#1}
{#2}}
\makeatother
biblatex
现在将省略条目中重复(相同)的作者@set
。
平均能量损失
\documentclass[british]{article}%
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber,style=chem-angew]{biblatex}
\begin{filecontents*}{\jobname.bib}
@article{Bringmann.2005,
author = {Bringmann, Gerhard and Price Mortimer, Anne J. and Keller, Paul A. and Gresser, Mary J. and Garner, James and Breuning, Matthias},
year = {2005},
title = {Atroposelective Synthesis of Axially Chiral Biaryl Compounds},
pages = {5384--5427},
volume = {44},
number = {34},
issn = {1433-7851},
journal = {Angewandte Chemie International Edition},
doi = {10.1002/anie.200462661}
}
@article{Bringmann.2005b,
author = {Bringmann, Gerhard and Price Mortimer, Anne J. and Keller, Paul A. and Gresser, Mary J. and Garner, James and Breuning, Matthias},
year = {2005},
title = {Atropselektive Synthese axial-chiraler Biaryle},
pages = {5518--5563},
volume = {117},
number = {34},
issn = {00448249},
journal = {Angewandte Chemie},
doi = {10.1002/ange.200462661}
}
@Set{Bringmann_2005,
entryset = {Bringmann.2005, Bringmann.2005b},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\renewcommand{\bibnamedash}{}
\makeatletter
\InitializeBibliographyStyle{%
\global\undef\bbx@lasthash}
\newbibmacro*{bbx:savehash}{%
\savefield{fullhash}{\bbx@lasthash}}
\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
\booltrue{bbx@inset}%
\entryset{}{}%
\newunit\newblock
\usebibmacro{setpageref}%
\finentry}
\renewbibmacro*{begrelated}{%
\booltrue{bbx@inset}}
\renewbibmacro*{endrelated}{%
\usebibmacro*{bbx:savehash}}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{author}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\renewbibmacro*{editor}{%
\usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
\usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}}
{\global\undef\bbx@lasthash}}
\renewbibmacro*{translator}{%
\usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
\usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
\ifboolexpr{
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{translator}}
{\global\undef\bbx@lasthash}}
\newbibmacro*{bbx:dashcheck}[2]{%
\ifboolexpr{
test {\iffieldequals{fullhash}{\bbx@lasthash}}
and
bool {bbx@inset}
and
not test {\iffieldequalstr{entrysetcount}{1}}}
{#1}
{#2}}
\makeatother
\begin{document}
This is the text. \cite{Bringmann_2005,knuth:ct:a,knuth:ct:b,set,stdmodel}
\printbibliography
\end{document}
请注意,在 [1] 中作者列表没有重复,因为它们是一致的;而在 [4] 和 [5] 中,(不同的)作者被保留。在 [2] 和 [3] 中重复的作者也在两个条目中保留。