我使用以下配置来引用来源:
\usepackage[backend=bibtex, style=authoryear-ibid, autocite=footnote]{biblatex}
我的一个间接引用如下:
\autocite[Vgl.][123]{ruschmeyer}
我得到这个结果:
是。 Ruschmeyer ua 1995,S.123
根据我所在大学的指导方针,我更希望获得这样的结果:
是。 Ruschmeyer ua (1995),S.123
我怎样才能将年份括在括号中,而其他内容保持不变?我读过\DeclareAutoCiteCommand
,但它似乎做的比我需要的要多得多。
我看了此解决方案,但它不适用于间接引用,并且括号中还包含页码。
感谢您的帮助!
答案1
一种解决方案是重新定义宏cite:labelyear+extrayear
以始终将labelyear
(和extrayear
,如果适用)括在括号中。
\renewbibmacro*{cite:labelyear+extrayear}{%
\iffieldundef{labelyear}
{}
{\printtext[parens]{%
\printtext[bibhyperref]{%
\printfield{labelyear}%
\printfield{extrayear}}}}}
但是这看起来\textcite
很\citeyear
奇怪,因此我们也可以对cite
宏进行稍微长一点的重新定义(以及新宏的定义):
\newbibmacro*{cite:labelyear+extrayear:paren}{%
\iffieldundef{labelyear}
{}
{\printtext[parens]{\usebibmacro{cite:labelyear+extrayear}}}}
\renewbibmacro*{cite}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\usebibmacro{cite:ibid}}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\usebibmacro{cite:labelyear+extrayear:paren}}}
{\usebibmacro{cite:shorthand}}}
或(将所有内容放入一个宏中)
\renewbibmacro*{cite}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\usebibmacro{cite:ibid}}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\iffieldundef{labelyear}
{}
{\printtext[parens]{\usebibmacro{cite:labelyear+extrayear}}}}}
{\usebibmacro{cite:shorthand}}}
采用第二种解决方案的 MWE
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex, style=authoryear-ibid, autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\newbibmacro*{cite:labelyear+extrayear:paren}{%
\iffieldundef{labelyear}
{}
{\printtext[parens]{\usebibmacro{cite:labelyear+extrayear}}}}
\renewbibmacro*{cite}{%
\global\boolfalse{cbx:loccit}%
\iffieldundef{shorthand}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\usebibmacro{cite:ibid}}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\usebibmacro{cite:labelyear+extrayear:paren}}}
{\usebibmacro{cite:shorthand}}}
\begin{document}
Lorem\autocite[Vgl.][123]{markey} ipsum\autocite{knuth:ct:a} dolor\autocite{knuth:ct:b} sit\autocite{knuth:ct:a,knuth:ct:b} amet.
\Textcite{wilde} consecetur.
\printbibliography
\end{document}