1

For my thesis, I need to add references in footnotes and a bibliography that is sorted by date. To achieve this, I switched from biblatex-chicago to the windycity style in biblatex. This works fine for the notes themselves, but I get some empty parentheses in my bibliography. I found out that this is caused by the fact that some of my references have dates with months and days, but I set date=year in my preamble. The empty parentheses would normally enclose the month. How can I remove all the months and days from dates without having to alter my .bib file.

Here is my MWE:

\documentclass{article}
\usepackage[reflist=true, style=windycity, date=year]{biblatex}
\bibliography{biblatex-examples}
\begin{document}
    Date with month: \cite{shore}
    
    Date without month: \cite{doody}
    
    \printbibliography
\end{document}

enter image description here

2 Answers 2

1

windycity basically operates under the assumption that you never explicitly set the date format to year. Here is an attempt to make windycity aware of the date format. We replace all tests for month (\iffieldundef{month}) in issue+month+etc by the test \ifdatehasyearonlyprecision{}, which also takes into account the date output format.

\documentclass{article}
\usepackage[reflist=true, style=windycity, date=year]{biblatex}
\addbibresource{biblatex-examples.bib}

\renewbibmacro*{issue+month+etc}[1]{%
  \iffieldundef{year}
    {\ifdatehasyearonlyprecision{}
       {}
       {\setunit{\space}%
        \printtext[parens]{\printdate}}}
    {\ifboolexpr{ test {\iffieldundef{volume}}
                  and test {\iffieldundef{number}}}
       {\iffieldundef{journal}
          {}
          {\setunit{\addcomma\space}}%
        \ifdatehasyearonlyprecision{}
          {\usebibmacro{issue+season+year}}%
          {\usebibmacro{reflist+year+day}%
           \printdate}}%
       {\ifdatehasyearonlyprecision{}
          {\setunit{\space}%
           \usebibmacro{reflist+issue+season}}%
          {\ifstrequal{#1}{noparens}
             {\usebibmacro{reflist+year+day}%
              \newunit
              \printdate}%
             {\usebibmacro{reflist+year+day}%
              \setunit{\space}%
              \printtext[parens]{\printdate}}}}}}

\begin{document}
  Date with month: \cite{shore}

  Date without month: \cite{doody}

  \printbibliography
\end{document}

Shore, Bradd. 1991. “Twice-Born, Once Conceived: Meaning Construction and Cultural Cognition.” American Anthropologist, new series, 93, no. 1: 9–27.

I wouldn't call this a bug, since it is perfectly legitimate for a style that implements the rules of a particular guide to work as expected only with its default settings, but you can ping the author of windycity about it at https://github.com/brianchase/windycity/issues and ask for a new feature/support for the various ...date options.

0

moewe's answer manages to get rid of the parenthesis but it still retains the difference in style of those items that have a month and those that done. I figured the easy solution might be to just remove the month and day from every bib item using

\AtEveryBibitem{%
    \clearfield{doi}%
    \clearfield{month}%
    \clearfield{day}}

This seems to work in providing the output I want. Is there any reason why I would use this?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .