biblatex의 형식 제목 항목

biblatex의 형식 제목 항목

출판물 목록을 조판하려고 하는데 biblatex항목 제목을 문장 케이스(또는 대문자/소문자/제목 케이스)로 변경하고 싶습니다. 사용해 보았지만 \DeclareFieldFormat{title}{\MakeSentenceCase{#1}}작동하지 않는 것 같습니다.

MWE:

%\RequirePackage{filecontents}
\begin{filecontents}{pub.bib}
@article{article1,
    author={Author One and Author Two},
    title={Title of Article One},
    date= {2018},
    }
@article{article2,
    author={Author One and Author Two},
    title={Title of article two},
    date= {2017},
    }
\end{filecontents}
\documentclass{article}
\usepackage[
    backend=biber,
    sorting=ynt,
    giveninits=true,
    maxbibnames=99,
]{biblatex}
\DeclareFieldFormat*{title}{\MakeCapital{#1}}   % Change titles to sentence case
\addbibresource{pub.bib}
\begin{document}
\nocite{*}
\printbibliography[type=article, title={Publications}]
\end{document}

답변1

그런 용도로 사용해야 합니다 titlecase.

\DeclareFieldFormat*{titlecase}{\MakeSentenceCase{#1}}

전체 MWE:

%\RequirePackage{filecontents}
\begin{filecontents}{pub.bib}
@article{article1,
    author={Author One and Author Two},
    title={Title of Article One},
    date= {2018},
    }
@article{article2,
    author={Author One and Author Two},
    title={Title of article two},
    date= {2017},
    }
\end{filecontents}
\documentclass{article}
\usepackage[
    backend=biber,
    sorting=ynt,
    giveninits=true,
    maxbibnames=99,
]{biblatex}
\DeclareFieldFormat*{titlecase}{\MakeSentenceCase{#1}}   % Change titles to sentence case
\addbibresource{pub.bib}
\begin{document}
\nocite{*}
\printbibliography[type=article, title={Publications}]
\end{document}

여기에 이미지 설명을 입력하세요

업데이트titlecase: 아마도 왜 title사용되어야 하는지 에 대한 설명이 여기서 유용할 수 있습니다. 매크로 정의를 살펴보면 다음과 같은 내용을 찾을 수 있습니다 title.biblatex.def

\newbibmacro*{title}{%
  \ifboolexpr{
    test {\iffieldundef{title}}
    and
    test {\iffieldundef{subtitle}}
  }
    {}
    {\printtext[title]{%
       \printfield[titlecase]{title}%
       \setunit{\subtitlepunct}%
       \printfield[titlecase]{subtitle}}%
     \newunit}%
  \printfield{titleaddon}}

형식 지정 지시문은 인쇄 지침 [title]에 적용됩니다 . title + subtitle이는 일부 공통 항목 유형의 제목을 따옴표 사이에 설정하는 것, 즉 "제목"과 "부제목" 모두에 대해 한 쌍의 따옴표를 설정하는 것이 참고문헌 스타일의 공통 요구 사항이기 때문에 필요합니다. 형식 지정 지시어는 및 [titlecase]에 개별적으로 적용됩니다 . 결과적으로 형식 지정 지시문을 적용하려고 하면 고유 한 개별 형식 지정 지시문과 함께 일련의 s 및 구두점 지침을 제공하게 됩니다 . 당신이 알아차린 것처럼, 잘 동작하지 않는 것. 그러나 이것이 삭제된 문자열이더라도 원하지 않는 자막의 첫 글자가 소문자로 표시될 수 있습니다(두 문자를 함께 에 제공하게 됩니다 ). 즉, 간단히 말해서 처리할 수 있는 것과 별도로 처리할 수 있는 것이 정확히 존재하며 이는 모든 문장 대소문자 구분 지시문을 적용하는 데 적합한 범위가 될 것입니다.titlesubtitle\MakeSentenceCasetitle\printfield[titlecase]\MakeSentenceCasetitlecasetitlesubtitle

관련 정보