In this answer about full justification for italic text, I used microtype
's \SetProtrusion
to get better-looking margin kerning for italics. It works fine, but I had to call \SetProtrusion
after \begin{document}
, which is clearly not nice.
I tried it in the preamble: Then it compiles, but the new protrusion table isn't used. I tried it with \AtBeginDocument
, but this gave a very long error message, starting with
Package microtype Warning: Unknown slot number of character
(microtype) ` A '
(microtype) in font encoding `OT1'.
(microtype) Make sure it's a single character
(microtype) (or a number) in protrusion list
(microtype) `cmr-it'.
Thus my question: How do I call \SetProtrusion
in the preamble?
(Answers which use external files are appreciated, but I'd also like to know if it's possible without that.)
EDIT: Here's a minimal example (sorry for not providing that immediately).
\documentclass{article}
\usepackage{microtype}
\AtBeginDocument{%
\SetProtrusion
[ name = cmr-it ]
{ }
{ A = {50,50},
\textquoteleft = {700, } }}
\begin{document}
\it foo
\end{document}