4

I defined a new cite command to show shorttitle instead of author-yearcombination. The problem is that it swallows the punctuation mark following it.

I tried using \DeclareCitePunctuationPosition, but to no avail.

How can I fix this?

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

enter image description here

1 Answer 1

5

biblatex has a very sophisticated system to avoid undesirable double punctuation or punctuation clashes.

In particular biblatex will suppress any punctuation after a sentence-ending period (full stop). So '.;' becomes just '.'. The 'problem' is that you would not want to suppress a comma or semicolon after a dot signifying an abbreviation, so 's.v.;' is perfectly fine and need not be reduced to 's.v.'. Since the '.' has essentially two functions, you will have to help biblatex along and tell it what you mean when you type .. By default biblatex assumes a . is a period. If you want to enter an abbreviation dot you can say \adddot or just .\isdot.

Hence, the following displays 's.v.;' just fine.

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

DMLBS, s.v.; this cite command has swallowed my semicolon.


If all .s that end your postnotes are abbreviation dots, you can automate this by modifying the postnote field format (the original definition can be found in 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}}%

Then you can avoid having to write \isdot every time you use s.v. in a postnote. But of course that means that a . that is supposed to be a sentence-ending period at the end of the postnote will not be recognised as such.


If you are using s.v. very often you may want to define a handy command for it that avoids the need for \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}
3
  • Thanks for the detailed explanation. I think I'll use the \sv command. Why does it have to call a previously defined bibliography string?
    – NVaughan
    Commented Aug 17, 2020 at 15:19
  • 1
    @NVaughan It doesn't have to, but generally in biblatex it is preferable to use bibstrings over hard-coded text. (Bibstrings are easier to localise for other languages and generally play better with biblatex punctuation handling/tracking. Which probably isn't that important in this case, but becomes very relevant in other settings.)
    – moewe
    Commented Aug 17, 2020 at 19:39
  • Good to know, thanks!
    – NVaughan
    Commented Aug 17, 2020 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .