0

This post contains an MWE with an author-journal-year citation style for biblatex, adapted from an author-year-journal citation style. The MWE is copied below with a single modification, which removes the comma between the journal and the year. Can the \cite macro in this MWE be easily modified to enclose the year in parentheses?

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}

Relevant output: enter image description here

In the desired output, the 2nd and 5th references would be formatted as follows:

Aksin et al., J. Organomet. Chem. (2006).

Doody, The Journal of Narrative Technique (1974).

1 Answer 1

1

You can redefine the bibmacro cite:labeldate+extradate to add the parentheses. The original definition can be found in authoryear.cbx (ll. 56-59 in v3.14)

\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}

Aksın et al., J. Organomet. Chem. (2006).

5
  • Thanks again, moewe. By the way, I changed \renewbibmacro*{cite:labeldate+extradate} to \renewbibmacro*{cite:labelyear+extrayear} given my outdated biblatex version. I tried once again to update to TeXLive 2020, but encountered the same problem (biber exiting 255), so it seems I am stuck at biblatex version 3.12 for the present.
    – user001
    Apr 27, 2020 at 18:28
  • @user001 cite:labeldate+extradate has been the correct name since biblatex v3.8 (2017-11-04), so with v3.12 you should use the new name cite:labeldate+extradate.
    – moewe
    Apr 27, 2020 at 18:30
  • Thanks for pointing that out. On a system with biblatex v3.4, I was seeing the error ! Package biblatex Error: Bibliography macro 'cite:labeldate+extradate' undefined. The cite:labeldate+extradate macro is recognized on another system with biblatex v3.12.
    – user001
    Apr 27, 2020 at 18:36
  • @user001 Even with biblatex v3.4 the code as posted should not throw an error. It will produce a warning Package biblatex Warning: Macro 'cite:labeldate+extradate' undefined. Using \newbibmacro on input line 22. but that warning is benign. (Of course you will get an error in versions before v3.8 if you don't have a line (re)defining cite:labeldate+extradate.)
    – moewe
    Apr 27, 2020 at 18:40
  • Indeed, I had encountered that error while testing your revised code in the author-year-journal post with biblatex v3.4. Upon finding that the date-->year substitution resolved the matter, I carried it over to this example as well. Thanks.
    – user001
    Apr 27, 2020 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .