7

I just started to work with Biblatex and I'm struggling to figure out how to add a comma for articles after the issue number and before the year.

This is how my footnote citation looks like:

This is how my footnote citation looks like:

And that's how it's supposed to look:

And that's how it's supposed to look:

Here is my MWE:

\begin{filecontents}{my-bib.bib} 
 @article{Lubbers.2002,
 author = {Lubbers, Marcel and Gijsberts, M{\'e}rove and Scheepers, Peer},
 year = {2002},
 title = {{E}xtreme {R}ight-{W}ing {V}oting in {W}estern {E}urope},
 pages = {345--378},
 volume = {41},
 number = {3},
 issn = {03044130},
 journal = {European Journal of Political Research}
 }
 \end{filecontents}

 \documentclass[11pt]{scrartcl}
 \usepackage[margin= 1in]{geometry}
 \usepackage[backend=bibtex, style=verbose-trad3, isbn=false, doi=false, firstinits=true, citepages=suppress]{biblatex} 
\usepackage[style=british]{csquotes}

% Commas as separators
\renewcommand*{\newunitpunct}{\addcomma\space}

\usepackage{xpatch}
% No dot before number of articles
\xpatchbibmacro{volume+number+eid}{%
  \setunit*{\adddot}%
}{%
}{}{}
% Number of articles in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

% Comma before and after journal volume
\renewbibmacro*{volume+number+eid}{%
  \setunit*{\addcomma\space}% NEW
  \printfield{volume}%
%  \setunit*{\adddot}% DELETED
  \setunit*{\addcomma\space}% NEW
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

% Prefixes for journal volume and number
\DeclareFieldFormat[article]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article]{number}{\bibstring{number}~#1}% number of a journal

% Comma before date; date not in parentheses
\renewbibmacro*{issue+date}{%
  \setunit*{\addcomma\space}% NEW
%  \printtext[parens]{% DELETED
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
%       \usebibmacro{date}}}% DELETED
       \usebibmacro{date}}% NEW
  \newunit}


\bibliography{my-bib}  
\begin{document}
Test\autocite{Lubbers.2002}.
\printbibliography
\end{document}

I wish to add a comma after the issue number for articles. Does anybody know a solution to this?

  • what about changing \setunit*{\addspace} to \setunit*{\addcomma\addspace}? – Guido Jan 5 '15 at 10:05
7

Here you are: patching journal+issuetitle:

\begin{filecontents}{my-bib.bib}
 @article{Lubbers.2002,
 author = {Lubbers, Marcel and Gijsberts, M{\'e}rove and Scheepers, Peer},
 year = {2002},
 title = {{E}xtreme {R}ight-{W}ing {V}oting in {W}estern {E}urope},
 pages = {345--378},
 volume = {41},
 number = {3},
 issn = {03044130},
 journal = {European Journal of Political Research}
 }
 \end{filecontents}

 \documentclass[11pt]{scrartcl}
 \usepackage[margin= 1in]{geometry}
 \usepackage[backend=bibtex, style=verbose-trad3, isbn=false, doi=false, firstinits=true, citepages=suppress]{biblatex}
\usepackage[style=british]{csquotes}

% Commas as separators
\renewcommand*{\newunitpunct}{\addcomma\space}

\usepackage{xpatch}
% Comma before issue + date
\xpatchbibmacro{journal+issuetitle}{%
  \setunit{\addspace}%
  \usebibmacro{issue+date}}%
{\setunit{\addcomma\addspace}%
  \usebibmacro{issue+date}}%
{}{}

% No dot before number of articles
\xpatchbibmacro{volume+number+eid}{%
  \setunit*{\adddot}%
}{%
}{}{}
% Number of articles in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

% Comma before and after journal volume
\renewbibmacro*{volume+number+eid}{%
  \setunit*{\addcomma\space}% NEW
  \printfield{volume}%
% \setunit*{\adddot}% DELETED
  \setunit*{\addcomma\space}% NEW
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

% Prefixes for journal volume and number
\DeclareFieldFormat[article]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article]{number}{\bibstring{number}~#1}% number of a journal

% Comma before date; date not in parentheses
\renewbibmacro*{issue+date}{%
  \setunit*{\addcomma\space}% NEW
% \printtext[parens]{% DELETED
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
% \usebibmacro{date}}}% DELETED
       \usebibmacro{date}}% NEW
  \newunit}

\bibliography{my-bib}
\begin{document}

\vspace*{6in}
Test\autocite{Lubbers.2002}.
\printbibliography
\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.