8

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}
3
  • Where did @Herbert's answer go!?
    – Seamus
    Commented Feb 18, 2011 at 13:42
  • @Seamus: Good question, he updated it and then deleted it before I read the update. @Herbert, if you're reading this: I'd also like to know what happened to your answer. (Well, why that happened, to be precise.) Commented Feb 18, 2011 at 13:44
  • it was nonsense
    – user2478
    Commented Feb 18, 2011 at 16:30

1 Answer 1

8

If you want to overwrite a set from one the mt-xxx.cfg files you should load this file first:

\documentclass{article}
\usepackage{microtype}
\LoadMicrotypeFile{cmr}
\SetProtrusion[name=cmr-it]    { }    {A= {1000,1000}}


\begin{document}
ABC\\
ABC\\
\itshape ABC
\\abc
\end{document}

Btw: The spaces around the "A" in the microtype warning indicates that at the begin of the document spaces are no longer ignored. The warning disappears if you remove the spaces in \SetProtrusion. (You will get other errors but as \AtBeginDocument is the wrong idea anyway I didn't investigate more.)

1
  • Great, thanks, \LoadMicrotypeFile{cmr} is the solution. But I don't quite understand your "Btw" about spaces: As I wrote in the question, with \SetProtrusion after \begin{document} it did work despite all the spaces. Or are those spaces only relevant with \AtBeginDocument? Commented Feb 19, 2011 at 10:36

You must log in to answer this question.

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