24

While finishing an article for TUGboat I came across a strange behavior of the protrusion mechanism of pdfTeX (as implemented by the microtype package). The character \ in typewriter has a negative left margin protrusion, i.e., it normally sticks out by 1.57498pt into the left margin. However, if the same text is used within a quote environment of LaTeX, the protrusion on the first line vanishes as can be seen in the following example:

\documentclass{article}

\usepackage{microtype}
\microtypesetup{protrusion=true}

\begin{document}

\noindent
\verb=\foo= \\
\verb=\foo= \\
\smash{\rule{.4pt}{34pt}}aaaaaaaa

\begin{quote}
\verb=\foo= \\
\verb=\foo= \\
\smash{\rule{.4pt}{34pt}}aaaaaaaa
\end{quote}
\end{document}

As a result we get

enter image description here

Now the problem is clearly related to how pdfTeX implements protrusion and in Unexpected interaction between microtype and \parindent this is already discussed in relation to the intentation box.

In this case here there is no indentation box. Instead we do have a hidden "label" box added by the quote environment as that is really a trival form of list. Thus there is a hidden \item without any visible output (like a zero width indentation box).

So here are my question(s):

  • is my analysis correct (it basically only an assumption around midnight)
  • if so, should pdfTeX try harder to do protusion across "non-visible" material at line ends? I.e., would that be a pdfTeX bug at least an improvement topic?
  • or should/could this be fixed by code in LaTeX (or microtype) implementing such things differently?
3

1 Answer 1

17
  • Your analysis is correct.

  • A couple of years ago, the pdftex team has been discussing whether pdftex should indeed try harder. No clear conclusion transpired except that it would probably be too difficult to get it right in all cases, hence the issue was postponed for later consideration ... maybe too late for pdftex now, and to be passed on to luatex.

  • Without pdftex providing any suitable means it would be very hard for microtype to fix the situation; see this kludge. It would be easier to do (though still messy) with a command telling pdftex that it should regard the current point as the beginning/end of a line. There even is a patch providing such a command, which never seems to have made it into a release, however.

  • (Of course, implementing the quote environment as a list with an empty item (verbatim being another such case) may be considered a rather unfortunate choice by LaTeX2e, anyway – something that should be investigated for LaTeX3 IMHO.)

2
  • 6
    I agree the the way LaTeX "mis"uses the list environment is at least questionable. However, even in an itemize with a real label one could argue that protusion should happen. So the issue is more that (pdf)TeX doesn't support embellishing a paragraph with material that sticks out but requires that this material becomes part of the paragraph data. If that would be the case (plus a different implementation of lists in that case) it would solve the issue in a general fashion and - as I think - on the right level. Jan 16, 2013 at 7:53
  • @ Robert / @FrankMittelbach Do you know what happened to the patch? When I try to load the page, I eventually get just a blank page with no url or content at all.
    – cfr
    Aug 26, 2015 at 17:16

You must log in to answer this question.

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