这个帖子包含一个具有作者-期刊-年份引用样式的 MWE,用于 biblatex,改编自作者年份期刊引用样式。下面复制了 MWE,并进行了一次修改,删除了期刊和年份之间的逗号。是否可以\cite
轻松修改此 MWE 中的宏以将年份括在括号中?
梅威瑟:
\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\usetheme{Madrid}
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1\isdot}}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\setunit{\addcomma\space}%
\usebibmacro{journal}%
\setunit{\space}%
\usebibmacro{cite:labelyear+extrayear}%
}
{\usebibmacro{cite:shorthand}}}
\begin{document}
\begin{frame}{Polaron Transformation}
\begin{itemize}
\item The original theory was developed by Munn-Silbey{\tiny \footcite{cicero}\footcite{aksin}\footcite{angenendt}} and further refined by Zhao et al. \footcite{bertram}\footcite{doody}
\end{itemize}
\end{frame}
\end{document}
在所需的输出中,第二和第五个引用的格式如下:
Aksin 等人,J. Organomet.化学。 (2006)。
杜迪,《叙事技巧杂志》(1974 年)。
答案1
您可以重新定义 bibmacrocite:labeldate+extradate
来添加括号。原始定义可以在authoryear.cbx
(v3.14 中的第 56-59 行)
\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\usetheme{Madrid}
% only needed in outdated biblatex versions,
% see https://tex.stackexchange.com/q/540967/35864
%\DeclareFieldFormat{journaltitle}{\mkbibemph{#1\isdot}}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}}
{\printnames{labelname}}%
\setunit{\addcomma\space}%
\usebibmacro{journal}%
\setunit{\addspace}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
\renewbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[parens]{%
\printtext[bibhyperref]{%
\printlabeldateextra}}}}
\begin{document}
\begin{frame}{Polaron Transformation}
\begin{itemize}
\item The original theory was developed by Munn-Silbey\footcite{cicero}\footcite{aksin}\footcite{angenendt}
and further refined by Zhao et al.\footcite{bertram}\footcite{doody}
\end{itemize}
\end{frame}
\end{document}