pdfTeX and microtype: Protrusion influence on line-breaking breakpoints
0 reputation · 19 Dec 2021, 20:07 UTC
0 reputation · 19 Dec 2021, 20:07 UTC
The microtype package introduces character protrusion to improve the visual alignment of margins by extending specific glyphs beyond the edge of the text block. In pdfTeX, this feature is typically applied as a post-processing step after the paragraph builder has already determined the breakpoints.
Because the line-breaking algorithm relies on the original box dimensions, the perceived width changes only after the layout is finalized. This creates a discrepancy compared to engines like LuaTeX, where protrusion attributes can be integrated directly into the breaking process to optimize margin consistency.
When using pdfTeX (version 1.40+), it is unclear if there are configuration options to force the breaker to account for these protrusions during the initial calculation phase to prevent unexpected overfull boxes.
microtype settings be adjusted to influence the breaker's decision in pdfTeX, or is this behavior exclusive to LuaTeX?35275 reputation · 20 Dec 2021, 06:21 UTC
1. Does pdfTeX’s line‑breaking algorithm remain agnostic to protrusion settings during breakpoint selection?
Yes. In pdfTeX (1.40 and later) the paragraph builder calculates breakpoints solely from the original box dimensions. The protrusion data that microtype injects via \pdfprotrudechars and related primitives is applied only after the breaker has finished. Consequently, the breaker never “sees” the extended glyph widths, and overfull warnings are generated based on the unprotruded widths.
2. Can microtype settings be adjusted to influence the breaker in pdfTeX, or is this exclusive to LuaTeX?
Microtype offers no option that changes the internal width calculations used by the pdfTeX breaker. Adjusting \SetProtrusion or toggling \pdfprotrudechars merely changes the amount of protrusion applied after the fact. Therefore, influencing the breaker’s decisions is impossible in pdfTeX; this capability exists only in LuaTeX, where protrusion attributes are part of the node model and are considered during line breaking.
\documentclass{article}
\usepackage[protrusion=true]{microtype}
\begin{document}
This is a very long word that will normally cause an overfull box if the text is not
protruded beyond the margin.
\end{document}
pdflatex test.tex
Overfull \hbox warning. The warning will appear because the breaker used the unprotruded width.
lualatex test.tex
\pdfprotrudechars=0
\pdfprotrudechars=1
and recompile. The presence or absence of the flag does not affect the breakpoint log, only the visual output.
Does your workflow compile pdfTeX in PDF mode or DVI mode? Protrusion is ignored entirely in DVI mode, so the behaviour described above only applies when pdfTeX produces PDF output.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.