biblatex でケース保護を重視

biblatex でケース保護を重視

質問に続いて 書誌データベースにタイトルを保存するときに使用する適切な大文字と小文字は何ですか?私はタイトルを .bib ファイル内のタイトルケースで保存し、固有名詞などを {Protecting} していますbiblatex-chicago。シカゴではタイトルケースが必須であるため、これまでは問題が発生したことがありませんでした。

biblatex-apaしかし、今、引用符と強調で問題に遭遇しています。APA では文の大文字と小文字を区別することを推奨しています。\mkbibquote{}\mkbibemph{}はすでに内部の文の大文字と小文字を保護しているので、それらを追加の中括弧で囲むと、大文字と{\mkbibquote{}}小文字の区別がなくなります。しかし、その後、いくつかの問題が発生します。

次の MWE を検討してください。

% !TEX TS-program = xelatexmk
\documentclass{article} 

\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\usepackage{csquotes}
\usepackage[style=apa]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{bib.bib}

@book{Author2000,
    Title = {This is a Title with Something in {\mkbibquote{Quotes that Should Be Downcased}}},
    Author = {Author, Anton},
    Date = {1990},
}
@book{Author2000a,
    Title = {{\mkbibquote{But if the Title starts in Quotes}} It Turns into All Caps},
    Author = {Author, Anton},
    Date = {2000},
}
@book{Author2000b,
    Title = {A Discussion of the Book {\mkbibemph{{My} New Book}}: It Should Keep the First Word Capitalized},
    Author = {Author, Anton},
    Date = {2010},
}
@book{Author2000c,
    Title = {{\mkbibemph{And if the Title starts with Emphasis}} It also Turns into All Caps and Doesn't Apply the Emphasis},
    Author = {Author, Anton},
    Date = {2001},
}
@book{Author2000d,
    Title = {And If {\mkbibquote{an Acronym {{{AAEE}}} is Included}}, How to Preserve it?},
    Author = {Author, Anton},
    Date = {2011},
}

\end{filecontents}
\addbibresource{bib.bib}

\begin{document}
\autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
\printbibliography % print the bibliography 
\end{document}

出力は次のようになります:

ここに画像の説明を入力してください

問題はたくさんあります。mkbibquoteまたは が文字列の先頭で発行されると、文字列全体が大文字になります。 また、またはmkbibemphで囲まれた文字列内の特定の単語を保護する方法がわかりません。mkbibquotemkbibemph

答え1

の文の大文字小文字変換機能はbiblatex、LaTeX で実装されています。一方、BibTeX の文の大文字小文字変換は、BibTeX で直接実装されています。つまり、両者の間には微妙な違いとそれほど微妙ではない違いがあります。特に、biblatexの文の大文字小文字変換機能は、可能であればマクロを展開しようとします。

ここでの主な問題は、中括弧の意味が多すぎることです。LaTeX では、中括弧は引数の区切り文字として機能したり、グループ化を適用したりします。BibTeX では、文字列の大文字と小文字の変更を防ぎ、ä -> {\"a}(cf.参考文献に「ä」やその他のウムラウトやアクセント付き文字をどのように書くのですか?)。異なる意味が衝突することもあります。その場合は、問題を解決するために回避策が必要になります。

最近のhttps://github.com/plk/biblatex/issues/871リンクされた問題とドキュメントの追加https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334そしてhttps://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86

MWE で示されているユースケースについては、次の回避策を提案できます。アイデアは、区切りの引数 (一種の\foo <argument>\endfoo構文) を使用して中括弧の使用を回避することです。区切りの引数はネストされている場合に独自の問題が発生しますが、MWE では十分に機能します。

\documentclass{article} 
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa]{biblatex}

\protected\def\horriblemkbibquote#1\endhorriblemkbibquote{\mkbibquote{#1}}
\let\endhorriblemkbibquote\relax
\protected\def\horriblemkbibemph#1\endhorriblemkbibemph{\mkbibemph{#1}}
\let\endhorriblemkbibemph\relax

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Author2000,
  title  = {This is a Title with Something in {\mkbibquote{Quotes that Should Be Downcased}}},
  author = {Author, Anton},
  date   = {1990},
}
@book{Author2000a,
  title = {\horriblemkbibquote {But} if the Title starts in Quotes\endhorriblemkbibquote{} It Turns into All Caps},
  author = {Author, Anton},
  date = {2000},
}
@book{Author2000b,
  title = {A Discussion of the Book \horriblemkbibemph{My} New Book\endhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
  author = {Author, Anton},
  date = {2010},
}
@book{Author2000c,
  title = {\horriblemkbibemph {And} if the Title starts with Emphasis\endhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
  author = {Author, Anton},
  date = {2001},
}
@book{Author2000d,
  title = {And If \horriblemkbibquote an Acronym {AAEE} is Included\endhorriblemkbibquote{}, How to Preserve it?},
  author = {Author, Anton},
  date = {2011},
}

\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
\autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
\printbibliography % print the bibliography 
\end{document}

Author, A. (1990)。これは「小文字にすべき引用符で囲まれた部分」を含むタイトルです。//Author, A. (2000)。「しかし、タイトルが引用符で始まる場合」はすべて大文字になります。//Author, A. (2001)。タイトルが強調で始まる場合もすべて大文字になり、強調は適用されません。//Author, A. (2010)。私の新しい本に関する議論: 最初の単語は大文字にする必要があります。//Author, A. (2011)。「頭字語 AAEE が含まれている場合」、それをどのように保持しますか?

長期的には、保護された文字列を指定するために異なるマークアップを使用する新しい大文字と小文字を変更する関数を実装し、中括弧が衝突しないようにするのが望ましい解決策であるように思われます。

ちなみに、BibTeX の大文字と小文字の変更機能にも同様の問題があります。文字列の先頭の単語は大文字にならないため、ALL-CAPS の問題は発生しませんが、他の 2 つの保護内の保護解除の問題も発生します。

関連情報