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: Preliminaries 48\MT@while@num\MT@do@font\MT@count\MT@increment\MT@scale\MT@abbr@pr\MT@abbr@ex\MT@abbr@pr@c\MT@abbr@ex@c\MT@abbr@pr@inh\MT@abbr@ex@inh\MT@abbr@nl\MT@abbr@sp\MT@abbr@sp@c\MT@abbr@sp@inh649 \def\MT@iterate{#1\relax\expandafter\MT@iterate\fi}%650 \MT@iterate \let\MT@iterate\relax651 }652 \let\MT@repeat\fiExecute 〈#3〉 from 〈#1〉 up to (excluding) 〈#2〉 (much faster than L A TEX’s \@whilenum).653 \def\MT@while@num#1#2#3{%654 \@tempcnta#1\relax655 \MT@loop #3%656 \advance\@tempcnta \@ne657 \ifnum\@tempcnta < #2\MT@repeat658 }Execute 〈#1〉 256 times,659 660 661 \def\MT@do@font{\MT@while@num\z@662 \@cclviresp. 1114111 times for LuaTEX (this is going to be slow, but LuaTEX is slow anyway– still, there ought to be a better way!)663 \MT@max@slot664 }665 resp. for the whole font.666 667 \def\MT@do@font#1{%668 \@tempcnta=\z@669 \MT@loop #1%670 \advance\@tempcnta \@ne671 \ifnum\@tempcnta < \XeTeXcountglyphs\MT@font \MT@repeat672 }673 674 Increment macro 〈#1〉 by one. Saves using up too many counters. <strong>The</strong> e-TEX way isslightly faster.675 \newcount\MT@count676 \def\MT@increment#1{%677 ^^X \edef#1{\number\numexpr #1 + 1\relax}%678 ^^Q \MT@count=#1\relax679 ^^Q \advance\MT@count \@ne680 ^^Q \edef#1{\number\MT@count}%681 }Multiply and divide a counter. If we are using e-TEX, we will use its \numexprprimitive. This has the advantage that it is less likely to run into arithmetic overflow.<strong>The</strong> result of the division will be rounded instead of truncated. <strong>The</strong>refore, we’ll geta different (more accurate) result in about half of the cases.682 \def\MT@scale#1#2#3{%683 ^^Q \multiply #1 #2\relax684 \ifnum #3 = \z@685 ^^X #1=\numexpr #1 * #2\relax686 \else687 ^^X #1=\numexpr #1 * #2 / #3\relax688 ^^Q \divide #1 #3\relax689 \fi690 }Some abbreviations. Thus, we can have short command names but full-length logoutput.691 \def\MT@abbr@pr{protrusion}

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

Saved successfully!

Ooh no, something went wrong!