Pon el año entre paréntesis usando biblatex-chicago

Pon el año entre paréntesis usando biblatex-chicago

Quiero usar el estilo biblatex-chicago y quiero poner el año entre paréntesis.

Por lo tanto, seguí la solución de esta publicación: paréntesis alrededor del año

Sin embargo, parece que esto sólo funciona para biblatex sin estilo chicago. Usando el estilo chicago los paréntesis se agregan al final de la referencia sin contenido.

Aquí hay un 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 ampliado con artículo y solución de 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}

Respuesta1

biblatex-chicagoEl manejo de la fecha es muy complicado para asegurarse de que cumple con los estándares CMS, por lo que no es nada fácil cambiarlo. La siguiente parece ser la redefinición más corta y segura; sin embargo, en muy pocos casos podría conducir a resultados indeseables, pero todavía no me he encontrado con uno de esos 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 recortado

información relacionada