7

I am using Biblatex and need to typeset full citations in my document text, so I'm using moewe's \longfullcite command. While it works correctly most of the time, it has trouble with Biber/BibTeX entries where the last word of a field is enclosed in braces (to force capitalization). In these cases, \longfullcite may fail to properly capitalize the following word. Take the following example:

\documentclass{article}

\usepackage{biblatex}
\makeatletter
\newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{\blx@maxbibnames}#1}
\makeatother
\DeclareCiteCommand{\longfullcite}[\tempmaxup]
  {\usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\usepackage{filecontents}

\begin{filecontents}{test.bib}
@inproceedings{blow2015,
  author       = {Blow, Joe},
  title        = {{GNU} loves me},
  year         = 2015,
  booktitle    = {Proceedings of Some Conference},
}

@inproceedings{blow2016,
  author       = {Blow, Joe},
  title        = {I love {GNU}},
  year         = 2016,
  booktitle    = {Proceedings of Some Conference},
}
\end{filecontents}

\addbibresource{test.bib}

\begin{document}
\nocite{*}
\noindent
\longfullcite{blow2015}\\
\longfullcite{blow2016}
\printbibliography
\end{document}

Here is the output:

output of the above document, showing that the first \longfullcite correctly capitalizes "In" but the second one does not

Note the inconsistent capitalization of the word "In" produced by the two \longfullcite commands. By contrast, the citations emitted by \printbibliography correctly capitalize "In" for both entries.

What is causing this inconsistency and how can I fix or work around it (preferably by changing the definition of \longfullcite rather than changing the .bib file)?

  • 1
    You get the same problem with the standard \fullcite. And you also get it if you write GNU at the end without braces. Capital letters have a different spacefactor and so can confuse the punctuation tracker. The correct input is imho title = {I love {GNU\@}} (with or without braces). But you could also make a bug report at the biblatex tracker github.com/plk/biblatex/issues. Perhaps the behaviour can be changed. – Ulrike Fischer Jan 27 '17 at 23:02
6

This is a known problem (https://github.com/plk/biblatex/issues/295) and affects all in-text citations, although it is probably only ever really visible with something \fullcite-like. Unfortunately, the chances for a proper solution are quite slim. biblatex's punctuation tracker heavily modifies existing spacefactors, but doing so in citations can have unwanted knock-on effects for text outside citations.

You would have to add an \@ after capital letters in the end of a title. But you can have that done automatically for you in the format, if you like

\DeclareFieldFormat{title}{\mkbibemph{#1\@}}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\mkbibquote{#1\isdot\@}}
\DeclareFieldFormat
  [suppbook,suppcollection,suppperiodical]
  {title}{#1\@}
2

Dirty hack:

Insert something invisible with no width. I am sure this can cause problems, I just don't know yet which problems :)

\documentclass{article}

\usepackage{biblatex}
\makeatletter
\newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{\blx@maxbibnames}#1}
\makeatother
\DeclareCiteCommand{\longfullcite}[\tempmaxup]
  {\usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\usepackage{filecontents}

\begin{filecontents}{test.bib}
@inproceedings{blow2015,
  author       = {Blow, Joe},
  title        = {{GNU} loves me},
  year         = 2015,
  booktitle    = {Proceedings of Some Conference},
}

@inproceedings{blow2016,
  author       = {Blow, Joe},
  title        = {I love {GNU}\mbox{}},
  year         = 2016,
  booktitle    = {Proceedings of Some Conference},
}
\end{filecontents}

\addbibresource{test.bib}

\begin{document}
\nocite{*}
\noindent
\longfullcite{blow2015}\\
\longfullcite{blow2016}
\printbibliography
\end{document}
  • a \strut might do as well as an empty \mbox. still a dirty hack. – barbara beeton Jan 27 '17 at 21:11
  • @barbarabeeton Thanks for your suggestion. However \strut seems not to work in this situation, the i is still lowercase. – user36296 Jan 27 '17 at 21:14
  • 1
    The problem with a workaround involving the BibTeX file is that such files aren't always changeable (sometimes they're read in from a shared, read-only filesystem; sometimes you're typesetting in batch from user-generated content). – Psychonaut Jan 27 '17 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.