[Tex/LaTex] biblatex — short citation style

biblatexciting

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:

enter image description here

While working on a new talk, I have decided that I want a different (shorter) citation style that should look like this:

Wanted short style

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):

Full output MWE

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 a bibmacro.

\documentclass{article}

\usepackage[backend=biber,
  maxcitenames=1,maxbibnames=2,
  giveninits=true]{biblatex}

\newcommand*{\mktexttiny}[1]{{\normalsize #1}}
% the definition should of course be {{\tiny #1}},
% but \normalsize is easier to read in the MWE

\DeclareCiteCommand{\cfootcitenew}[\mktexttiny]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cfootcitenew}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\newbibmacro*{cfootcitenew}{%
  \printnames{labelname}%
  \setunit{\addcomma\space}%
  \ifentrytype{article}
    {\printfield{journaltitle}%
     \setunit{\addspace}%
     \printfield{volume}%
     \setunit{\addcomma\space}%
     \printfield{pages}}
    {\printfield{labeltitle}}%
  \setunit{\addspace}%
  \DeclareFieldFormat{date}{\mkbibparens{##1}}%
  \printdate
}

\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{#1}}
\DeclareFieldFormat{pages}{#1}

\begin{filecontents}[force]{\jobname.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}
\addbibresource{\jobname.bib}

\begin{document}
\cfootcitenew{article}
\end{document}

Vimes, Unseen University Non-Magical Journal **4**, 42–37 (1988)