2

The punctuation before the year in a proceedings is a period.

The punctuation before the year in an article is a comma.

Is there some parameter/argument to pass to biblatex/biber to make this punctuation uniform?

An example MWE, with some slight formatting choices.

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\bibliography{mwepubs.bib}
% Removes months from citations
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}

% Removes the ``In'' before journals/venues \renewbibmacro{in:}{}

% Remove parentheses from years in articles \renewbibmacro{issue+date}{% \setunit{\addcomma\space}% NEW \iffieldundef{issue} {\usebibmacro{date}} {\printfield{issue}% \setunit{\addspace}% \usebibmacro{date}}% NEW \newunit}

\begin{filecontents}{mwepubs.bib} @article{Art1, title = {Article Title One}, author = {Author One and Author Two}, journal = {Best Journal}, url = {http://www.google.com}, year = {2021}, } @inproceedings{Proc1, author = {Again One and Again Two}, title = {Proceedings Title}, booktitle = {Venue where}, pages = {1--71}, year = {2018}, doi = {10.10000/1000}, } \end{filecontents}

\begin{document} \fullcite{Art1} \fullcite{Proc1} \end{document}

This produces the output:

image_with_mixed_periods_and_commas

Note the comma before one year and a period before the other year.

jmlarson
  • 625
  • Do you prefer the , or the .? You could change the inproceedings driver to use a comma , instead of a period by adding the following to your preamble: code (change highlighted), output – Werner Apr 11 '23 at 22:15
  • I was wanting the period before the year in the articles. Even more, I was hoping for a command to have periods before years after all journals/books/proceedings/etc. – jmlarson Apr 12 '23 at 17:58

1 Answers1

4

Punctuation in biblatex is usually handled asynchronously by the punctuation buffer. Style code adds a punctuation mark to the buffer (overwriting its previous state) and the buffer is printed and emptied the next time a biblatex prints a field. This allows biblatex to avoid double punctuation and punctuation clashes. It also gives us a fairly straightforward way to force punctuation before a certain field. It's trickier to control the punctation after a field. For those who want to know more about the punctation buffer, I'll leave a link to What do \setunit and \newunit do? and Is there any difference between \setunit*{<punct>} and \setunit{\add<punct>}. The second post links to a number of further discussions of the punctuation buffer on this site.

The standard biblatex drivers mostly use \newunitpunct for punctuation between fields (this command can be redefined by the user, by default it's a period plus a sapce). There are, however, a couple of exceptions, for example we get nametitledelim between the author/editor (and year in authoryear-like styles) and the title and we get \bibpagespunct before the pages field. This makes customisation easier for users, because they can just redefine these delimiters or commands. We also get various (hard-coded) punctuation marks in the publisher+location+date block. These are harder to customise: Users need to redefine the involved bibmacros directly.

The standard styles also hard-code different punctuation in the journal+issuetitle and volume+number+eid bibmacros that typeset most journal information for @articles. In particular the publication year is typeset in parentheses and therefore usually preceded by just a space if the volume is present (I'm guessing because the year is seen as subordinate to the volume field). The relevant bibmacros look like this (see standard.bbx, ll. 784-804 in v3.19)

\newbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\newbibmacro{volume+number+eid}{% \printfield{volume}% \setunit{\adddot}% \printfield{number}% \setunit{\bibeidpunct}% \printfield{eid}}

In the standard styles there is no simple switch to make these punctuation marks the same. You'll have to redefine these bibmacros. The following might work (we just replace the \setunit{\addspace} before \usebibmacro{issue+date} in journal+issuetitle with \setunit{\addperiod\space}).

\documentclass{article}
\usepackage[backend=biber]{biblatex}

\DeclareFieldInputHandler{month}{\def\NewValue{}}

\renewbibmacro{in:}{}

\renewbibmacro{journal+issuetitle}{% \usebibmacro{journal}% \setunit{\addspace}% \iffieldundef{series} {} {\newunit \printfield{series}% \setunit{\addspace}}% \usebibmacro{volume+number+eid}% \setunit{\addperiod\space}% \usebibmacro{issue+date}% \setunit{\addcolon\space}% \usebibmacro{issue}% \newunit}

\renewbibmacro{issue+date}{% \printfield{issue}% \setunit{\addspace}% \usebibmacro{date}% \newunit}

\begin{filecontents}{\jobname.bib} @article{Art1, title = {Article Title One}, author = {Author One and Author Two}, journal = {Best Journal}, url = {http://www.google.com}, year = {2021}, } @inproceedings{Proc1, author = {Again One and Again Two}, title = {Proceedings Title}, booktitle = {Venue where}, pages = {1--71}, year = {2018}, doi = {10.10000/1000}, } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document} \fullcite{Art1}

\fullcite{Proc1} \end{document}

Author One and Author Two. “Article Title One”. Best Journal. 2021. url: http://www.google.com
Again One and Again Two. “Proceedings Title”. Venue where. 2018, pp. 1–71. doi: 10.10000/1000

moewe
  • 175,683