I am trying to modify the citation style of biblatex
for a beamer
presentation. Using this question and this follow-up question of mine, I have used the resulting code (see MWE below) happily for some time, which yields the following output:
While working on a new talk, I have decided that I want a different (shorter) citation style that should look like this:
with "author, journal journal volume, pages (year)".
Is there a way to achieve this? I have tried to use the same tricks as for the journal name to get the journal volume, but I get ! Package biblatex Error: Bibliography macro 'volume' undefined.
Could there even be a predefined citation-style
? I appreciate any kind of ideas.
MWE (note: the documentclass
in this MWE is article
, not beamer
, since it does not impact the behaviour in this case):
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{bib.bib}
@article{article,
author = {Vimes, Samuel},
title = {The Influence of Species Diversity in the City Watch},
journal = {Unseen University Non-Magical Journal},
volume = {4},
pages = {42--37},
date = {1988}
}
\end{filecontents}
\usepackage[backend=biber,maxcitenames=1,maxbibnames=2,
giveninits=true]{biblatex}
\addbibresource{bib.bib}
% previous citation style
\DeclareCiteCommand{\citejournal}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifentrytype{article}{\usebibmacro{journal}\addcomma\addspace}{}}
{\multicitedelim}
{\usebibmacro{postnote}}
\newcommand{\cfootcite}[1]{
{\tiny{\citeauthor{#1}, \citetitle{#1}, \citejournal{#1}\citeyear{#1}}}} % to get author, title, journal, year
% attempt at new style
\DeclareCiteCommand{\citevolume}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifentrytype{article}{\usebibmacro{volume}\addcomma\addspace}{}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1\isdot}}
\newcommand{\cfootcitenew}[1]{
{\tiny{\citeauthor{#1}, \citejournal{#1}\citevolume{#1}(\citeyear{#1})}}} % to get author, journal, journal number, year
\begin{document}
Old style:
\cfootcite{article}
Attempt new style:
\cfootcitenew{article}
\end{document}
Output (while ignoring error):
Best Answer
I strongly recommend against lobbing together several high-level
\cite...
commands into a\newcommand
. (In some cases this can lead to actual problems with citation tracking, but usually it is just more work than necessary.)The usual way to do create a new citation command is to define it with
\DeclareCiteCommand
. Usually this command delegates all the hard work to abibmacro
.