10.07.2015 Views

The microtype package

The microtype package

The microtype package

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IMPLEMENTATION: Font setup 95\pickup@font\MT@pickupfont\do@subst@correction\add@accent\MT@orig@add@accent2700 \MessageBreak Patching it anyway. Some things may break%2701 2702 .\MessageBreak Double-check whether micro-typography is indeed%2703 \MessageBreak applied to the document.%2704 \MessageBreak (Hint: Turn on `verbose’ mode)%2705 2706 }%2707 \fi<strong>The</strong>n we append our stuff. Everything is done inside a group.2708 \g@addto@macro\pickup@font{\begingroup}%If the trace <strong>package</strong> is loaded, we turn off tracing of <strong>microtype</strong>’s setup, which isextremely noisy.2709 \MT@with@<strong>package</strong>@T{trace}{\g@addto@macro\pickup@font{\conditionally@traceoff}}%2710 \g@addto@macro\pickup@font{%2711 \escapechar\m@ne2712 2713 \global\MT@inannottrue2714 \MT@glet\MT@pdf@annot\@empty2715 \MT@addto@annot{(line \number\inputlineno)}%If \MT@font is empty, no substitution has taken place, hence \font@name is correct.Otherwise, if they are different, \font@name does not describe the font actuallyused. This test will catch first order substitutions, like bx to b, but it will still fail ifthe substituting font is itself substituted.2716 \MT@let@cn\MT@font{MT@subst@\expandafter\string\font@name}%2717 \ifx\MT@font\relax2718 \let\MT@font\font@name2719 \else2720 \ifx\MT@font\font@name \else2721 \MT@addto@annot{= substituted with \MT@@font}%2722 \MT@register@subst@font2723 \fi2724 \fi2725 \MT@setupfont2726 2727 \MT@tracking2728 \endgroup2729 }%2730 Remember the patched command for later.2731 \let\MT@pickupfont\pickup@fontAdditionally, we hook into \do@subst@correction, which is called if a substitutionhas taken place, to record the name of the ersatz font. Unfortunately, this will onlywork for one-level substitutions. We have to remember the substitute for the rest ofthe document, not just for the first time it is called, since we need it every time afont is letterspaced.2732 \g@addto@macro\do@subst@correction2733 {\edef\MT@font{\csname\curr@fontshape/\f@size\endcsname}%2734 \MT@glet@nc{MT@subst@\expandafter\string\font@name}\MT@font}%Inside \add@accent, we have to disable <strong>microtype</strong>’s setup, since the grouping inthe patched \pickup@font would break the accent if different fonts are used forthe base character and the accent. Fortunately, L A TEX takes care that the fonts usedfor the \accent are already set up, so that we cannot be overlooking them.2735 \let\MT@orig@add@accent\add@accent2736 \def\add@accent#1#2{%2737 \let\pickup@font\MT@orig@pickupfont

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!