# Change separator for articles in journals without volume number (biblatex)

I have the following code:

\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}

\AtEveryBibitem{\ifentrytype{article}{\clearfield{number}}{}} % don't print issue for article entries
\renewbibmacro{in:}{\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}} % don't print "in" for articles
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} % colon between volume and page ranges for journal articles, period plus space for articles in books
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % no word 'pages' for articles in the bibliography (print as is)

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{jensen1916,
AUTHOR = "Alfred Jensen",
TITLE = "Bemerkninger til dagligtalen i Kristiania",
JOURNALTITLE = "Maal og Minne",
YEAR = "1916",
NUMBER = "1--2",
PAGES = "60--89"}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


The bibliographic entry is an article in a journal that doesn't use volume numbers (because it issues one volume each year, so the year itself is sufficient information). The code above will print a colon separator between the name of the journal and the page range. I think this looks weird.

In such cases I'd prefer either white space:

Jensen, Alfred (1916). "Bemerkninger til dagligtalen i Kristiania". Maal og Minne 60-89.

or a comma plus a space:

Jensen, Alfred (1916). "Bemerkninger til dagligtalen i Kristiania". Maal og Minne, 60-89.

How can I achieve this, so that it prints a colon when the journal has a volume number, but white space or comma plus white space when there is no volume number?

• You do realise though that you do clear the number field for article, so in your bibliography no entry has a number field (\ifentrytype{article}{\clearfield{number}}{}). So do you just want a comma for @articles instead of a colon (or the period)? – moewe Sep 3 '14 at 14:29
• @moewe Yes, I included the code where I'm clearing the number field in case that should become relevant. But, I don't clear the volume field. I just want a comma if the volume field is empty. (The number field is what's normally called 'issues'). – Sverre Sep 3 '14 at 14:31
• Oh, I'm sorry, I confused number and volume. – moewe Sep 3 '14 at 14:33

We can flesh out the logic in \renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} a bit more to

\renewcommand*{\bibpagespunct}{%
\ifentrytype{article}{%
\iffieldundef{volume}


This prints a comma if the entry is an @article without a volume, prints a colon, if we have an @article with a volume and a full stop otherwise.

\documentclass{article}
\usepackage[style = authoryear-comp]{biblatex}

\AtEveryBibitem{\ifentrytype{article}{\clearfield{number}}{}} % don't print issue for article entries
\renewbibmacro{in:}{\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}} % don't print "in" for articles
% colon between volume and page ranges for journal articles, period plus space for articles in books
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % no word 'pages' for articles in the bibliography (print as is)

\renewcommand{\bibpagespunct}{%
\ifentrytype{article}{%
\iffieldundef{volume}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{jensen1916,
AUTHOR = "Alfred Jensen",
TITLE = "Bemerkninger til dagligtalen i Kristiania",
JOURNALTITLE = "Maal og Minne",
YEAR = "1916",
NUMBER = "1--2",
PAGES = "60--89"}
\end{filecontents*}

\begin{document}
\nocite{angenendt,jensen1916}
\printbibliography
\end{document}


Is that like you want?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style = authoryear-comp]{biblatex}

\AtEveryBibitem{\ifentrytype{article}{\clearfield{number}}{}} % don't print issue for article entries
\renewbibmacro{in:}{\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}} % don't print "in" for articles
\renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} % colon between volume and page ranges for journal articles, period plus space for articles in books
\DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % no word 'pages' for articles in the bibliography (print as is)

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{jensen1916,
AUTHOR = "Alfred Jensen",
TITLE = "Bemerkninger til dagligtalen i Kristiania",
JOURNALTITLE = "Maal og Minne",
YEAR = "1916",
NUMBER = "1--2",
PAGES = "60--89"}
@ARTICLE{Ricoeur:2000ga,
AUTHOR = {Ricœur, Paul},
TITLE = {{L'écriture de l'histoire et la représentation du passé}},
JOURNAL = {AHESS},
YEAR = {2000},
VOLUME = {55},
NUMBER = {4},
PAGES = {731--747},
}
\end{filecontents}
