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 43\MT@exp@one@n\MT@exp@two@c\MT@exp@two@n\MT@ifdefined@c@T\MT@ifdefined@c@TF\MT@ifdefined@n@T\MT@ifdefined@n@TF\MT@detokenize@n\MT@detokenize@c\MT@rem@last@space\MT@ifemptyExpand the second token once and enclose it in braces.381 382 \def\MT@exp@one@n#1#2{\expandafter#1\expandafter{#2}}Expand the next two tokens after 〈#1〉 once.383 \def\MT@exp@two@c#1{\expandafter\expandafter\expandafter#1\expandafter}384 Expand the next two tokens after 〈#1〉 once and enclose them in braces.385 \def\MT@exp@two@n#1#2#3{%386 \expandafter\expandafter\expandafter387 #1\expandafter\expandafter\expandafter388 {\expandafter#2\expandafter}\expandafter{#3}}You do not wonder why \MT@exp@one@c doesn’t exist, do you?Wrapper for testing whether command resp. \csname sequence is defined. If weare running e-TEX, we will use its primitives \ifdefined and \ifcsname, whichdecreases memory use substantially.389 \def\MT@ifdefined@c@T#1{%390 ^^X \ifdefined#1\expandafter\@firstofone\else\expandafter\@gobble\fi391 ^^Q \ifx#1\@undefined\expandafter\@gobble\else\expandafter\@firstofone\fi392 }393 394 \def\MT@ifdefined@c@TF#1{%395 ^^X \ifdefined#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi396 ^^Q \ifx#1\@undefined397 ^^Q \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi398 }399 \def\MT@ifdefined@n@T#1{%400 ^^X \ifcsname#1\endcsname\expandafter\@firstofone\else\expandafter\@gobble\fi401 ^^Q \begingroup\MT@exp@two@c\endgroup\ifx\csname #1\endcsname\relax402 ^^Q \expandafter\@gobble\else\expandafter\@firstofone\fi403 }404 \def\MT@ifdefined@n@TF#1{%405 ^^X \ifcsname#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi406 ^^Q \begingroup\MT@exp@two@c\endgroup\ifx\csname #1\endcsname\relax407 ^^Q \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi408 }409 Translate a macro into a token list. With e-TEX, we can use \detokenize. We alsoneed to remove the last trailing space; and only the last one – therefore the fiddling(and the \string isn’t perfect, of course).410 \def\MT@detokenize@n#1{%411 ^^X \expandafter\MT@rem@last@space\detokenize{#1} \@nil412 ^^Q \string#1%413 }414 \def\MT@detokenize@c#1{%415 ^^X \MT@exp@one@n\MT@detokenize@n#1%416 ^^Q \MT@exp@two@c\MT@rem@last@space\strip@prefix\meaning#1 \@nil417 }418 \def\MT@rem@last@space#1 #2{#1%419 \ifx\@nil#2\else \space420 \expandafter\MT@rem@last@space\expandafter#2\fi421 }Test whether argument is empty.422 423 \begingroup424 \catcode`\%=12425 \catcode`\&=14426 \gdef\MT@ifempty#1{&427 \if %#1%&

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

Saved successfully!

Ooh no, something went wrong!