biblatex-chicago를 사용하여 연도를 괄호 안에 넣습니다.

biblatex-chicago를 사용하여 연도를 괄호 안에 넣습니다.

저는 biblatex-chicago 스타일을 사용하고 연도를 괄호 안에 넣고 싶습니다.

따라서 나는 이 게시물의 해결책을 따랐습니다. 연도 주위의 괄호

그러나 이것은 시카고 스타일이 아닌 biblatex에서만 작동하는 것 같습니다. 시카고 스타일을 사용하면 내용 없이 참조 끝에 괄호가 추가됩니다.

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}

Moewe의 기사 및 솔루션을 통해 MWE 확장:

\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}

답변1

biblatex-chicago의 날짜 처리는 CMS 표준을 준수하는지 확인하기가 매우 복잡하므로 이를 변경하는 것이 전혀 쉽지 않습니다. 다음은 가장 안전하고 가장 짧은 재정의인 것 같습니다. 극소수의 경우에 바람직하지 않은 결과가 발생할 수 있지만 아직 그러한 사례 중 하나를 접한 적이 없습니다.

\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

관련 정보