Coloque o ano entre parênteses usando biblatex-chicago

Coloque o ano entre parênteses usando biblatex-chicago

Quero usar o estilo biblatex-chicago e colocar o ano entre parênteses.

Portanto segui a solução deste post: parênteses em torno do ano

No entanto, parece que isso funciona apenas para biblatex sem o estilo chicago. Usando o estilo chicago os parênteses são adicionados no final da referência sem conteúdo.

Aqui está um MWE:

\begin{filecontents*}{test.bib}
@INPROCEEDINGS{author2017,
  author = {Firstname Lastname},
  title = {My Title},
  year = {2017},
  pages = {123--124}
}
\end{filecontents*}

\documentclass{scrbook}
\usepackage[
    authordate,
    backend=biber,
]{biblatex-chicago}

% Try to add parentheses around year in bibliography
% however, they are added at the end
\DeclareFieldFormat{parens}{\mkbibparens{#1}}
\renewbibmacro*{date}{\printtext[parens]{\printdate}}

\bibliography{test.bib}

\begin{document}
    \textcite{author2017}
    \printbibliography
\end{document}

MWE estendido com artigo e solução da moewe:

\begin{filecontents*}{\jobname.bib}
@INPROCEEDINGS{author2017inp,
  author = {Firstname Lastname},
  title = {My In Proceedings},
  year = {2017},
  pages = {123--124}
}
@ARTICLE{author2017art,
  author = {Firstname Lastname},
  title = {My Article},
  year = {2017},
  pages = {123--124}
}
@BOOK{author2017book,
  author = {Firstname Lastname},
  title = {My Book},
  year = {2017},
  pages = {123--124}
}

\end{filecontents*}

\documentclass{article}
\usepackage[
    authordate,
    backend=biber,
]{biblatex-chicago}

\addbibresource{\jobname.bib}

\makeatletter
\renewbibmacro*{cmsbibyear}{%
  \printtext[parens]{%
    \iftoggle{cms@origlabel}%
      {\usebibmacro{origyear+labelyear}}%
      {\iftoggle{cms@bothlabelnew}%
         {\usebibmacro{bothyear+oldstyle}}%
         {\iftoggle{cms@bothlabelold}%
            {\usebibmacro{bothyear+oldstyle}}%
            {\usebibmacro{labelyear+extrayear}}}}}%
  \ifcsdef{@cms@tempdate}%
    {\toggletrue{\@cms@tempdate}}%
    {}}%
\makeatother

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

Responder1

biblatex-chicagoO tratamento da data é muito complicado para garantir que esteja em conformidade com os padrões do CMS, por isso não é nada fácil mudar isso. A redefinição a seguir parece ser a mais segura e mais curta - em muito poucos casos pode levar a resultados indesejáveis, mas ainda não encontrei um desses casos.

\begin{filecontents*}{\jobname.bib}
@INPROCEEDINGS{author2017,
  author = {Firstname Lastname},
  title = {My Title},
  year = {2017},
  pages = {123--124}
}
\end{filecontents*}

\documentclass{article}
\usepackage[
    authordate,
    backend=biber,
]{biblatex-chicago}

\addbibresource{\jobname.bib}

\makeatletter
\renewbibmacro*{cmsbibyear}{%
  \printtext[parens]{%
    \iftoggle{cms@origlabel}%
      {\usebibmacro{origyear+labelyear}}%
      {\iftoggle{cms@bothlabelnew}%
         {\usebibmacro{bothyear+oldstyle}}%
         {\iftoggle{cms@bothlabelold}%
            {\usebibmacro{bothyear+oldstyle}}%
            {\usebibmacro{labelyear+extrayear}}}}}%
  \ifcsdef{@cms@tempdate}%
    {\toggletrue{\@cms@tempdate}}%
    {}}%
\makeatother

\begin{document}
    \textcite{author2017}
    \printbibliography
\end{document}

MWE elegantemente cortado

informação relacionada