6

How does one place a colon after the volume and before the page range for articles?

\documentclass{memoir}

\usepackage{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@Article{Reference:1994,
  author =   {First I. Last, and Second Y. Author},
  title =    {This is the article title},
  journal =  {T Journal T},
  journallongtitle =     {The Journal Title},
  year =     1994,
  volume =   50,
  pages =    {30--40}
}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}
lockstep
  • 250,273
WillAdams
  • 7,187

2 Answers2

5

The following works with either the default numeric or with the authoryear style but really only makes sense with the authoryear style since in the numeric style, the year comes after the volume. The punctuation before the pages is controlled by the macro \bibpagespunct.

\begin{filecontents}{\jobname.bib}
@Article{Reference:1994,
  author =   {First I. Last, and Second Y. Author},
  title =    {This is the article title},
  journal =  {T Journal T},
  journallongtitle =     {The Journal Title},
  year =     1994,
  volume =   50,
  number = 6,
  pages =    {30--40}
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}
\renewcommand*{\bibpagespunct}{\addcolon\space}
\begin{document}
\autocite{Reference:1994}
\printbibliography
\end{document}

output of code

Alan Munn
  • 218,180
  • Apparently my MWE is too minimal --- I applied your change, but it didn't work in my full file. I'll have to see about making a longer question which more fully addresses my needs. Thanks! – WillAdams Nov 01 '13 at 18:55
  • 1
    @WillAdams But then you must be using a particular biblatex style that changes some of this. Without knowing what that is, it will be hard to solve. – Alan Munn Nov 01 '13 at 19:45
  • Shouldn't the last change made over-ride anything which went before? – WillAdams Nov 01 '13 at 22:50
  • @WillAdams Only if the relevant style uses the same bibmacros to print out the volume and pages. If it doesn't then changing what I suggested won't have any effect. – Alan Munn Nov 01 '13 at 23:16
  • This solution will also replace the comma with a colon for entries that aren't journal articles. While the colon is common for journal articles, it is not common for articles in edited volumes. – Sverre Feb 03 '14 at 20:00
3

This solution will add the colon only for journal articles (which is the only place you would want this, I believe). I've also removed the "In:" and "pp.", which I think are unusual solutions.

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{myarticle,
    AUTHOR = "John Doe",
    TITLE = "My article",
    JOURNALTITLE = "A Cool Journal",
    VOLUME = "16",
    PAGES = "18--56",
    YEAR = "2005"}
@incollection{mycontrib,
    AUTHOR = "Peter Smith",
    TITLE = "My contribution",
    BOOKTITLE = "A collection of articles",
    EDITOR = "John Carpenter",
    YEAR = "2010",
    LOCATION = "London",
    PAGES = "685--764"}
\end{filecontents}
\addbibresource{\jobname.bib}
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon\addspace}{\addcomma\addspace}}
\DeclareFieldFormat[article,incollection]{pages}{#1}
\renewbibmacro{in:}{\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\begin{document}
\nocite{myarticle,mycontrib}
\printbibliography
\end{document}

enter image description here

Sverre
  • 20,729