5

I like how the microtype package handles character protrusion when I compile my LaTeX documents with LuaLaTeX. But I have noticed that this doesn't seem to work properly in the bibliography that the biblatex package produces.

In the minimal working example below, I first show that character protrusion works for both opening and closing quotation marks outside of the bibliography. In the bibliography I have then constructed two references that both have their titles begin on the second line. Opening quotation marks as expected protrude into the left margin, but protrusion does not seem to work for the closing quotation marks. The only difference in the titles is how many i's that I have added to the word "into".

We can see that the title in the first reference is typeset with rather small interword spaces and no protrusion of the closing quotation mark and that when I in the second reference add the third extra "i" there is still no protrusion but the title is instead broken to two lines.

Where does this problem come from? And how should I go about in fixing it? (Or am I just misunderstanding something?)

Screenshot of MWE showing how closing quotation marks don't protrude into the right margin

\documentclass[american]{article}
\usepackage[
  style=authoryear,
  backend=biber,
  dashed=false,
]{biblatex}

\setlength{\bibhang}{0pt}

\usepackage{filecontents}
\begin{filecontents*}{mwe.bib}
  @article{andersson2011,
    title={An article title that ought to have a closing quotation mark that protrudes iiinto the margin},
    author={Anderson, A Lengthy List of First Names to Move the Article Title to the Next Line},
    journaltitle={Review of Utter Nonsense},
    date={2011},
    volume={5},
  }

  @article{andersson2021,
    title={An article title that ought to have a closing quotation mark that protrudes iiiinto the margin},
    date={2021},
    volume={40},
    crossref={andersson2011}
  }
\end{filecontents*}

\addbibresource{mwe.bib}

\usepackage[showframe, text={140mm, 230mm}]{geometry}
\usepackage{babel}
\usepackage[babel]{microtype}
\usepackage[babel]{csquotes}

\begin{document}
  \noindent ``We see that quotation marks protrude into the right margin when outside the bibliography.''

  \nocite{andersson2021,andersson2011}

  \printbibliography
\end{document}
9
  • 2
    Interesting. I would first look into whether the codes of the closing quotes in the output are the same or different. (I'm not able to do that, but this might give someone else a direction.) Commented Oct 20, 2021 at 14:09
  • 4
    If the american language option is activated in biblatex, some very heavy lifting is required to move punctuation inside quotation marks. The code that does this seems to 'hide' the quotation marks from microtype in a way that stop from having the quotation marks protrude into the margin. You can check that things work if no moving around is required if you choose english instead of american and set \renewcommand*{\newunitpunct}{\addspace} to avoid the punctuation altogether.
    – moewe
    Commented Oct 20, 2021 at 15:23
  • 3
    @moewe yes, one of csquotes's kern markers ends up in the output, followed by a zero kern, which prevents pdftex from seeing this as a margin. Usually, these kern markers would be \unkerned, so I would say this is a bug/flaw in either csquotes or biblatex.
    – Robert
    Commented Oct 20, 2021 at 15:56
  • @moewe -- Brilliant observation. I'm not a biblatex user, so I wasn't aware of that. There's nothing that will persuade me to follow the "american" style of punctuation placement. It can lead to terrible mistakes and call for should-be-unnecessary technical support when blindly applied to input instructions such as 'Type this: "xxx".' Been burned; won't go back. That should be an answer. Commented Oct 20, 2021 at 18:57
  • 1
    @moewe I agree... pretty complex! However, I do think that it's the interaction of the two packages that is at fault here, since csquotes is also able to move punctuation inside the quotation (with the string from my last comment (where the full stop is outside the argument) and the definition \renewcommand{\mktextquote}[6]{#1#2#4#5#3#6}), without suppressing margin kerning. Likewise, margin kerning will work if you remove csquotes from the OP's example. So the two packages' mechanisms to shuffle punctuation around must be somehow interfering with each other in a bad way.
    – Robert
    Commented Oct 22, 2021 at 0:09

0

You must log in to answer this question.

Browse other questions tagged .