新しい引用コマンドは句読点を飲み込みます

Aug 17 2020

私は、新しいコマンドが表示するために引用する定義されたshorttitle代わりにauthor-year組み合わせ。問題は、それに続く句読点を飲み込むことです。

を使ってみまし\DeclareCitePunctuationPositionたが、役に立ちませんでした。

どうすればこれを修正できますか?

\documentclass{article}
\usepackage{biblatex-chicago}

\DeclareCiteCommand{\citeabbr}
{\usebibmacro{cite:init}%
  \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\textit{\printfield{shorttitle}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
  
\DeclareCitePunctuationPosition{\citeabbr}{r} % doesn't work

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
  title = {Dictionary of Medieval Latin from British Sources},
  shorttitle = {DMLBS},
  editor = {Howlett, D.R.},
  date = {1975/2013},
  publisher = {Oxford University Press},
  location = {Oxford},
  addendum = {DMLBS},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\usepackage{hyperref}    

\begin{document}
  \citeabbr[s.v.]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}

回答

5 moewe Aug 17 2020 at 12:08

biblatex は、望ましくない二重句読点や句読点の衝突を回避するための非常に洗練されたシステムを備えています。

特にbiblatex、文の終わりの期間(終止符)の後の句読点を抑制します。そう '。;' ただの「。」になります。「問題」は、省略形を示すドットの後のコンマまたはセミコロンを抑制したくないということです。したがって、「sv;」は完全に問題なく、「sv」に減らす必要はありません。'。'以降 には基本的に2つの機能があります。biblatex入力するときに、その意味を理解して伝える必要があります.。デフォルトでbiblatexは、a.はピリオドであると想定しています。省略形のドットを入力する場合は、\adddotまたは単に.\isdot。と言うことができます。

したがって、以下は「sv;」を表示します。大丈夫です。

\documentclass{article}
\usepackage{biblatex-chicago}

\DeclareCiteCommand{\citeabbr}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\printfield[emph]{shorttitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}


\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
  title = {Dictionary of Medieval Latin from British Sources},
  shorttitle = {DMLBS},
  editor = {Howlett, D.R.},
  date = {1975/2013},
  publisher = {Oxford University Press},
  location = {Oxford},
  addendum = {DMLBS},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{hyperref}

\begin{document}
  \citeabbr[s.v.\isdot]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}


.ポストノートを終了するすべてが省略形のドットである場合は、postnoteフィールド形式を変更することでこれを自動化できます(元の定義はにありますchicago-notes.cbx

\DeclareFieldFormat{postnote}{% Changed for page compression option
  \ifboolexpr{%
    togl {cms@comprange}%
    and
    test {\ifpages{#1}}%
  }%
  {\iffieldundef{pagination}%
    {\mkcomprange{#1}}%
    {\mkcomprange[{\mkpageprefix[pagination]}]{#1}}}%
  {\iffieldundef{pagination}%
    {#1}%
    {\mkpageprefix[pagination]{#1}}%
   \isdot}}%

そうすれば、ポストノートで\isdot使用するたびに書く必要がs.v.なくなります。しかしもちろん、.それは、追記の終わりに文の終わりのピリオドであるはずのaがそのように認識されないことを意味します。


s.v.頻繁に使用する場合は、の必要性を回避する便利なコマンドを定義することをお勧めします\isdot

\documentclass{article}
\usepackage{biblatex-chicago}

\DeclareCiteCommand{\citeabbr}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\printfield[emph]{shorttitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\NewBibliographyString{sv}
\DefineBibliographyStrings{english}{
  sv = {s\adddot v\adddot},
}
\newcommand*{\sv}{\bibstring{sv}}

\begin{filecontents}{\jobname.bib}
@book{Howlett1975,
  title = {Dictionary of Medieval Latin from British Sources},
  shorttitle = {DMLBS},
  editor = {Howlett, D.R.},
  date = {1975/2013},
  publisher = {Oxford University Press},
  location = {Oxford},
  addendum = {DMLBS},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\usepackage{hyperref}


\begin{document}
  \citeabbr[\sv]{Howlett1975}; this cite command has swallowed my semicolon.
\end{document}