%\iffalse meta-comment % ^^A messages to WinEdt: % !Mode:: "TeX:DTX:UK" % !smartQuote:: "English" % !DTXversion:: "2.3b" % ------------------------------------------------------------------------ % $Id: microtype.dtx,v 1.52 2008-06-16 18:16:29+02 schlicht Exp schlicht $ % ------------------------------------------------------------------------ % The `microtype' package % An interface to the micro-typographic extensions of pdfTeX % Copyright (c) 2004--2008 R Schlicht % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3c of this license or (at % your option) any later version. The latest version of this license is in: % http://www.latex-project.org/lppl.txt, and version 1.3c or later is part % of all distributions of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status `author-maintained'. % % This work consists of the files microtype.dtx and microtype.ins and the % derived files microtype.sty and letterspace.sty. % % Modified versions of the configuration files (*.cfg) may be distributed % provided that: (1) the original copyright statement is not removed, and % (2) the identification string is changed. % ------------------------------------------------------------------------ % %\NeedsTeXFormat{LaTeX2e} %<*driver> \ProvidesFile{microtype.dtx} % %\ProvidesPackage %\ProvidesFile % {microtype} % {letterspace} % {microtype.cfg} %<*package|letterspace|m-t> [2008/06/04 v2.3b % Micro-typography with pdfTeX (RS)% % Robust letterspacing (RS)% % microtype main configuration file (RS)% ] % %<*config> % {mt-bch.cfg}[2007/03/03 v1.5 microtype config. file: Bitstream Charter (RS)] % {mt-blg.cfg}[2007/07/14 v1.0 microtype config. file: Bitstream Letter Gothic (RS)] % {mt-cmr.cfg}[2008/02/29 v1.9a microtype config. file: Computer Modern Roman (RS)] % {mt-pad.cfg}[2005/11/07 v1.5 microtype config. file: Adobe Garamond (RS)] % {mt-pmn.cfg}[2004/11/07 v1.2 microtype config. file: Adobe Minion (HH)] % {mt-ppl.cfg}[2005/11/16 v1.6 microtype config. file: Palatino (RS)] % {mt-ptm.cfg}[2006/04/20 v1.7 microtype config. file: Times (RS)] % {mt-ugm.cfg}[2006/01/26 v1.0 microtype config. file: URW Garamond (RS)] % {mt-msa.cfg}[2006/02/04 v1.1 microtype config. file: AMS symbols (a) (RS)] % {mt-msb.cfg}[2005/06/01 v1.0 microtype config. file: AMS symbols (b) (RS)] % {mt-euf.cfg}[2006/07/03 v1.1 microtype config. file: AMS Euler Fraktur (RS)] % {mt-eur.cfg}[2006/07/31 v1.1 microtype config. file: AMS Euler Roman (RS)] % {mt-eus.cfg}[2006/07/28 v1.2 microtype config. file: AMS Euler Script (RS)] % {mt-zpeu.cfg}[2006/05/04 v1.0 microtype config. file: Adobe Euro (RS)] % {mt-euroitc.cfg}[2006/05/04 v1.0 microtype config. file: ITC Euro (RS)] % {mt-mvs.cfg}[2006/07/05 v1.1 microtype config. file: Marvosym Euro (RS)] % % %<*driver|docsty> %<*driver> \documentclass[10pt,a4paper]{ltxdoc} \makeatletter % % Let's abolish CM! We use Charter and Letter Gothic % (for the pre-built documentation on CTAN): % \usepackage[charter]{mathdesign} % \def\rmdefault{bch} % not scaled % \def\ttdefault{blg} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{textcomp} \GetFileInfo{microtype.dtx} \usepackage[expansion=false,kerning=true]{microtype}[\filedate] \usepackage{ifpdf} \DeclareMicrotypeSet*[protrusion] { doc } { encoding = {*, TS1, OMS}, family = {rm*, tt*}, size = {footnotesize, small, normalsize} } \SetProtrusion { encoding = OMS, family = mdbch } { "68 = {400, }, % \langle "69 = { ,400} }% \rangle \DeclareMicrotypeSet*[kerning] { doc } { encoding = T1, family = blg,% typewriter font and ... font = * } % French sample in section \ref{sub:kerning} \SetExtraKerning { encoding = T1, family = blg } { _ = {100,100} } % underscores shouldn't touch % disable ?` and !` ligatures (sample in section \ref{sec:disable-ligatures}) \DisableLigatures[?,!]{encoding = *, family = rm* } % Fraktur sample in section \ref{sec:lettersp} \IfFileExists{t1mwr.fd} {\newcommand\textfrak[1]{{\fontfamily{mwr}\selectfont ##1}} \ifpdf \SetTracking[no ligatures={f}]{encoding=T1,family=mwr}{100} \fi} {\IfFileExists{yfonts.sty} {\usepackage{yfonts} \ifpdf \SetTracking[no ligatures={f}]{encoding=LY,family=yfrak}{100} \fi} {\let\textfrak\@gobble}} \tolerance=700 \ifpdf \ifnum\pdftexversion<140 \else % pdftex 1.40, including textmatrix patch \microtypesetup{expansion=alltext,step=1} % hence we can activate expansion ... \tolerance=300 % ... and make TeX almost as intolerant as it normally is \g@addto@macro\macrocode{\pdfadjustspacing\z@} \fi % bonus material \InputIfFileExists{microtype-logo.dtx}\relax\relax \InputIfFileExists{microtype-lssample.dtx}\relax\relax \else \let\lsstyle\relax \fi \usepackage{booktabs} \usepackage{array} \newcolumntype{L}[1]{p{#1}<{\raggedright}} \usepackage{color} \definecolor{theblue} {rgb}{0.02,0.04,0.48} \definecolor{thered} {rgb}{0.65,0.04,0.07} \definecolor{thegreen}{rgb}{0.06,0.44,0.08} \definecolor{thegrey} {gray}{0.5} \definecolor{theshade}{gray}{0.94} \definecolor{theframe}{gray}{0.75} \usepackage{graphicx} % general layout \frenchspacing \expandafter\newif\csname ifcmr\endcsname \long\def\@tempa{cmr} \ifx\rmdefault\@tempa \cmrtrue \def\PackageFont{\sffamily} \def\match{\textbullet} \usepackage{amssymb} % \varnothing \linespread{1}\normalfont \setlength\textheight{47\baselineskip} \else \def\bfdefault{b} \def\Module#1{{\color{theblue}$\langle$\textit{#1}$\rangle$}} \DeclareRobustCommand\LaTeX{L\kern-.26em{\sbox\z@ T\vbox to\ht\z@{% \hbox{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont A}% \vss}}\kern-.1em\TeX} \def\PackageFont{\ttfamily} \def\match{{\large\raisebox{-.15em}{\textbullet}}} {\catcode`\`=\active % indiscernible from ' in Bitstream Letter Gothic \g@addto@macro\macro@code{\let`\textasciigrave}} \linespread{1.07}\normalfont \setlength\textheight{46\baselineskip} \fi \addtolength\textheight{\topskip} \setlength\topmargin{12pt} % sections \def\@seccntformat#1{\llap{\csname the#1\endcsname\hskip\marginparsep}} \def\paragraph{\@startsection{paragraph}{4}% {0pt}{8pt plus 2pt minus 1pt}{-1em}% {\normalfont\normalsize\itshape}} % title \def\@maketitle{% \newpage\null\vskip 2em \begin{center}\let\footnote\thanks {\LARGE \@title\par}\vskip 1.5em {\large \parbox{.33\textwidth}{\centering\@author}% \parbox{.33\textwidth}{\centering\@date}}% \vskip1.5em\rule{.66\textwidth}{.4pt}% \end{center}\par\vskip1.5em} % headers \headheight=15pt \def\ps@MTheadings{% \def\@oddhead{% \hbox to\textwidth{\vbox{\hbox to\textwidth{% \footnotesize{\leftmark\rightmark\strut}\hfill\thepage\strut}% \hrule height 0.4pt width\textwidth \vskip-0.4pt }}\hss} \let\@oddfoot\@empty \let\@mkboth\markboth \def\sectionmark##1{\markboth{\textls*[60]{\MakeUppercase{##1}}}{}} \def\subsectionmark##1{\markright{: ##1}}} \pagestyle{MTheadings} % toc \let\l@section@\l@section \def\l@section{\vskip -.75ex\l@section@} \def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.7em}} \def\l@subsubsection#1#2{% \leftskip 4.2em \rightskip 2em plus 1fil \parindent 0pt {\let\numberline\@gobble{\small[#1~-- #2]}}} \def\l@table{\@dottedtocline{1}{0pt}{1.5em}} \def\@pnumwidth{1.7em} \ifpdf \let\ORIGpdfoutline\pdfoutline \def\special@outlines{attr{/F 01}} \def\normaloutline {\protected@write\@outlinefile{}{\let\pdfoutline \ORIGpdfoutline}} \def\specialoutline{\protected@write\@outlinefile{}{\def\pdfoutline{\ORIGpdfoutline\special@outlines}}} \g@addto@macro\appendix{\specialoutline} \fi \def\defspecial@toc#1#2#3{\long\def#1{% \ifpdf\phantomsection\specialoutline\pdfbookmark[1]{#2}{#3}\normaloutline\fi \section*{#2}\@mkboth{\textls*[60]{\MakeUppercase{#2}}}{}% \@starttoc{#3}}} \defspecial@toc\tableofcontents\contentsname{toc} \defspecial@toc\listoftables\listtablename{lot} % bibliography \def\@cite#1#2{#1\if@tempswa, #2\fi} \def\thebibliography#1{% \section{\refname}% \list{}{\leftmargin 0pt}% \sloppy \clubpenalty 4000 \@clubpenalty \clubpenalty \widowpenalty 4000} \def\@biblabel#1{} % footnotes \long\def\@makefntext#1{% \leftskip 0pt \parindent 0pt \everypar{\parindent 0pt}% \leavevmode\hbox to 15pt{\@thefnmark\hss}#1} \skip\@mpfootins=4pt % lists \setlength\leftmargini{15pt} \setlength\leftmarginii{12.5pt} \setlength\leftmarginiii{10pt} \def\@listi{\leftmargin \leftmargini \parsep 4.5pt plus 1pt minus 1pt \topsep 4.5pt plus 1pt minus 1pt \itemsep 0pt} \let\@listI\@listi \def\descriptionlabel#1{\hspace\labelsep\normalfont#1:} \renewenvironment{itemize} {\ifnum \@itemdepth >\thr@@\@toodeep\else \advance\@itemdepth\@ne \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% \expandafter\list \csname\@itemitem\endcsname {\ifnum\@itemdepth=\@ne\leftmargin 0pt\fi \def\makelabel##1{\hss\llap{##1}}}% \fi} {\endlist} \newenvironment{enum}[1][0] {\list\labelenumi {\usecounter{enumi}\setcounter{enumi}{#1}\addtocounter{enumi}{-1}% \renewcommand\labelenumi{\texttt{\theenumi}:}% \leftmargin 30pt \itemindent-15pt \labelwidth 15pt \labelsep 0pt \def\makelabel##1{##1\hss}}} {\endlist} \newenvironment{options} {\list{} {\leftmargin 0pt \labelwidth 0pt \labelsep 1em \itemindent \labelsep \lstset{belowskip=0pt}}} {\endlist} % boxes (for some reason, mathdesign changes these values) \setlength\fboxrule{0.4pt} \setlength\fboxsep{3pt} \setlength\arrayrulewidth{0.4pt} % tables \setlength\tabcolsep{2pt} \long\def\@makecaption#1#2{% \sbox\@tempboxa{\footnotesize\itshape#1: #2}% \ifdim \wd\@tempboxa >\hsize \footnotesize\itshape#1: #2\par \else \hb@xt@\hsize{\box\@tempboxa\hfil}% \fi \vskip 4pt} % index and change log \IndexPrologue{\section{Index}% Links (in blue) refer to the page where the corresponding entry is described (bold face) resp. occurs. Plain numbers (in black) refer to the code line where the corresponding entry is defined (underlined) resp. used.} \GlossaryPrologue{\section{Change history}\label{sec:changes}\vspace*{-\multicolsep}} %\setcounter{finalcolumnbadness}{100} %\raggedcolumns \setcounter{IndexColumns}{2} \def\IndexMin{12\baselineskip} \g@addto@macro\IndexParms{\footnotesize} \def\GlossaryParms{\IndexParms \def\@idxitem ##1##2\efill{% \end{multicols} \begin{multicols}{2} [\subsubsection*{\if##1v\relax Version ##2 (\csname MTversiondate##2\endcsname)\else ##2\fi}][5\baselineskip] \ifpdf \phantomsection \pdfbookmark[2]{\if##1v\relax ##2 (\csname MTversiondate##2\endcsname)\else ##2\fi}{subsection##2}\fi \GlossaryParms \rightskip 15pt plus 5pt \let\item\@idxitem \ignorespaces \makeatletter \scan@allowedfalse}% \def\subitem{\par\hangindent 15pt}% \def\subsubitem{\subitem\hspace*{7.5pt}}} % macrocode \MacroTopsep=0pt \MacrocodeTopsep=3pt \setlength\MacroIndent{0pt} \ifpdf \def\theCodelineNo{\reset@font \pdfliteral direct{/Span<>BDC}% don't copy line numbers \color{thegrey}\scriptsize\arabic{CodelineNo}\,% \pdfliteral direct{EMC}} \else \def\theCodelineNo{\reset@font\color{thegrey}\scriptsize\arabic{CodelineNo}\,} \fi \def\MacroFont{\ttfamily\small} \def\AltMacroFont{\ttfamily\footnotesize} \def\PrintMacroName#1{\strut\MacroFont\string #1\hskip15pt} \def\ImplementationSettings{% \linespread{1}% \hfuzz=10pt \def\MacroFont{\ttfamily\footnotesize}% \def\macro@font{\ttfamily\footnotesize}% } % additional bells ... \def\Describe#1#2#3{\noindent\csname Describe#1\endcsname{#2}% \DescribeValues{#1}{#3}} \def\DescribeOption{\leavevmode\@bsphack \begingroup\MakePrivateLetters\Describe@Option} \def\Describe@Option#1{\endgroup \marginpar{\raggedleft\PrintDescribeOption{#1}}% \SpecialOptionIndex{#1}\@esphack\ignorespaces} \def\DescribePackage{\leavevmode\@bsphack \begingroup\MakePrivateLetters\Describe@Package} \def\Describe@Package#1{\endgroup \marginpar{\raggedleft\PrintDescribeOption{#1.sty}}% \CatIndex{#1}{package}\@esphack\ignorespaces} \def\DescribeValues#1#2{% \let\@tempa\@empty \let\Option@default\@empty \@for\@tempb:=#2\do{% \csname Special#1Value\expandafter\endcsname\@tempb\@nil \expandafter\g@addto@macro\expandafter\@tempa \expandafter{\csname #1Sep\endcsname}% \expandafter\g@addto@macro\expandafter\@tempa \expandafter{\@tempb}}% \@ifnextchar[\PrintValues{\PrintValues[\Option@default]}} \def\SpecialOptionValue#1#2\@nil{% \if#1:\def\@tempb{\Variable{#2}}\fi % : = variable \if#1!\def\@tempb{#2}\def\Option@default{#2}\fi}% ! = default \def\SpecialMacroValue#1#2\@nil{% \if#1?\def\@tempb{\normalsize[\Variable{#2}]}% % ? = optional \else\def\@tempb{\normalsize\{\Variable{#1#2}\}}\fi} \let\SpecialEnvValue\SpecialMacroValue \def\Variable#1{$\langle${\rmfamily\itshape\small#1}$\rangle$} \def\OptionSep{{\rmfamily, }} \def\MacroSep{\,} \def\EnvironmentSep{\,} \def\PrintValues[#1]{{\MacroFont\expandafter\@gobble\@tempa\hfill #1}\\*[.25\baselineskip]} \def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar hyperpage}} \def\SpecialOptionIndex#1{\@bsphack\CatIndex{#1}{option}% \index{\quotechar!Options % the `!' will be sorted first \actualchar{\protect\bfseries Options:}% \levelchar{\protect\ttfamily#1}\encapchar usage}\@esphack} \def\SpecialUsageIndex#1{\@bsphack{\index{\quotechar!User Commands \actualchar{\protect\indexspace\protect\bfseries User Commands:}% \levelchar\expandafter\@gobble\string#1\actualchar\string\verb \quotechar*\verbatimchar\string#1\verbatimchar\encapchar usage}% \let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}\@esphack} \def\SpecialEnvIndex#1{\CatIndex{#1}{environment}} \def\PrintDescribeMacro#1{\strut\MacroFont\color{thegreen}\string #1} \def\PrintDescribeEnv#1{\strut\MacroFont\bslash begin\{{\color{thegreen}#1}\}% \\*[.25\baselineskip]\strut\bslash end\{{\color{thegreen}#1}\}} \def\PrintDescribeOption#1{\strut\MacroFont\color{thered}#1} \def\Indexing{\let\special@index\codeline@wrindex} \def\NoIndexing{\let\special@index\@gobble} \def\GeneralChanges#1{\edef\generalname{\if*#1 General\else#1\fi}}% mind the space! \DeclareRobustCommand\key[1]{\textcolor{thered}{\ttfamily#1}} \DeclareRobustCommand\pkg[1]{{\PackageFont#1}\@bsphack\CatIndex{#1}{package}\@esphack} \DeclareRobustCommand\opt[1]{{\ttfamily#1}\@bsphack\CatIndex{#1}{option}\@esphack} \DeclareRobustCommand\file[1]{{\ttfamily#1}} % ... and whistles {\catcode`\"\active \gdef\verbatim#1 {\catcode`\"\active \def"##1"{\colorbox{theshade}{% \textrm{Text lost! Please install the \pkg{listings} package.}}}% \@beginparpenalty\predisplaypenalty\@verbatim\MacroFont \frenchspacing\@vobeyspaces\expandafter\@xverbatim\@gobble}} \IfFileExists{listings.sty}{ \usepackage{listings} \lstset{ gobble=1,columns=flexible,keepspaces,upquote,escapechar=", basicstyle=\MacroFont, keywords=[0]{\microtypesetup,\DeclareMicrotypeSet,\UseMicrotypeSet, \DeclareMicrotypeSetDefault,\SetProtrusion,\SetExpansion,\SetTracking, \SetExtraSpacing,\SetExtraKerning,\DisableLigatures,\DeclareCharacterInheritance, \DeclareMicrotypeVariants,\DeclareMicrotypeAlias,\DeclareMicrotypeBabelHook, \LoadMicrotypeFile,\microtypecontext,\textmicrotypecontext, \textls,\lsstyle,\lslig,\Microtype@Hook}, keywordstyle=[0]\color{thegreen}, keywords=[1]{protrusion,expansion,activate,DVIoutput,draft,final,verbose, config,factor,auto,stretch,shrink,step,selected,unit,tracking,spacing, kerning,letterspace,babel,context,%defersetup,copyfonts, % undocumented no ligatures,outer spacing,outer kerning}, % there are three \nobreakspace in this line keywordstyle=[1]\color{thered}, comment=[l]\%, commentstyle=\color{thegrey}\itshape, alsoother={0123456789_}, frame=single,backgroundcolor=\color{theshade},rulecolor=\color{theframe}, framerule=\fboxrule,xleftmargin=3.4pt,xrightmargin=3.4pt,belowskip=\smallskipamount } \let\verbatim\relax \lstnewenvironment{verbatim}[1][]{\lstset{##1}}{} \ifpdf \IfFileExists{dummy-space.pfb}{% \def\lst@outputspace{% copy spaces (from a font that really has a space at x20) \setbox0\hbox{ }\@tempdima\wd0 \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0 \unhbox0 \kern\@tempdima} \pdfmapline{+dummy-space }, pdfsubject={An interface to the micro-typographic extensions of pdfTeX}, pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, typography, micro-typography, character protrusion, margin kerning, optical alignment, font expansion, font scaling, hz, kerning, spacing, glue, letterspacing, tracking, ligatures} ]{hyperref} \pdfcatalog{/Lang(en-GB)} \ifnum\pdftexversion < 130 \else \IfFileExists{hypdestopt.sty}{\usepackage{hypdestopt}}\relax\fi \IfFileExists{hyperxmp.sty}{ \usepackage{hyperxmp} \hypersetup{% pdfcopyright={\textcopyright\ 2004--2008 R Schlicht\012% This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version.\&\#xA;% This work has the LPPL maintenance status `author-maintained'.}, pdflicenseurl={http://www.latex-project.org/lppl/}} }\relax \def\usage#1{\textbf{\hyperpage{#1}}}% for indexing of \DescribeMacro ... \def\changes@#1#2#3{% ... the changes ... \protected@edef\@tempa{\noexpand\glossary{#1\levelchar \ifx\saved@macroname\@empty \space\actualchar\generalname \else\expandafter\@gobble\saved@macroname\actualchar \string\verb\quotechar*\verbatimchar\saved@macroname\verbatimchar\fi :\levelchar #3\encapchar hyperpage}}% \@tempa\endgroup\@esphack} %\def\theCodelineNo{% % ... and everything else (would double the pdf file size) % \reset@font\color{thegrey}\scriptsize % \@tempcnta\arabic{CodelineNo}\advance\@tempcnta by\@ne % \hypertarget{L:\number\@tempcnta}{\arabic{CodelineNo}}} %\def\main#1{\underline{\hyperlink{L:#1}{#1}}} %\def\codeline#1{\link@sanitize#1-\@nil{#1}} %\def\link@sanitize#1-#2\@nil{\link@@sanitize#1,\@nil} %\def\link@@sanitize#1,#2\@nil{\hyperlink{L:#1}} %\def\SpecialIndex#1{\@bsphack\special@index{\expandafter\@gobble % \string#1\actualchar % \string\verb\quotechar*\verbatimchar\string#1\verbatimchar % \encapchar codeline}% % \@esphack} \def\ctanurl#1{Available from \acronym{CTAN} at \href{http://www.ctan.org/tex-archive/#1}{\nolinkurl{/#1}}} \DeclareRobustCommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}} \def\mailtoRS{\href % some PDF viewers don't like spaces: {mailto:\%20Robert\%20Schlicht?subject=[microtype\%20\fileversion]} {\texttt{w.m.l@gmx.net}}} % the samples on the first page, utilising nested optional content groups (aka. layers): \ifnum\pdftexversion<140 \else \def\mt@layer#1#2{\pdfliteral direct{/OC/#1 BDC}#2\pdfliteral direct{EMC}} \ifx\mt@objects\@undefined\let\mt@objects\@empty\fi \ifx\mt@order \@undefined\let\mt@order \@empty\fi \let\mt@resources\@empty \def\mt@register#1#2{% \immediate\pdfobj{<< /Type/OCG /Name(#1:#2) >>} \expandafter\xdef\csname mt@#1@#2\endcsname{\the\pdflastobj\space 0 R } \xdef\mt@objects {\mt@objects \csname mt@#1@#2\endcsname} \xdef\mt@order {\mt@order \csname mt@#1@#2\endcsname} \xdef\mt@resources{\mt@resources/#1#2 \csname mt@#1@#2\endcsname}} \xdef\mt@order{\mt@order[(Sample)} \mt@register{Protrusion}{true} \mt@register{Protrusion}{false} \mt@register{Expansion} {true} \mt@register{Expansion} {false} \mt@register{_compatibility}{} \xdef\mt@order{\mt@order]} \pdfcatalog{/OCProperties << /OCGs [\mt@objects] /D << /Order [\mt@order] /BaseState/OFF /ON [\mt@Protrusion@false \mt@Expansion@false \ifx\mtl@objects\@undefined\else\mtl@objects\fi] >> >> } \newbox\mt@box \newdimen\mt@unvdimen \def\mt@place#1{% \vskip-\mt@unvdimen \setbox\mt@box\vbox{#1}% \mt@unvdimen\dimexpr\ht\mt@box+\dp\mt@box\relax \unvbox\mt@box} \def\mt@pseudo@marg#1{% \mt@place{\llap{\vbox{% \hsize\marginparwidth \rightskip \marginparsep plus 1em \leavevmode\itshape\footnotesize #1}}}} \def\mt@show@sample#1#2{% \mt@layer{Protrusion#1}{% \mt@layer{Expansion#2}{% \mt@place{\microtypesetup{protrusion=#1,expansion=#2}% \mt@sample@text}}}} \def\mt@toggle@sample#1{% \pdfstartlink user{/Subtype/Link /BS << /Type/Border/W 1 /S/D /D[4 1] >> /H/O /C[0.65 0.04 0.07] /Contents(Click to Toggle #1!) %/OC << /Type/OCMD /VE[/Not \csname mt@_compatibility@\endcsname] >> % not honoured by older viewers anyway /A << /S/SetOCGState /State[/Toggle \csname mt@#1@true\endcsname \csname mt@#1@false\endcsname] >>} #1 \hfill\pdfendlink & \mt@layer{#1true}{\rlap{on}}\mt@layer{#1false}{off}} \renewcommand\microtypesample[1]{% \begingroup \leftskip 15pt \rightskip 15pt \parskip 4pt \parindent 0pt \vskip 8pt % = \topsep without vertical stretchability \long\def\mt@sample@text{#1} \mt@pseudo@marg{\color{theblue}% After you have read the text on the right, you can view the effect of the features it describes by clicking on the links:\strut\\ \colorbox{theshade}{% \begin{tabular}{@{}>{\upshape}l@{\quad}l} \mt@toggle@sample{Protrusion}\\\addlinespace \mt@toggle@sample{Expansion} \end{tabular}}\\[0.3\baselineskip] Both features are enabled throughout this document.} \mt@show@sample{false}{false} \mt@show@sample{false}{true} \mt@show@sample{true} {false} \mt@layer{_compatibility}{% % for compatibility with older PDF viewers that don't support OCGs, we % add a layer that contains a white box, which will hide the underlying % layers for older viewers, and will be ignored by PDF 1.5 capable viewers. \mt@place{\rlap{\hskip-\marginparwidth \color{white}% \vrule width\dimexpr\hsize+\marginparwidth\relax height\mt@unvdimen}} \mt@pseudo@marg{\color{thered}% If you had a \acronym{PDF} viewer that understands \acronym{PDF}\,{\smaller1.5}, you could view the effect of the micro-typographic features by clicking on the links.\strut \\\vphantom{\colorbox{white}{\tabular l\\\addlinespace\\\endtabular}}% \\[0.3\baselineskip] Both features are enabled throughout this document.}} \mt@show@sample{true}{true} \vskip 4pt \endgroup \edef\x{\pdfpageresources{/Properties <<\mt@resources>>}}\x} \def\emptypdfpageresources{\pdfpageresources{}} \fi \else \usepackage{url} \newcommand\hyperref[2][]{#2} \let\hyperpage\@firstofone \let\texorpdfstring\@firstoftwo \def\ctanurl{Available from \acronym{CTAN} at \url} \let\nolinkurl\url \let\mailto\texttt \def\mailtoRS{\mailto{w.m.l@gmx.net}} \fi \ifx\l@ukenglish\@undefined \hyphenation{let-ter-spac-ing let-ter-spaced let-ter-space} \else \language=\l@ukenglish \fi \hyphenation{Ha-rald Har-ders Ber-nard Ku-char-czyk Jac-kow-ski Ste-phan with-out} % abbreviations \DeclareRobustCommand\thanh{H\`an Th\^e% \ifx\eTeXversion\undefined \llap{\raisebox{0.5ex}{\'{}}} \else \llap{\raisebox{0.45ex}{\'{}\kern\dimexpr.05em-2\fontdimen1\font\relax}} \fi Th\`anh} \def\pdftex{\texorpdfstring{pdf\kern.05em\TeX}{pdfTeX}} \def\luatex{\texorpdfstring{Lua\kern-.05em\TeX}{LuaTeX}} \def\etex{\mbox{e-\TeX}} \def\nonetex{\mbox{\rlap{\kern.05em/}e-\TeX}} % aka. \TeX \def\microtype{{\PackageFont microtype}} \def\letterspace{\pkg{letterspace}} \def\fontdim{\cmd\fontdimen\,} \def\eg{e.\,g.} \def\ie{i.\,e.} \DeclareRobustCommand\smaller{\setbox\z@\hbox{\@tempcnta=\f@size \edef\x{\@tempcnta=\the\@tempcnta}\expandafter}\x \advance\@tempcnta-7 \ifcase\@tempcnta\tiny\or\scriptsize\or \footnotesize\or\small\or\or\normalsize\or\or\large\or\or\or\Large\fi} \DeclareRobustCommand\acronym[1]{% \texorpdfstring{{\smaller\textls[60]{#1}}}{#1}} \let\less=< {\catcode`\<=\active \AtBeginDocument{\catcode`\<=\active \def<#1>{\acronym{#1}} \def\contributor#1 <#2\at#3>{\@contributor{#1}{#2@#3}} \DeclareRobustCommand\@contributor[2]{\textit{#1}} %\DeclareRobustCommand\@contributor[2]{\href{mailto:#2}{\textit{#1}}} }} %<*driver> \CodelineIndex \EnableCrossrefs \RecordChanges %\OnlyDescription \begin{document} \DocInput{microtype.dtx} \end{document} % % % \fi % % ^^A ------------------------------------------------------------------------- %\GeneralChanges* %\changes{v1.0}{2004/09/11}{Initial version} %\changes{v2.0}{2006/12/29}{new package \letterspace: a stripped-down version, % containing the letterspacing commands only} %\GeneralChanges{Documentation} %\changes{v1.9b}{2006/01/13}{activate expansion in the distributed } %\changes{v2.2}{2007/04/01}{logo transparency and amusement} % ^^A Adobe Reader 8 had serious bugs with transparency. Fixed in 8.1. % % \GetFileInfo{microtype.dtx} % \title{\ifx\printlogo\undefined\else\printlogo\fi % \textls{The \microtype\ package}\\[.3\baselineskip]\large % An interface to the micro-typographic extensions of \pdftex} % \author{R Schlicht\\\mailtoRS} % \date{\fileversion\\\filedate} % % \maketitle \thispagestyle{empty} % %\begin{abstract} %\noindent % The \microtype\ package provides a \LaTeX\ interface to the micro-typographic % extensions of \pdftex: most prominently, character protrusion and font % expansion, furthermore the adjustment of interword spacing and additional % kerning, as well as hyphenatable letterspacing (tracking) and the possibility % to disable all or selected ligatures. % It allows to apply these features to customisable sets of fonts, and to % configure all micro-typographic aspects of the fonts in a straight-forward % and flexible way. Settings for various fonts are provided.\footnote{ % Currently, this package provides protrusion settings for Computer Modern % Roman, Palatino, Times, Garamond, Adobe Garamond and Minion, % Bitstream Charter and Letter Gothic, the symbols and Euler fonts, for % various Euro symbol fonts, as well as some generic settings for unknown % fonts (cf.~table~\ref{tab:fonts} on page~\pageref{tab:fonts}). % Contributions are very welcome.} % % Note that font expansion and character protrusion will only work with % \pdftex, at least version 0.14f. Automatic font expansion requires version % 1.20 or newer. Disabling ligatures requires \pdftex\ 1.30, letterspacing and % the adjustment of interword spacing and of kerning requires version 1.40. The % package will by default enable protrusion and expansion if they can safely be % assumed to work. % % The alternative package \letterspace, which also works with plain \TeX, % provides the user commands for letterspacing only, omitting support for all % other extensions (see section~\ref{sec:lettersp}). % %\bigskip\noindent % This package is copyright \textcopyright\ 2004\kern.08em--2008 R Schlicht. % It may be distributed and/or modified under the conditions of the % \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{http://www.latex-project.org/lppl/}} % {\LaTeX\ Project Public License}, % either version~1.3c of this license or (at your option) any later version. % This work has the maintenance status `author-maintained'. %\end{abstract} % % %\newpage %\emptypdfpageresources ^^A layers of the logo %\tableofcontents %\listoftables % % %\newpage %\section{Micro-typography with \pdftex}\label{sec:micro-type} % % \pdftex, the \TeX\ extension written by \thanh, introduces a number of % micro-typographic features that make it the tool of choice not only for the % creation of electronic documents but also of works of outstanding % time-honoured typography: most prominently, \textit{character protrusion} % (also known as margin kerning) and \textit{font expansion}. Quoting \thanh's % thesis: % %\changes{v1.9b}{2006/01/13}{add samples of micro-typographic features} %\microtypesample{\small % `Margin kerning is the adjustments of the characters at the margins of a % typeset text. A simplified employment of margin kerning is hanging % punctuation. Margin kerning is needed for optical alignment of the margins % of a typeset text, because mechanical justification of the margins makes % them look rather ragged. Some characters can make a line appear shorter to % the human eye than others. Shifting such characters by an appropriate % amount into the margins would greatly improve the appearance of a typeset % text. % % Composing with font expansion is the method to use a wider or narrower % variant of a font to make interword spacing more even. A font in a loose % line can be substituted by a wider variant so the interword spaces are % stretched by a smaller amount. Similarly, a font in a tight line can be % replaced by a narrower variant to reduce the amount that the interword % spaces are shrunk by. There is certainly a potential danger of font % distortion when using such manipulations, thus they must be used with % extreme care. The potentiality to adjust a line width by font expansion can % be taken into consideration while a paragraph is being broken into lines, % in order to choose better breakpoints.' [\cite[p.~323]{ThanhThesis}]} % % Both these features have been lacking a simple \LaTeX\ user interface for % quite some time. Then, the \cite{pdfcprot} package was released, which % allowed \LaTeX\ users to employ character protrusion without having to mess % much with the internals. % % Font expansion, however, was still most difficult to utilise, since it % required that the font metrics are available for all levels of expansion. % Therefore, anybody who wanted to make use of this feature had to create % multiple instances of the fonts in advance. Shell scripts to partly relieve % the user from this burden were available~-- however, it remained a cumbersome % task. Furthermore, all fonts were still being physically created, thus % wasting compilation time and disk space. % % In the summer of 2004, \thanh\ implemented a feature that has proven as a % major facilitation for \TeX\ and \LaTeX\ users: font expansion can now take % place automatically. That is, \pdftex\ no longer needs the expanded font % metrics but will calculate them at run-time and completely in memory. % %\bigskip\noindent % After this great leap in usability had been taken, the development did not % stop. On the contrary, \pdftex\ was extended with even more features: version % 1.30 introduced the possibility to \emph{disable all ligatures}, version 1.40 % a robust \emph{letterspacing} command, the \emph{adjustment of interword % spacing} and the possibility to specify \emph{additional character kerning}. % % Robust and hyphenatable \emph{letterspacing} (tracking) has always been % extremely difficult to achieve in \TeX. Although the \cite{soul} package % undertook great efforts in making this possible, it could still fail in % certain circumstances; even to adjust the tracking of a font throughout the % document remained impossible. Employing \pdftex's new extension, this no % longer poses a problem. The \microtype\ package provides the possibility % to change the tracking of customisable sets of fonts, \eg, all small % capitals. It also introduces two new commands \cs{textls} and \cs{lsstyle} % for ad-hoc letterspacing, which can be used like the normal text commands. % Note that letterspacing only works in mode. % % \emph{Adjustment of interword spacing} is based upon the idea that in order % to achieve a uniform greyness of the text, the space between words should % also depend on the surrounding characters. For example, if a word ends with % an `r', the following space should be a tiny bit smaller than that following, % say, an `m'. You can think of this concept as an extension to \TeX's `space % factors'. However, while space factors will influence all three parameters of % interword space (or glue) by the same amount~-- the kerning, the maximum % amount that the space may be stretched and the maximum amount that it may be % shrunk~-- \pdftex\ provides the possibility to modify these parameters % independently from one another. Furthermore, the values may be set % differently for each font. And, probably most importantly, the parameters may % not only be increased but also decreased. This feature may enhance the % appearance of paragraphs even more. % Emphasis in the last sentence is on the word `may': this extension is still % highly experimental -- in particular, only ending characters will currently % have an influence on the interword space. Also, the settings that are shipped % with \microtype\ are but a first approximation, and I would welcome % corrections and improvements very much. I suggest reading the reasoning % behind the settings in section~\ref{sub:conf-spacing}. % % Setting \emph{additional kerning} for characters of a font is especially % useful for languages whose typographical tradition requires certain % characters to be separated by a space. For example, it is customary in French % typography to add a small space before question mark, exclamation mark and % semi-colon, and a bigger space before the colon and the guillemets. Until % now, this could only be achieved by making these characters active (for % example by the \pkg{babel} package), which may not always be a robust % solution. In contrast to the standard kerning that is built into the fonts % (which will of course apply as usual), this additional kerning is based on % single characters, not on character pairs. % % The possibility, finally, to \emph{disable all ligatures} of a font may be % useful for typewriter fonts. % %\emptypdfpageresources ^^A layers of the sample %\bigskip\noindent % The \microtype\ package provides an interface to all these micro-typographic % extensions. All micro-typographic aspects may be customised to your taste and % needs in a straight-forward manner. The next chapters will present a survey % of all options and customisation possibilities. % % %\section{Getting started} % % There is nothing surprising in loading this package: %\begin{verbatim}[morekeywords={[1]{microtype}}] %\usepackage{microtype} %\end{verbatim} % This will be sufficient in most cases, and if you are not interested in % fine-tuning the micro-typographic appearance of your document (which would % seem unlikely, since using this package is proof of your interest in % typographic issues), you may actually skip the rest of this document. %^^A % If this, on the other hand, does not satisfy you -- be it for theoretical or % practical reasons -- this manual will guide you on the path to the desired % results along the following milestones: % %\changes{v2.2}{2007/06/06}{add overview} %\begin{itemize} % \item Enable the respective micro-typographic feature, either via the % respective package option or with the \cs{microtypesetup} command % (section~\ref{sec:options}). % \item Select the fonts to which this feature should be applied by declaring % and activating `sets of fonts'. Some sets are predefined, which may be % activated directly in the package options % (section~\ref{sec:font-sets}). % \item Fine-tune the micro-typographic settings of the fonts or sets of fonts % (section~\ref{sec:fine-tuning}). % \item If you're of the kind who always wants to march on, you'll certainly % be interested in the possibility of context-sensitive setup % (section~\ref{sec:context}). % \item You are even countenanced to leave the path of typographic virtue and % steal some sheep (section~\ref{sec:lettersp}) or trespass in other ways % (section~\ref{sec:disable-ligatures}). % \item Should you encounter any obstacles, follow the hints and caveats % (section~\ref{sec:caveats}). %\end{itemize} % % %\section{Options}\label{sec:options} % % Like many other \LaTeX\ packages, the \microtype\ package accepts options in % the well known |key=value| syntax. In the following, you'll find a % description of all \key{keys} and their possible |values| % (`|true|' may be omitted; multiple values, where allowed, must be enclosed in % braces; the default value is shown on the right, preceded by an asterisk % if it is contingent on the \pdftex\ version and/or the output mode). % % %\subsection{Enabling the micro-typographic features}\label{sub:options-microtype} % %\Describe{Option}{protrusion} % {true,false,compatibility,nocompatibility,:font set name}[*\,true] %\DescribeOption{expansion} % These are the main options to control the level of micro-typographic % refinement which the fonts in your document should gain. By default, the % package is moderately greedy: character protrusion will be enabled, font % expansion will only be disabled in circumstances where \pdftex\ cannot expand % the fonts automatically, that is, if it is either too old (versions before % 1.20) or if the output mode is (see section~\ref{sub:options-misc}). % In other words, \microtype\ will try to apply as much micro-typography as % can safely be expected to work under the respective conditions (and it is % usually not necessary to load the package with different options for % resp. mode). % % Protrusion and expansion may be enabled or disabled independently from each % other by setting the respective key to |true| resp. |false|. The % \opt{activate} option %\DescribeOption{activate} % is a shortcut for setting both options at the same time. Therefore, the % following lines all have the same effect (when creating files with a % recent version of \pdftex): %\begin{verbatim} %\usepackage[protrusion=true,expansion]{microtype} %\end{verbatim} %\begin{verbatim} %\usepackage[activate={true,nocompatibility}]{microtype} %\end{verbatim} %\begin{verbatim} %\usepackage{microtype} %\end{verbatim} %\smallskip % When \pdftex\ employs font expansion and character protrusion, line breaks % (and consequently, page breaks) may turn out differently. If this is not % desired -- because you are re-typesetting a book whose pagination must not % change -- you may pass the value |compatibility| to the \opt{protrusion} % and/or \opt{expansion} options. Typographically, however, the results will be % suboptimal, hence the default value is |nocompatibility|. % % Finally, you may also specify the name of a font set to which character % protrusion and/or font expansion should be restricted. See % section~\ref{sec:font-sets} for a detailed discussion. Specifying a font set % for a feature implicitly activates this feature. % %\medskip %\Describe{Option}{tracking}{true,!false,:font set name} %\DescribeOption{spacing} %\DescribeOption{kerning} % There is no compatibility level for the new extensions of tracking, interword % spacing, and additional kerning. Therefore, they can only be switched on or % off, or they may be activated by passing a set name to the option. By % default, neither feature is enabled. % %\begin{table}\small %\changes{v2.3a}{2008/02/25}{add table of available and enabled features} %\caption{Availability of micro-typographic features}\label{tab:available-features} %\catcode`\!=13 \def!{\textcolor{thered}{$\ \varnothing$}} %\catcode`\?=13 \def?{\textcolor{theblue}{$\ \boxtimes$}} %\catcode`\Q=13 \defQ{\textcolor{thegreen}{$\ \!\bigstar$}} %\setlength\fboxsep{4pt} %\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax %\fcolorbox{theframe}{white}{^^A %\begin{minipage}{\textwidth} %\def\arraystretch{1.2} %\begin{tabular}{*2{@{}L{48pt}}*3{@{}L{44pt}}*3{@{}L{42pt}}@{}} % \footnotesize \pdftex % && \multicolumn{6}{@{}l}{\footnotesize Micro-typographic features}\\ %\cmidrule(r){1-2} %\cmidrule{3-8} % \footnotesize version % & \footnotesize output % & \footnotesize Protrusion % & \footnotesize Expansion % & \footnotesize (= auto) % & \footnotesize Kerning % & \footnotesize Spacing % & \footnotesize Tracking\\ %\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3}\cmidrule(r){4-4} %\cmidrule(r){5-5}\cmidrule(r){6-6}\cmidrule(r){7-7}\cmidrule{8-8} % $\less$ 0.14f & / & ! & ! & ! & ! & ! & !\\ % $\geq$ 0.14f & / & Q & ? & ! & ! & ! & !\\ % $\geq$ 1.20 & & Q & ? & ! & ! & ! & !\\ % & & Q & Q & Q & ! & ! & !\\ % $\geq$ 1.40 & & Q & ? & ! & ? & ? & !\\ % & & Q & Q & Q & ? & ? & ?\,\textsuperscript{\itshape a}\\ %^^A we will have to re-model kerning, spacing and tracking with \luatex: %^^A \luatex\ & & Q & ? & ! & ! & ! & !\\ %^^A & & Q & Q & Q & ! & ! & !\\ %\bottomrule %\end{tabular}^^A %\vskip4pt\footnotesize % Q = enabled\quad % ? = not enabled\quad % ! = not available %\hfill % \textit{a}\quad 1.40.4 recommended %\vskip3pt %\end{minipage}^^A %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox %\end{table} % %\medskip\noindent % In table~\ref{tab:available-features}, you find an overview of which % micro-typographic features are available and enabled by default for the % relevant \pdftex\ versions and output modes. % %\medskip\noindent % Whether ligatures should be disabled cannot be controlled via a package option % but by using the \cs{DisableLigatures} command, which is explained in % section~\ref{sec:disable-ligatures}. % % %\subsection{Character protrusion}\label{sub:options-protrusion} % %\Describe{Option}{factor}{:integer}[1000] % Using this option, you can globally increase or decrease the amount by which % the characters will be protruded. While a value of 1000 means that the full % protrusion as specified in the configuration (see section~\ref{sub:protrusion}) % will be used, a value of 500 would result in halving all protrusion factors of % the configuration. This might be useful if you are generally satisfied with % the settings but prefer the margin kerning to be less or more visible % (\eg, if you are so proud of being able to use this feature that you want % everybody to see it, or -- to mention a motivation more in compliance with % typographical correctness -- if you are using a large font that calls for % more modest protrusion). % %\ifcmr\else\pagebreak\fi ^^A layout %\medskip %\Describe{Option}{unit}{!character,:dimension} % This option is described in section~\ref{sub:protrusion}, apropos the command % \cs{SetProtrusion}. Use with care. % % %\subsection{Font expansion}\label{sub:options-expansion} % %\Describe{Option}{auto}{true,false}[*\,true] % As noted in chapter~\ref{sec:micro-type}, the expanded versions of the fonts % may be calculated automatically. This option is true by default provided that % \pdftex's version is found to be 1.20 or higher and the output mode is ; % otherwise, it will be disabled. % If \opt{auto} is set to false, the fonts for all expansion steps must exist % (with files called \meta{font~name}\texttt{\textpm}\meta{expansion value}, % \eg, \file{cmr12+10}, as described in the \cite{pdftexman}). %\iffalse ^^A no longer true (1.40?) % If expanded instances of the fonts are available, they will be used % regardless whether \opt{auto} is true or not. %\fi % %\changes{v1.9}{2005/08/27}{add remark about Type\,1 fonts required for % automatic font expansion} % Automatic font expansion does not work with bitmap fonts. Therefore, if you % are using the Computer Modern Roman fonts in encoding\footnote{ % En passant, it may be noted that Type\,1 format and encoding are in % no other way related than that both start with a `T' and end with a `1'.}, % you should either install the \pkg{cm-super} fonts or use the Latin Modern % fonts (package \pkg{lmodern}). % %\medskip %\Describe{Option}{stretch}{:integer}[20] %\DescribeOption{shrink} % You may specify the stretchability and shrinkability of a font, \ie, the % maximum amount that a font may be stretched or shrunk. The numbers will be % divided by 1000, so that a stretch limit of 10 means that the font may be % expanded by up to~1\%. % The default stretch limit is 20. The shrink limit will by default be the % same as the stretch limit. % %\medskip %\Describe{Option}{step}{:integer}[\textrm{min(\opt{stretch},\opt{shrink})/5}] % Font expansion will be applied in discrete steps. For example, if \opt{step} % is set to~4 (which it is by default), \pdftex\ will try up to eleven different % expansion levels of a font (from \textminus20 to +20). If you set % \opt{stretch} or \opt{shrink} to something other than their default values % but do not specify \opt{step}, it will be set to 1/5th of the smaller value % of the two. % Therefore, the following lines are all equivalent: %\begin{verbatim} %\usepackage[stretch=20,shrink=20]{microtype} %\end{verbatim} %\begin{verbatim} %\usepackage[stretch=20,step=4]{microtype} %\end{verbatim} %\begin{verbatim} %\usepackage{microtype} %\end{verbatim} % %\medskip %\Describe{Option}{selected}{true,!false} % When applying font expansion, it is possible to restrict the expansion of some % characters that are more sensitive to deformation than others (\eg, the `O', % in contrast to the `I'). This is called \emph{selected expansion}, and its % usage allows to increase the stretch and shrink limits (to, say, 30 instead % of 20); however, the gain is limited since at the same time the average % stretch variance will be decreased. Therefore, this option is by default % set to |false|, so that all characters will be expanded by the same amount. % See section~\ref{sub:expansion} for a more detailed discussion. % % %\subsection{Tracking/letterspacing}\label{sub:option-tracking} % %\Describe{Option}{letterspace}{:integer}[100] % This option changes the default amount for tracking (see section~\ref{sub:tracking}) % resp. letterspacing (see section~\ref{sec:lettersp}). The amount is specified % in thousandths of 1em; admissible values are in the range of \textminus1000 % to +1000. % % %\subsection{Miscellaneous options}\label{sub:options-misc} % %\Describe{Option}{DVIoutput}{true,false}[*\,false] % \pdftex\ is not only able to generate output but can also spit out % files.\footnote{ % Recent \TeX\ systems are using pdfe\TeX\ as the default engine even for % output.} % The latter can be ordered with the option \opt{DVIoutput}, which will set % \cmd\pdfoutput\ to zero. % %\changes{v1.5}{2004/12/15}{add note about \opt{DVIoutput} option} % Note that this will confuse packages that depend on the value of % \cmd\pdfoutput\ if they were loaded earlier, as they had been made believe % that they were called to generate output where they actually weren't. % These packages are, among others: \pkg{graphics}, \pkg{color}, % \pkg{hyperref}, \pkg{pstricks} and, obviously, \pkg{ifpdf}. Either load these % packages after \microtype\ or else issue the command |\pdfoutput=0| earlier % -- in the latter case, the \opt{DVIoutput} option is redundant. % % When generating files, font expansion has to be enabled explicitly. % Neither letterspacing nor \emph{automatic} font expansion will work because % the postprocessing drivers (|dvips|, |dvipdfm|, etc.) resp. the viewer % are not able to generate the fonts on the fly. % %\changes{v2.0}{2006/11/28}{add remark about `\opt{draft}' option disabling \microtype\ % (noted by \contributor Michalis Miatidis )} % ^^A private mail, 2006/11/26 %\medskip %\Describe{Option}{draft}{true,!false} %\DescribeOption{final} % If the \opt{draft} option is passed to the package, \emph{all % micro-typographic extensions will be disabled}, which may lead to different % line, and hence page, breaks. The \opt{draft} and \opt{final} options may % also be inherited from the class options; of course, you can override them in % the package options. E.\,g., if you are using the class option |draft| to % show any overfull boxes, you should load \microtype\ with the |final| % option. % %\medskip %\Describe{Option}{verbose}{true,!false,errors,silent} % Information on the settings used for each font will be written into the log % file if you enable the \opt{verbose} option. When \microtype\ encounters a % problem that is not fatal (\eg, an unknown character in the settings, or % non-existent settings), it will by default only issue a warning and try to % continue. Loading the package with |verbose=errors| will turn all warnings % into errors, so that you can be sure that no problem will go unnoticed. If on % the other hand you have investigated all warnings and decide to ignore them, % you may silence \microtype\ with |verbose=silent|. % %\medskip %\Describe{Option}{babel}{true,!false} % Loading the package with the \opt{babel} option will adjust the typesetting % according to the respective selected language. Read section~\ref{sec:context} % for further information. % %\medskip %\Describe{Option}{config}{:file name}[microtype] % Various settings for this package will be loaded from a main configuration % file, by default \file{microtype.cfg} (see section~\ref{sub:config-file}). % You can have a different configuration file loaded instead by specifying its % name \emph{without the extension}, \eg, |config=mycrotype|. % %\iffalse ^^A ... waiting for bug reports before documenting yet another option ... %\medskip %\Describe{Option}{defersetup}{!true,false} % Unlike in earlier versions, \microtype\ will since version 1.9a defer its % setup until the end of the preamble. This has at least two advantages: the % command \cs{microtypesetup} described below may be used to change package % options later on, and it is no longer necessary to set the default fonts and % encodings before loading \microtype. There is one possible problem: if a box % is being constructed inside the preamble, \emph{and} this box contains a font % that is not loaded before the box is being used in the document, then this % font will not be set up. Should this extremely unlikely case occur, set % |defersetup=false|. Then, however, the aforementioned restrictions apply. % %\medskip %\Describe{Option}{copyfonts}{true,!false} ^^A and another one ... % There are some restrictions as to what \pdftex\ can do with a font: Firstly, % it cannot expand a single font with different parameters, secondly, it cannot % apply different protrusion settings to one font within the same paragraph. % Both restrictions, which only matter with a context-sensitive setup % (cf.~section~\ref{sec:context}), can be circumvented with the \opt{copyfonts} % option: when it is set to |true|, \microtype\ will use font copies to work % on. This option will automatically be set to |true|, whenever protrusion or % expansion settings with a |context| keyword are encountered. If these % settings are loaded after the preamble, however, it is too late, and you % should set the \opt{copyfonts} option manually. % This only works with \pdftex\ 1.40.4. %\fi % % %\ifcmr\else\pagebreak\markright{}\fi ^^A layout %\subsection{Changing options later}\label{sub:options-cmd} % %\Describe{Macro}{\microtypesetup}{key\,|=|\,value list} % Inside the preamble, this command accepts all package options described above % (except for |config|). % In the document body, this command may be used to change the general settings % of the micro-typographic extensions. It then accepts all options from % section~\ref{sub:options-microtype}: \key{expansion}, \key{protrusion} and % \key{activate}, which in turn may receive the values |true|, |false|, % |compatibility| or |nocompatibility|, and \key{tracking}, \key{spacing} and % \key{kerning} with the admissible values |true| or |false|. % Passing the name of a font set is not allowed. % Using this command, you could for instance temporarily disable font expansion % by saying: %\begin{verbatim} %\microtypesetup{expansion=false} %\end{verbatim} % % %\section{Selecting fonts for micro-typography}\label{sec:font-sets} % % By default, character protrusion will be applied to all text fonts that are % being used in the document, and a basic set of fonts will be subject to font % expansion. You may want to customise which fonts should get the benefit of % micro-typographic treatment. This can be achieved by declaring and activating % `font sets'; these font sets are specified via font attributes that have to % match. % %\medskip %\Describe{Macro}{\DeclareMicrotypeSet}{?features,set name,set of fonts} %\DescribeMacro{\DeclareMicrotypeSet*} % This command declares a new set of fonts to which the micro-typographic % extensions should be applied. The optional argument may contain a % comma-separated list of features to which this set should be restricted. % The starred version of the command declares \emph{and} activates the font % set at the same time. % % \paragraph{The set of fonts} is specified by assigning values to the % font attributes: encoding, family, series, shape and size (cf.~\cite{fntguide}). % Let's start with an example. This package defines a font set called % `|basictext|' in the main configuration file as follows: %\begin{verbatim} %\DeclareMicrotypeSet{basictext} % { encoding = {OT1,T1,LY1,OT4,QX,T5}, % family = {rm*,sf*}, % series = {md*}, % size = {normalsize,footnotesize,small,large} % } %\end{verbatim} % If you now call %\begin{verbatim}[deletekeywords={[1]{protrusion}}] %\UseMicrotypeSet[protrusion]{basictext} %\end{verbatim} % in the document's preamble, only fonts in the text encodings , , % , , or , roman or sans serif families, normal (or % `medium') series, and in sizes called by \cmd\normalsize, % \cmd\footnotesize, \cmd\small\ or \cmd\large, will be protruded. Math % fonts, on the other hand, will not, since they are in another encoding. % Neither will fonts in bold face, or huge fonts. Etc. % % If an attribute list is empty or missing -- like the `shape' attribute % in the above example -- it does not constitute a restriction. In other % words, this is equivalent to specifying \emph{all} possible values for that % attribute. % Therefore, the predefined set `|alltext|', which is declared as: %\begin{verbatim} %\DeclareMicrotypeSet{alltext} % { encoding = {OT1,T1,LY1,OT4,QX,T5,TS1} } %\end{verbatim} % is far less restrictive. The only condition here is that the encoding must % match. % % If a value is followed by an asterisk (like `|rm*|' and `|sf*|' in the first % example), it does not designate an code, but will expand to the % document's |\|\meta{value}|default|, \eg, \cmd\rmdefault. % A single asterisk means |\|\meta{attribute}|default|, \eg, % \cmd\encodingdefault, respectively \cmd\normalsize\ for the size axis. % Sizes may either be specified as a dimension (`|10|' or `|10pt|'), or as a % size selection command \emph{without} the backslash. You may also specify % ranges (\eg, `|small-Large|'); while the lower boundary is included in the % range, the upper boundary is not. Thus, `|12-16|' would match 12pt, 13.5pt % and 15.999pt, \eg, but not 16pt. You are allowed to omit the lower or % upper bound (`|-10|', `|large-|'). % % Additionally to this declaration scheme, you can add single fonts to % a set using the `|font|' key, which expects the concatenation of all font % attributes, separated by forward slashes, \ie, %`|font|\,|=|\,\meta{encoding}|/|\meta{family}|/|\meta{series}|/|\meta{shape}|/|\meta{size}'. % This allows you to add fonts to the set that are otherwise disjunct from it. % For instance, if you wanted to have the roman family in all sizes protruded, % but only the normal sized, possibly italic, typewriter font (in contrast to, % say, the small one), this is how you could declare the set: %\begin{verbatim}[deletekeywords={[1]{protrusion}}] %\DeclareMicrotypeSet[protrusion] % { myset } % { encoding = T1, % family = rm*, % font = {T1/tt*/m/n/*, % T1/tt*/m/it/*} } %\end{verbatim} % As you can tell from the example, the asterisk notation is also allowed for % the |font| key. A single asterisk is equivalent to `|*/*/*/*/*|', \ie, the % normal font. Size selection commands are possible, too, however, ranges are % not allowed. % %\medskip\noindent % Table~\ref{tab:predefined-font-sets} lists the nine predefined font sets. % They may also be activated by passing their name to the feature options % \opt{protrusion}, \opt{expansion}, \opt{tracking}, \opt{spacing} and % \opt{kerning} when loading the package, for example: %\begin{verbatim} %\usepackage[protrusion=allmath,tracking=smallcaps]{microtype} %\end{verbatim} % %\begin{table}\microtypesetup{protrusion=false}\small %\caption{Predefined font sets}\label{tab:predefined-font-sets} %\catcode`\!=13 \def!{$\varnothing$} %\setlength\fboxsep{4pt} %\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax %\fcolorbox{theframe}{white}{^^A %\begin{minipage}{\textwidth} %\begin{tabular}{@{}L{65pt}L{80pt}*3{L{41pt}}L{67pt}@{}} % \footnotesize Set name % & \multicolumn{5}{l}{\footnotesize Font attributes}\\ %\cmidrule{2-6} % & \footnotesize Encoding % & \footnotesize Family % & \footnotesize Series % & \footnotesize Shape % & \footnotesize Size\\ %\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3} %\cmidrule(r){4-4}\cmidrule(r){5-5}\cmidrule{6-6} % |all| % & ! % & ! % & ! % & ! % & ! \\ %\cmidrule(r){1-1} % |alltext|\linebreak(|allmath|) % & Text encodings, \linebreak (, , ) % & ! % & ! % & ! % & ! \\ %\cmidrule(r){1-1} % |basictext|\linebreak(|basicmath|) % & Text encodings \linebreak (, ) % & \cmd\rm|*|,\linebreak \cmd\sf|*| % & \cmd\md|*| % & ! % & \cmd\normalsize, \cmd\footnotesize, \cmd\small, \cmd\large\\ %\cmidrule(r){1-1} % |smallcaps| % & Text encodings % & ! % & ! % & sc % & ! \\ %\cmidrule(r){1-1} % |footnotesize| % & Text encodings, % & ! % & ! % & ! % & |-|\cmd\small\\ %\cmidrule(r){1-1} % |scriptsize| % & Text encodings, % & ! % & ! % & ! % & |-|\cmd\footnotesize\\ %\cmidrule(r){1-1} % |normalfont| % & \cmd\encoding|*| % & \cmd\family|*| % & \cmd\series|*| % & \cmd\shape|*| % & \cmd\normalsize \\ %\bottomrule %\end{tabular} %\vskip4pt\footnotesize % `Text encodings' = , , , , , %\hfill % `\dots|*|' = `\dots|default|' %\vskip3pt %\end{minipage}^^A %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox %\end{table} % %\medskip %\Describe{Macro}{\UseMicrotypeSet}{?features,set name} % This command activates a font set previously declared by \cs{DeclareMicrotypeSet}. % Using the optional argument, you can limit the application of the set to one % or more features. This command only has an effect if the feature was activated % in the package options. % %\medskip %\Describe{Macro}{\DeclareMicrotypeSetDefault}{?features,set name} % If a feature is enabled but no font set has been chosen explicitly, the sets % declared by this command will be activated. By default, the `|alltext|' font % set will be used for character protrusion and additional kerning, the % `|basictext|' set for font expansion and interword spacing, and the % `|smallcaps|' set for tracking. % %\medskip\noindent % These commands may only be used in the preamble or in the main configuration % file. Their scope is global to the document. Only one set per feature may be % activated. % % %\section{Micro fine tuning}\label{sec:fine-tuning} % % Every character asks for a particular protrusion, spacing or kerning amount. % It may also be desirable to restrict the maximum expansion of certain % characters. Furthermore, since every font looks different, settings have to % be specific to a font or set of fonts. This package offers flexible and % straight-forward methods of customising these finer aspects of % micro-typography. % % All fine-tuning commands follow basically the same syntax: they all take % three arguments; the first one is optional and may contain additional % options; in the second argument, you specify the set of fonts to which the % settings should apply; the third argument contains the actual settings. % % The set of fonts to which the settings should apply is declared using the % same syntax of \meta{font axis}\,|=|\,\meta{value list} pairs as for the % command \cs{DeclareMicrotypeSet} (see section~\ref{sec:font-sets}). The only % difference is that asterisked values will be expanded immediately instead of % at the end of the preamble. % %\changes{v1.7}{2005/03/23}{remove table of match order} % To find the matching settings for a given font the package will try all % combinations of font encoding, family, series, shape and size, with % decreasing significance in this order. For instance, if both settings for the % current family (say, |T1/cmr///|) and settings for italic fonts in the normal % weight (|T1//m/it/|) exist, those for the Computer Modern Roman font would % apply.\footnote{ % For the interested, table~\ref{tab:match-order} on % page~\pageref{tab:match-order} presents the exact order.} % The encoding must always match. % %\subsection{Character protrusion}\label{sub:protrusion} % %\Describe{Macro}{\SetProtrusion}{?options,set of fonts,protrusion settings} % Using this command, you can set the protrusion factors for each character of a % font or a set of fonts. A very incomplete example would be the following: %\begin{verbatim} %\SetProtrusion % { encoding = T1, % family = cmr } % { A = {50,50}, % \textquoteleft = {700, } } %\end{verbatim} % which would result in the character `A' being protruded by 5\% of its width % on both sides, and the left quote character by 70\% of its width into the % left margin. This would apply to all font shapes, series and sizes of the % ~encoded Computer Modern Roman family. % %\paragraph{The protrusion settings} % consist of \meta{character}\,|=|\,\meta{protrusion factors} pairs. % % The characters may be specified either as a single character (`|A|'), % as a text symbol command (`\cmd\textquoteleft'), or as a slot number: three % digits for decimal notation, prefixed with~|"| for hexadecimal, with~|'| for % octal (\eg, the `fl' ligature in encoding:~|029|, |"1D|, |'35|). % \mbox{8-bit} (and even ) characters may be entered directly or in % \LaTeX's traditional \mbox{7-bit} notation: both |\"A| and \expandafter|\"A| % are valid, provided the character is actually declared in both the input and % the font encoding. Note that you also have the possibility to declare lists % of characters that should inherit settings (see section~\ref{sub:inherit}). % % The protrusion factors designate the amount that a character should be % protruded into the left margin (first value) respectively into the right % margin (second value). By default, the values are relative to the character % widths, so that a value of 1000 means that the character should be shifted % fully into the margin, while, for example, with a value of 50 it would % be protruded by 5\% of its width. Negative values are admitted, as well as % numbers larger than 1000 (but effectively not more than 1em of the font). You % can omit either number if the character should not be protruded on that side, % but must not drop the separating comma. % %\paragraph{Options:} %\begin{options} % \item[\key{name}] You may assign a name to the protrusion settings, so that you % are able to load it by another list. % \item[\key{load}] You can load another list (provided, you previously assigned % a name to it) before the current list will be loaded, so that the % fonts will inherit the values from the loaded list. % \par % Thus, the configuration may be simplified considerably. You can for % instance create a default list for a font; settings for other shapes % or series can then load these settings, and extend or overwrite them % (since the value that comes last will take precedence). Font settings % will be loaded recursively. % The following options will affect all loaded lists: %\changes{v1.8}{2005/06/23}{add example for \texttt{factor} option} % \item[\key{factor}] This option can be used to influence all protrusion % factors of the list, overriding any global \opt{factor} setting (see % section~\ref{sub:options-protrusion}). For instance, if you want fonts % in larger sizes to be protruded less, you could load the normal lists, % just with a different factor applied to them: %\begin{verbatim} %\SetProtrusion % [ factor = 700 % load = cmr-T1 ] % { encoding = T1, % family = cmr, % size = large- } % { } %\end{verbatim} % \item[\key{unit}] By default, the protrusion factors are relative to the % respective character's width. The |unit| option may be used to override % this and make \microtype\ regard all values in the list as thousandths % of the specified width. Issuing, for instance, `|unit=1em|' would have % the effect that a value of, say, 50 now results in the character being % protruded by 5\% of an |em| of the font (thus simulating the internal % measuring of \pdftex's \cmd\lpcode\ and \cmd\rpcode\ primitives). % The default behaviour can be restored with |unit=character|.\footnote{ % The |unit| option can even be passed globally to the package (cf. % section~\ref{sub:options-protrusion}). % However, all provided settings are created under the assumption % that the values are relative to the character width. Therefore, you % should only change it if you are certain that the % default settings will not be used in your document.} % \item[\key{preset}] Presets the protrusion codes of all characters to the % specified values (|={|\meta{left}|,|\meta{right}|}|), possibly % scaled by a |factor|. A |unit| setting will only be taken into account % if it is not |=character|. % \item[\key{inputenc}] Selects an input encoding that should apply to this % list, regardless of what the document's input encoding is. You may % specify any encoding that can be loaded via the \pkg{inputenc} package, % \eg, |ansinew|, |koi8-r|, |utf8|. % \item[\key{context}] The scope of the list may be limited to a certain % context. For an example application, see section~\ref{sec:context}. %\end{options} % % %\subsection{Font expansion}\label{sub:expansion} % %\Describe{Macro}{\SetExpansion}{?options,set of fonts,expansion settings} % By default, all characters of a font are allowed to be stretched or shrunk by % the same amount. However, it is also possible to limit the expansion of % certain characters if they are more sensitive to deformation. This is the % purpose of the \cs{SetExpansion} command. Note that it will only have an % effect if the package was loaded with the \opt{selected} option (cf. % section~\ref{sub:options-expansion}). Otherwise, the expansion settings will % be ignored~-- unlike the options in the optional first argument, which will % still be evaluated. % % If the package was loaded with the \opt{selected} option, and settings for a % font don't exist, font expansion will not be applied to this font at all. % Should the extraordinary situation arise that you want to employ selected % expansion in general but that all characters of a particular font (set) % should be expanded or shrunk by the same amount, you would have to declare an % empty list for these fonts. % %\ifcmr\else\enlargethispage\baselineskip\fi ^^A layout %\paragraph{The expansion settings} % consist of \meta{character}\,|=|\,\meta{expansion factor} pairs. % You may specify one number for each character, which determines the amount % that a character may be expanded. The numbers denominate thousandths of the % full expansion. % For example, if you set the expansion factor for the character `O' to 500, % it will only be expanded or shrunk by one half of the amount that the rest % of the characters will be expanded or shrunk. % While the default value for character protrusion is~0~-- that is, if you % didn't specify any characters, none would be protruded~-- the default value % for expansion is 1000, which means that all characters would be expanded by % the same amount. % %\paragraph{Options:} %\begin{options} % \item[\key{name}, \key{load}, \key{preset}, \key{inputenc}, \key{context}] % Analogous to \cs{SetProtrusion}, the optional argument may be used to % assign a name to the list, to load another list, to preset all % expansion factors, to set the input encoding, or to determine the % context of the list (expansion contexts are only possible with \pdftex\ % version 1.40.4 or newer). %\changes{v1.8}{2005/04/12}{add example of how to get rid of a widow % (suggested by \contributor Adam Kucharczyk )} % ^^A private mail, 2005/04/09 % \item[\key{auto}, \key{stretch}, \key{shrink}, \key{step}] % These keys can be used to override the global settings from the package % options (see section~\ref{sub:options-expansion}). If you don't specify % either one of |stretch|, |shrink| and |step|, their respective global % value will be used (that is, no calculation will take place). % % As a practical example, suppose you have a paragraph containing a widow % that could easily be avoided by shrinking the font a little bit more. % In conjunction with the |context| option (see section~\ref{sec:context} % for further details), you could thus allow for more expansion in this % particular paragraph: %\begin{verbatim}[gobble=2] % \SetExpansion % [ context = sloppy, % stretch = 30, % shrink = 60, % step = 5 ] % { encoding = {OT1,T1,TS1} } % { } % % ... END PREAMBLE % {\microtypecontext{expansion=sloppy}% % This paragraph contains an `unnecessary' widow.} %\end{verbatim} % This method of employing contexts to temporarily apply different % expansion parameters only works with \pdftex\ version 1.40.4 or later % (for older versions, a dirty trick is laid out in % section~\ref{ssec:font-setup} on page~\pageref{exp-hack}). Also note % that \pdftex\ prohibits the use of fonts with different expansion % limits or steps (even of different fonts) within one paragraph, hence % the sloppy context has to be applied to complete paragraphs. % \item[\key{factor}] % This option provides a different method to alter expansion settings for % certain fonts, working around the restriction just mentioned. The % |factor| option influences the expansion factors of all characters (in % contrast to the overall stretchability) of the font. For instance, if % you want the italic shape to be expanded less, you could declare: %\begin{verbatim} %\SetExpansion % [ factor = 500 ] % { encoding = *, % shape = it } % { } %\end{verbatim} % The |factor| option can only be used to \emph{decrease} the % stretchability of the characters, that is, it may only receive values % smaller than 1000. Also, it can only be used for single fonts or font % sets; setting it globally in the package options wouldn't make much % sense -- to this end, you use the package's \opt{stretch} and % \opt{shrink} options. %\end{options} % % %\subsection{Tracking}\label{sub:tracking} %\Describe{Macro}{\SetTracking}{?options,set of fonts,tracking amount} % An important typographic technique -- which was missing in \TeX\ for a long % time -- is the adjustment of tracking, \ie, the uniform addition or % subtraction of letter space to/from all the characters in a font. For % example, it is good typographic practice to slightly space out text set in % all capitals or small capitals (as in this document). Legibility may also be % improved by minimally increasing the tracking of smaller and decreasing that % of larger type.\footnote{ % With full-featured fonts like Computer Modern, this is usually not % necessary, though, since they come in optical sizes, and the tracking of % the small-capitals font is already adjusted.} % The \cs{SetTracking} command allows to specify the tracking amount for % different fonts or font sets. It will also be evaluated by the \cs{textls} % command, which may be used for letterspacing shorter pieces of text (see % section~\ref{sec:lettersp}). % %\paragraph{The tracking amount} % is specified in thousandths of 1em (or the given unit); negative values are % allowed, too. % %\paragraph{Options:} %\begin{options} % \item[\key{name}, \key{unit}, \key{context}] % These options serve the same functions as in the previous configuration % commands. The unit may be any dimension, default is 1em. % \item[\key{spacing}] % When the inter-\emph{letter} spacing is altered, the inter-\emph{word} % spacing probably also needs to be adjusted. This option expects three % numbers for interword space, stretch and shrink respectively, which are % given in thousandths of 1em (or of the current \texttt{unit}). If a % value is followed by an asterisk, it denotes thousandths of the % respective font dimension which will be added to it. For instance, with %\begin{verbatim} %\SetTracking[ spacing = {25*,166, } ]{ encoding = *, shape = sc }{ 25 } %\end{verbatim} % the interword space will be increased by 2.5\%, the stretch amount will % be set to 0.166em, while the shrink amount will be left untouched. If % you don't specify the \texttt{spacing} option, the interword space will % be scaled by the current letterspace amount (as in the above example), % while stretch and shrink will not be changed. % \item[\key{outer spacing}] % If an interword space immediately precedes or follows letterspaced text, % it will by default be equal to that within the text. With this option, % which accepts the same values as \texttt{spacing}, it may be adjusted % independently. % \item[\key{outer kerning}] % If, on the other hand, no interword space precedes of follows, you may % still want to slightly set off the first and last letter from adjoining % letters. This option expects the kerning amounts for left and right hand % side, separated by a comma, in thousandths of 1em (or the current % \texttt{unit}). If a value is followed by an asterisk, it denotes % thousandths of the current letterspacing amount. A single asterisk means % `|500*|'; this is also the default, \ie, the sum of the outer kerns is % by default equal to the current letterspace amount. To remove kerning on % both sides, you would write `|outer kerning={0,0}|'. % \item[\key{no ligatures}] % As far as \pdftex\ is concerned, ligatures in letterspaced fonts would % be constructed as usual, which may be advisable when changing the % tracking by only a small amount. For larger letterspacing amounts, on % the other hand, the normal letter space within ligatures would have % displeasing \textls[150]{e\lslig{ff}ects}. % This key expects a comma-separated list of characters for which % ligatures should be disabled; only the character that begins a ligature % must be specified. % If the key is given without a value, \emph{all} ligatures of the font % will be disabled. This is not recommended, however, since it also % entails that kerning will be switched off.\footnote{ % The inseparable connexion of ligatures and kerns is a limitation of % \TeX\ that will not be lifted before the advent of \luatex.} % The default settings disable ligatures for the character `|f|' only, % \ie, `ff', `fi', ffi', etc.\footnote{ % With \pdftex\ versions older than 1.40.4, \emph{all} ligatures, and % hence all kerning, will be disabled. It is therefore recommended to % use at least version 1.40.4.} % In exceptional situations, you can manually break up a ligature by % inserting `|{\kern0pt}|' resp. \pkg{babel}'s \verb="|= % shortcut, or protect it by enclosing it in \cs{lslig} (see % section~\ref{sec:lettersp}). %\end{options} % %\ifx\lssample\undefined % {\centering\itshape % [The original documentation\footnote{\ctanurl{macros/latex/contrib/microtype/microtype.pdf}.} % includes an image illustrating all of these options.]\par} %\medskip\noindent % As an %\else %\changes{v2.3}{2007/11/03}{add letterspacing illustration} %\medskip\noindent % Since a picture is worth a thousand words, probably even more if, in our % case, it depicts a couple of letterspaced words, let's bring one to sum up % these somewhat confusing options. Suppose you had the following settings % (which I would in no way recommend; they are only for illustrative purposes): %\begin{verbatim} %\SetTracking % [ no ligatures = {"\anchorarrow{nolig}"f}, % spacing = {60"\anchorarrow{ispace}"0*,-1"\anchorarrow{istretch}"00*, "\anchorarrow{ishrink}"}, % outer spacing = {4"\anchorarrow{ospace}"50,2"\anchorarrow{ostretch}"50,1"\anchorarrow{oshrink}"50}, % outer kerning = {"\anchorarrow{okernbegin}"*,"\anchorarrow{okernend}"*} ] % { encoding = * } % { 1"\anchorarrow{lsamount}"60 } %\end{verbatim} % and then write: %\begin{verbatim} %Stop \textls{stealing sheep}! %\end{verbatim} % this is the (typographically dubious) outcome: % % \lssample % %\noindent % While the word `Stop' is not letterspaced, the space between the letters in % the other two words is expanded by the \showarrow[tracking]{tracking~amount}{red} % of 160/1000em\,=\allowbreak\,0.16em. % The \showarrow[ispace]{inner~space}{green} within the letterspaced text is % increased by 60\%, while its \showarrow[istretch]{stretch}{green} amount is % decreased by 10\% and the \showarrow[ishrink]{shrink}{green} amount is left % untouched. % The \showarrow[ospace]{outer~space}{green} (of 0.45em) immediately before the % piece of text may \showarrow[ostretch]{stretch}{green} by 0.25em and % \showarrow[oshrink]{shrink}{green} by 0.15em. % Note that there is no outer space after the text, since the exclamation mark % immediately follows; instead, the default \showarrow[okern]{outer~kern}{red} % of half the letterspace amount (0.08em) is added. % Furthermore, one \showarrow{ligature}{grey} wasn't broken up, because we % neglected to specify the `|s|' in the |no ligatures| key. % %\medskip\noindent % As another, more realistic %\fi % example, suppose you want to space out all small % capitals by 50/1000em, fonts smaller than \cmd\small\ by 0.02em, and to % decrease the tracking of large type by 0.02em. You can achieve this with the % following settings: %^^A there's a \nobreakspace ahead! %\begin{verbatim} %\usepackage[tracking=true]{microtype} %\DeclareMicrotypeSet*[tracking]{my} % { encoding = *, % size = {-small,Large-}, % font = */*/*/sc/* } %\SetTracking[ no ligatures = f ]{ encoding = *, shape = sc}{ 50 } %\SetTracking{ encoding = *, size = -small }{ 20 } %\SetTracking{ encoding = *, size = Large- }{ -20 } %\end{verbatim} % %\medskip\noindent % Letterspaced fonts for which settings don't exist will be spaced out by the % default of 0.1em (adjustable with the package option \opt{letterspace}, see % section~\ref{sub:options-misc}). Suppose your editor wants you to shorten % your 1000 pages chef-d'\oe uvre by a handful of pages, you could load % \microtype\ with (fingers crossed): %\begin{verbatim} %\usepackage[tracking=alltext,letterspace=-40]{microtype} %\end{verbatim} % % %\subsection{Interword spacing}\label{sub:spacing} % %\Describe{Macro}{\SetExtraSpacing}{?options,set of fonts,spacing settings} % This command allows you to fine tune the interword spacing (also known as % glue). A preliminary remark on what a `space' is may be in order: between two % words, \TeX\ will insert a so called glue, which is characterised by three % parameters -- the normal distance between two words, the maximum amount of % space that may be added to it, and the maximum amount that may be subtracted. % The latter two parameters come into effect whenever \TeX\ tries to break a % paragraph into lines and does not succeed; it can then stretch or shrink the % spaces between words. These three parameters are specific to each font. % % On top of these glue dimensions, \TeX\ has the concept of `space factors'. % They may be used to increase the space after certain characters, most % prominently the punctuation characters. If \pdftex's additional spacing % adjustment is in effect, space factors are ignored, since it may be % considered an extension to space factors with much finer control. % %\emptypdfpageresources ^^A layers of letterspacing illustration % %\paragraph{The spacing settings} % are declared as pairs of \meta{character}\,|=|\,\meta{spacing factors}, where % the latter consist of three numbers: first, the additional kern inserted % after this character if it appears before an interword space, second, the % additional stretch amount, and third, the additional shrink amount. All % values may also be negative, in which case the dimensions will be decreased. % Not all values have to be specified, however, the settings must contain the % two separating commas. % %\paragraph{Options:} %\begin{options} % \item[\key{name}, \key{load}, \key{factor}, \key{preset}, \key{inputenc}, \key{context}] % These options serve the same function as in the previous configuration % commands. % \item[\key{unit}] You can specify the unit by which the specified numbers are % measured. Possible values are: |character|, a \meta{dimension} and, % additionally, |space|. The latter will measure the values in thousandths % of the respective space dimension set by the font. By default, the unit % is measured by the space dimensions. For example, with these % (nonsensical) settings: %\begin{verbatim} %\SetExtraSpacing % [ unit = space ] % default % { font = */*/*/*/* } % { % . = {1000,1000,1000}, % } %\end{verbatim} % the space inserted after a full stop would be doubled (technically % speaking: 2\,\texttimes\ \fontdim2), as would the maximum stretch and % shrink amounts of the interword space (\fontdim3 and 4). As another % example, setting all three value to |-1000| would completely cancel a % space after the respective character. %\end{options} % % %\subsection{Additional kerning}\label{sub:kerning} % %\Describe{Macro}{\SetExtraKerning}{?options,set of fonts,kerning settings} % With this command, you can fine tune the extra kerning. In contrast to % standard kerning, which is always associated with a \emph{pair} of % characters, and to tracking, which specifies the space between \emph{all} % characters of a font, the extra kerning relates to single characters, that % is, whenever a particular character appears in the text, the specified % kerning will be inserted, regardless of which character precedes resp. % follows it. % % I should not neglect to mention a limitation of this additional kerning: % words \emph{immediately following} such a kern (not separated by a space) % will not be hyphenated, unless you insert the breakpoints manually, \eg, for % kerning after the apostrophe, `|l'apos\-trophe|'. This restriction of \pdftex\ % will hopefully be lifted soon. % %\paragraph{The kerning settings} % are specified as pairs of \meta{character}\,|=|\,\meta{kerning values}, where % the latter consist of two values: the kerning added before the character, and % the kerning appended after the respective character. Once again, either value % may be omitted, but not the separating comma. % %\paragraph{Options:} %\begin{options} % \item[\key{name}, \key{load}, \key{factor}, \key{preset}, \key{inputenc}] % These options serve the same function as in the previous configuration % commands. % \item[\key{unit}] Admissible values are: |space|, |character| and a % \meta{dimension}. By default, the values denote thousandths of 1em. % \item[\key{context}] When it comes to kerning settings, this option is % especially useful, since it allows to apply settings depending on the % current language. % \par % For example, you can find the following settings, intended to be used % for documents written in French, in the main configuration file: %\ifcmr\else\pagebreak\fi ^^A layout %\begin{verbatim}[deletekeywords={[1]{unit}}] %\SetExtraKerning % [ name = french-default, % context = french, % unit = space ] % { encoding = {OT1,T1,LY1} } % { % : = {1000,}, % = \fontdimen2 % ; = {500, }, % ~ \thinspace % ! = {500, }, % ? = {500, } % } %\end{verbatim} %\changes{v2.3}{2007/11/20}{add kerning sample} % \begin{microtypecontext}{kerning=french} % What is the result of these settings? If they are active, like in the % current paragraph, a thin space will be inserted in front of each % question mark, exclamation mark and semicolon; a normal space in front % of the colon. Read section~\ref{sec:context} to learn how to activate % these settings! This paragraph was input like this: % \end{microtypecontext} %\begin{verbatim}[deletekeywords={[1]{context,activate}}] %\begin{microtypecontext}{kerning=french} % What is the result of these settings? If they are active, like in the % current paragraph, a thin space will be inserted in front of each % question mark, exclamation mark and semicolon; a normal space in front % of the colon. Read section~\ref{sec:context} to learn how to activate % these settings! This paragraph was input like this: %\end{microtypecontext} %\end{verbatim} %\end{options} % % %\subsection{Character inheritance}\label{sub:inherit} % % \Describe{Macro}{\DeclareCharacterInheritance} % {?features,set of fonts,inheritance lists} % In most cases, accented characters should inherit the settings from the % respective base character. For example, all of the characters \`A, \'A, \^A, % \~A, \"A, \r{A} and \u{A} should probably be protruded by the same (absolute) % amount as the character A. Using the command \cs{DeclareCharacterInheritance}, % you may declare such classes of characters, so that you then only have to set % up the respective base character. With the optional argument, which may % contain a comma-separated list of features, you can confine the scope of the % list. Additionally, it accepts the |inputenc| key to set the input encoding % for this list. The font set can be declared in the usual way, with the only % exception that exactly one encoding must be specified. The inheritance lists % are declared as pairs of \meta{base character}\,|=|\,\meta{list of inheriting % characters}. Unless you are using a different encoding or a very peculiarly % shaped font, there should be no need to change the default character % inheritance settings. % %\bigskip\noindent % In the main configuration file \file{microtype.cfg} and the other % font-specific configuration files, you can find examples of all these % commands. % %\subsection{Configuration files}\label{sub:config-file} % % The default configuration, consisting of inheritance settings, declarations % of font sets and alias fonts, and generic protrusion, expansion, spacing and % kerning settings, will be loaded from the file \file{microtype.cfg}. You may % extend this file with custom settings (or load a different configuration file % with the `\opt{config}' option, see section~\ref{sub:options-misc}). % % If you are embarking on creating new settings for a font family, you should % put them into a separate file, whose name must be: `|mt-|\meta{font % family}|.cfg|' (\eg, `\file{mt-cmr.cfg}'), and may contain all commands % described in the current section~\ref{sec:fine-tuning}. These files will be % loaded automatically if you are actually using the respective fonts. % This package ships with configuration files for a number of font families. % Table~\ref{tab:fonts} lists them all. % %\begin{table}[t]\small %\changes{v1.6a}{2005/02/02}{add table of fonts with tailored protrusion settings} %\caption{Fonts with tailored protrusion settings}\label{tab:fonts} %\setlength\fboxsep{4pt} %\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax %\fcolorbox{theframe}{white}{^^A %\begin{minipage}{\textwidth} %\def\arraystretch{1.2} %\let\footnoterule\relax %\def\fnref#1{\textsuperscript{\itshape\ifpdf\ref*{#1}\else\ref{#1}\fi}} %\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*3l@{}} % \footnotesize Font family ( code) % & \multicolumn{2}{l}{\footnotesize Features}\\ %\cmidrule{2-3} % & \footnotesize Encodings % & \footnotesize Shapes\\ %\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3} % Generic % & , , , , ()\footnote{Incomplete\label{fn:incmpl}} % & n, (it, sl, sc)\fnref{fn:incmpl} \\ % Computer Modern Roman (|cmr|)\footnote{Aliases: Latin Modern (|lmr|), % \pkg{ae} (|aer|), \pkg{zefonts} (|zer|), % \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|)} % & , , , , , % & n, it, sl, sc \\ % Bitstream Charter (|bch|)\footnote{Aliases: \pkg{mathdesign}/Charter (|mdbch|), % MicroPress's \pkg{chmath} (|chr|)} % & , , , , % & n, it, (sl)\footnote{Settings inherited from italic shape\label{fn:it-sl}}, sc \\ % Adobe Garamond (|pad|, |padx|, |padj|) % & , , , % & n, it, (sl)\fnref{fn:it-sl}, sc \\ % Garamond (|ugm|)\footnote{Alias: \pkg{mathdesign}/ Garamond (|mdugm|)} % & , , % & n, it\\ % Bitstream Letter Gothic (|blg|)\footnote{Alias: \pkg{ulgothic} (|ulg|)} % & , , % & n, it \\ % Adobe Minion (|pmnx|, |pmnj|)\footnote{By courtesy of Harald Harders (\mailto{h.harders@tu-bs.de})} % & , , , % & n, it, (sl)\fnref{fn:it-sl}, sc, si\\ % Palatino (|ppl|, |pplx|, |pplj|)\footnote{Aliases: \pkg{pxfonts} (|pxr|), % \pkg{qfonts}/QuasiPalatino, \TeX\ Gyre Pagella (|qpl|), % Neu (|fp9x|, |fp9j|)} % & , , , , ()\fnref{fn:incmpl} % & n, it, (sl)\fnref{fn:it-sl}, sc \\ % Times (|ptm|, |ptmx|, |ptmj|)\footnote{Aliases: \pkg{txfonts} (|txr|), % \pkg{qfonts}/QuasiTimes, \TeX\ Gyre Termes (|qtm|)} % & , , , , , ()\fnref{fn:incmpl} % & n, it, (sl)\fnref{fn:it-sl}, sc \\ % Computer Modern math (|cmsy|, |cmm|) % & / % & n/it \\ % symbols (|msa|, |msb|) % & % & n\\ % Euler (|eur|, |eus|, |euf|)\footnote{Alias: \pkg{eulervm} (|zeur|, |zeus|)} % & % & n\\ % Euro symbols (Adobe, , \pkg{marvosym}) % & / % & n, it \\ %\bottomrule %\end{tabular*}^^A %\end{minipage}^^A %}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox %\end{table} % %\medskip %\Describe{Macro}{\DeclareMicrotypeVariants}{list of suffixes} %\DescribeMacro{\DeclareMicrotypeVariants*} % On its search for a configuration file, the package will also try to remove % from the font name a suffix of one or more letters that denotes a `variant' % of the base font (cf. Karl Berry's \cite{fontname}). This allows it to put % settings for, \eg, the fonts |padx| (expert set), |padj| (oldstyle numerals) % and |pad| (plain) into one and the same file \file{mt-pad.cfg}. % This command expects a comma-separated list of variant suffixes. The starred % version appends the suffix(es) to the existing list. The default declaration % in \file{microtype.cfg} is: %\begin{verbatim} %\DeclareMicrotypeVariants{x,j,w,a,d,0,1} %\end{verbatim} % %\medskip %\Describe{Macro}{\DeclareMicrotypeAlias}{font name,alias font} % This command may be used for fonts that are very similar, or actually the % same (for instance if you did not stick to the Berry naming scheme when % installing a font). An example would be the Latin Modern fonts, which are % derived from Computer Modern, so that it is not necessary to create new % settings for them -- you could say: %\begin{verbatim} %\DeclareMicrotypeAlias{lmr}{cmr} %\end{verbatim} % which would make the package, whenever it encounters the font |lmr| and does % not find settings for it, also try the font |cmr|. In fact, you will find % this very line, along with some others, in the default configuration file. % %\medskip %\Describe{Macro}{\LoadMicrotypeFile}{font name} % In rare cases, it might be necessary to load a font configuration file % manually, for instance, from within another configuration file, or to be able % to extend settings defined in a file that would otherwise not be loaded % automatically, or would be loaded too late.\footnote{ % Font package authors might also want to have a look at the hook % \cs{Microtype@Hook}, described in the implementation part, % section~\ref{sub:hook}.} % This command will load the file `|mt-|\meta{font name}|.cfg|'. % % %\section{Context-sensitive setup}\label{sec:context} % % The \microtype\ package also allows to apply different micro-typographic % settings to the fonts depending on the context they occur in. This opens up % the space for infinite possibilities of tweaking the document's appearance. % %\medskip %\Describe{Macro}{\microtypecontext}{context assignments} % This command may be used anywhere in the document (also in the preamble) to % change the micro-typographic context in the current group. To each feature % (\key{protrusion}, \key{expansion}, \key{tracking}, \key{spacing} and % \key{kerning}), one context may be assigned. Consequently, only settings with % the corresponding `|context|' keyword will be applied. % %\medskip %\Describe{Env}{microtypecontext}{context assignments} % Like many \LaTeX\ commands, it is also available in the form of an environment. % %\medskip %\Describe{Macro}{\textmicrotypecontext}{context assignments,general text} % As another possibility, the command \cs{textmicrotypecontext} sets the % context(s) for the text given in the second argument. % %\changes{v1.9c}{2006/01/25}{add example of how to increase protrusion of footnote markers % (suggested by \contributor Georg Verweyen )} % ^^A private mail, 2006/01/25 %\medskip\noindent % Suppose you want the footnote markers in the text to be protruded by a larger % amount. You could define settings for the numbers: %\begin{verbatim} %\SetProtrusion % [ context = footnote ] % { font = */*/*/*/scriptsize } % adapt if necessary % { 1 = { ,650}, 2 = { ,400}, 3 = { ,400}, 4 = { ,400}, 5 = { ,400}, % 6 = { ,400}, 7 = { ,500}, 8 = { ,400}, 9 = { ,400}, 0 = { ,400} } %\end{verbatim} % and have the context changed in the footnote marker command. This command % differs among the various classes; for the base classes, \eg, \pkg{article}, % it would be: %\begin{verbatim} %\newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont % \microtypecontext{protrusion=footnote}\@thefnmark}}} %\renewcommand*\@footnotemark{% % \leavevmode \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi % \new@makefnmark \ifhmode\spacefactor\@x@sf\fi \relax} %\end{verbatim} % For the \pkg{memoir} class, you would additionally have to disable % auto-detection of multiple footnotes, which prevents protrusion: %\begin{verbatim} %\renewcommand*\@makefnmark{\hbox{\@textsuperscript{\normalfont % \microtypecontext{protrusion=footnote}\@thefnmark}}} %\let\m@mmf@prepare\relax %\let\m@mmf@check\relax %\end{verbatim} % ^^A For other classes, the command would have to be changed in a similar way. % %\medskip\noindent % Another possibility would be to employ contexts for a language-dependent % setup. For instance, if you are writing a text in French, you could add: %\begin{verbatim} %\microtypecontext{kerning=french} %\end{verbatim} % to the preamble. This would have the effect that kerning settings for the % French context would be applied to the document. Should parts of the document % be in English, you could write: %\begin{verbatim} %\textmicrotypecontext{kerning=}{English text!} %\end{verbatim} % to reset the context, so that the punctuation characters in these parts will % not receive any extra kerning. % % Instead of adding these commands manually to your document, you may also load % \microtype\ with the \opt{babel} option (see section~\ref{sub:options-misc}). % The current language will then be automatically detected and the contexts set % accordingly. % %\medskip %\Describe{Macro}{\DeclareMicrotypeBabelHook} % {list of \pkg{babel} languages,context list} % Naturally, \microtype\ does not know about the typographic specialties of % every language. This command is a means of teaching it how to adjust the % context when a particular language is selected. The main configuration file % contains among others the following declaration: %\begin{verbatim} %\DeclareMicrotypeBabelHook % {french,francais,acadian,canadien} % {kerning=french, spacing=} %\end{verbatim} % Consequently, whenever you switch to the French language, the kerning context % will be changed to `|french|' and the spacing context will be reset. This % hook only has an effect if the package was loaded with the \opt{babel} option. % Currently, \microtype\ supports French and Turkish kerning and English % spacing (aka. \cmd\nonfrenchspacing). For unknown languages, all contexts % will be reset. % % %\ifcmr\else\pagebreak\fi ^^A layout %\section{Letterspacing revisited}\label{sec:lettersp} % %\Describe{Macro}{\textls}{?amount,general text} %\DescribeMacro{\textls*} %\DescribeMacro{\lsstyle} % While the \opt{tracking} feature, described in section~\ref{sub:tracking}, % will apply to sets of fonts, you may also want to letterspace shorter pieces % of text, regardless of the font in which they are typeset.\footnote{ % Letterspacing should be used cautiously; in particular, letterspacing % lower-case text is held in abhorrence by honourable typographers. Unless % you know what you are doing, you should probably only letterspace % small-capitals or all-capitals. Another just cause may be emphasis in texts % typeset in Fraktur fonts.} % For such ad-hoc letterspacing, \microtype\ introduces two commands that can % be used in the same way as \LaTeX's text commands (independently of whether % the |tracking| option is enabled): \cs{textls} expects the text in the % mandatory argument, while \cs{lsstyle} will switch on letterspacing for all % subsequent fonts until the end of the current group. The starred version of % \cs{textls} does not add any extra kerning before or after the text, which % may be useful, \eg, for section titles. By default, each character will be % spaced out by 100/1000em\,=\,0.1em; this amount may be altered in the % optional argument to \cs{textls}, using the \cs{SetTracking} command, or % globally with the \opt{letterspace} package option, with decreasing % significance in this order. % %\medskip %\Describe{Macro}{\lslig}{ligature} % Since the commands \cs{textls} and \cs{lsstyle} will also evaluate the % `\texttt{no ligatures}' key for the respective font, you need not worry % about protecting or breaking ligatures with most fonts. However, in certain % situations, there may be a conflict of ligatures beginning with the same % letter, where some of them should be inhibited, while others should not. When % letterspacing text typeset in Fraktur fonts, for example, the ligatures `ch', % `ck', `tz' and `sz'~(`\textfrak{sz}') should never be broken up; you also usually % see the `st'~(`\textfrak{st}') ligature in letterspaced text. Furthermore, at % least the \pkg{yfonts} package realises the short~s~(`\textfrak{s:}') as the % ligature~`|s:|'. On the other hand, the `ct'~ligature and the other `long~s' % ligatures often found in Fraktur fonts should be suppressed. There are two % ways to solve this problem: either don't disable the `|s|' and/or `|c|' % ligatures and break those that need to be broken up by inserting % `|{\kern0pt}|' or \pkg{babel}'s \verb="|= shortcut; or disable them and % protect those ligatures that need to be protected by enclosing them in the % \cs{lslig} command. So, the following two solutions have the same result % (namely, `\textfrak{\lsstyle Aus:s{\kern0pt}ichts:los{\kern0pt}igkeit}'). % %\begin{verbatim}[morekeywords={[0]{\kern}}] %\SetTracking[no ligatures={f}]{encoding = LY, family = yfrak}{} %\textfrak{\lsstyle Aus:s{\kern0pt}ichts:los{\kern0pt}igkeit} %\end{verbatim} %\begin{verbatim} %\SetTracking[no ligatures={f,s,c}]{encoding = LY, family = yfrak}{} %\textfrak{\lsstyle Au\lslig{s:}si\lslig{ch}t\lslig{s:}losigkeit} %\end{verbatim} % %\bigskip\noindent %\DescribePackage{letterspace} % These three commands (plus the \opt{letterspace} option, described in % section~\ref{sub:option-tracking}) are also available with the alternative % \letterspace\ package, which is in fact a much stripped-down version of % \microtype, omitting support for all the other extensions (and also omitting % the possibilities of the \cs{SetTracking} command -- all `|f|' ligatures will % be disabled, inner and outer spacing and outer kerning will be set to the % default values described in section~\ref{sub:tracking}). If you prefer to % forgo \microtype's specialties, you may load the \letterspace\ package % instead. Both packages should not be used at the same time. % % In contrast to \microtype, which requires \LaTeX, the \letterspace\ % package also works with \pkg{eplain} or even only \pkg{miniltx}: for use with % \pkg{eplain}, load the package with \cmd\usepackage\ inside the % \cmd\beginpackages~\dots\ \cmd\endpackages\ environment; with \pkg{miniltx} % (which does not support package options) simply \cmd\input\ \file{letterspace.sty}. % % %\section{Disabling ligatures}\label{sec:disable-ligatures} % %\Describe{Macro}{\DisableLigatures}{?characters,set of fonts} % While completely disabling all ligatures of a font (which will also switch % off kerning for this font), purposely \textit{lowers} the micro-typographic % quality instead of raising it, it is especially useful for typewriter fonts, % so that, \eg, in a encoded font, `|\texttt{--}|' will indeed be printed % as `|--|', not as `\texttt{--}'. \cs{DisableLigatures} may be used to % specify, in the usual way, a set of fonts for which ligatures should be % disabled, for example, of the typewriter font in encoding: %\begin{verbatim} %\DisableLigatures{encoding = T1, family = tt* } %\end{verbatim} % It is also possible to disable selected ligatures only. The optional argument % may contain a comma-separated list of characters for which the ligature % mechanism should be inhibited: %\begin{verbatim} %\DisableLigatures[?,!]{encoding = T1} % "\ifx\tagcode\undefined\else ^^A % \normalfont\color{thegrey}inhibit ?` !`, but not fi -- >> etc.\fi" %\end{verbatim} % The character that begins the ligature(s) is what matters. This command may % only be used in the preamble, and only once. It requires \pdftex\ 1.30 or % newer. % % %\section{Hints and caveats}\label{sec:caveats} % %\paragraph{Use settings that match your font.} % Although the default settings should give reasonable results for most fonts, % the particular font you happen to be using may have different character % shapes that necessitate more or less protrusion or expansion. In particular, % italic letter shapes may differ wildly in different fonts, hence I have % decided against providing default protrusion settings for them. % % The file \file{test-microtype.tex} might be of some help when adjusting the % protrusion settings for a font. % %\paragraph{Don't use too large a value for expansion.} % Font expansion is a feature that is supposed to enhance the typographic % quality of your document by producing a more uniform greyness of the text % block (and potentially reducing the number of necessary hyphenations). When % expanding or shrinking a font too much, the effect will be turned into the % opposite. Expanding the fonts by more than 2\%, \ie, setting a \opt{stretch} % limit of more than 20, should be justified by a typographically trained eye. % If you are so lucky as to be in the possession of multiple instances of a % Multiple Master font, you may set expansion limits to up to 4\%. % %\changes{v2.0}{2006/12/13}{qualify hint about web documents with regard to older \pdftex\ versions} %\paragraph{Don't use font expansion for web documents (with older \pdftex\ versions).} % With \pdftex\ versions older than 1.40, each expanded instance of the font % will be embedded in the file, hence the file size may increase by quite % a large factor (depending on expansion limits and step). Therefore, courtesy % and thriftiness of bandwidth command it not to enable font expansion when % creating files to be distributed electronically. With \pdftex\ 1.40, which % uses a different technique of expansion, the file size increase can be % neglected. % %\changes{v1.9e}{2006/07/10}{add hint about unknown encodings} %\paragraph{Settings for Cyrillic/Greek/Thai etc. encodings are not yet included.} % The default sets of fonts for which the micro-typographic features will be % enabled (see table~\ref{tab:predefined-font-sets}) only contain those % encodings for which configurations exist. Therefore, if you are using any % other encoding (\eg, , etc.), \microtype\ will not apply to these % fonts. You have to define and activate a new font set including the % encoding(s) you are using (for details, see section~\ref{sec:font-sets}). For % protrusion at least, you would also have to create settings for the fonts in % question (see section~\ref{sub:protrusion}). It goes without saying that % contributions for these encodings are more than welcome. % %\paragraph{Only employ kerning adjustment if it is customary in the language's %typographic tradition.} % In contrast to protrusion and expansion (and possibly adjustment of interword spacing), % additional kerning does not unconditionally improve the micro-typographical % quality of your document. You should only switch it on if you are writing a % document in a language whose typographic tradition warrants such kerning. If % you are, for example, writing an English text, your readers would probably be % rather confused by additional spaces before the punctuation characters. % %\changes{v2.2}{2007/07/06}{add hint about extra leader dot % (first discovered by \contributor Morten H\o gholm )} % ^^A private mail, 2006/08/26 %\paragraph{You might want to disable protrusion in the Table of Contents.} % In unfortunate situations, enabled protrusion might internally alter the line % length in the and similar lists in such a way that an excess leader dot % will fit in. The solution is to temporarily disable protrusion for the : %\begin{verbatim} %\microtypesetup{protrusion=false} %\tableofcontents %\microtypesetup{protrusion=true} %\end{verbatim} % %\changes{v1.9}{2005/07/10}{add hint about \texttt{verbatim} environment} %\paragraph{You might want to disable protrusion in \texttt{verbatim} environments.} % As you know by now, \microtype\ will by default activate character protrusion % for all fonts contained in the font set `|alltext|'. This also includes the % typewriter font. Although it does make sense to protrude the typewriter font % if it appears in running text (like, for example, in this manual), this is % probably not desirable inside the |verbatim| environment. However, % \microtype\ has no knowledge about the context that a font appears in but % will solely decide by examining its attributes. Therefore, you have to take % care of disabling protrusion in |verbatim| environments for yourself (that % is, if you don't want to disable protrusion for the typewriter font % altogether, by choosing a different font set). While the \cs{microtypesetup} % command has of course been designed for cases like this, you might find it % tiring to repeat it every time if you are using the |verbatim| environment % frequently. The following line, added to the document's preamble, would serve % the same purpose: %\begin{verbatim} %\g@addto@macro\verbatim{\microtypesetup{activate=false}} %\end{verbatim} % If you are using the \pkg{fancyvrb} or the \pkg{listings} package, this is % not necessary, since their implementation of the corresponding environments % will inhibit protrusion anyway. % %\changes{v1.7}{2005/03/23}{add hint about compatibility} %\paragraph{Compatibility and interaction with other packages:} % The \microtype\ package is supposed to work happily together with all other % \LaTeX\ packages (except for \pkg{pdfcprot}). However, life isn't perfect, so % problems are to be expected. Currently, I am only aware of the following % issues concerning the loading order: %\begin{itemize} % \item If you want to use 8-bit characters in the configuration, you have to % load the \pkg{inputenc} package first. Unicode input is also supported % (when loading \pkg{inputenc} with the |utf8| or the |utf8x| option). % When using multiple input encodings in a document, 8-bit characters in % the settings will only work reliably if you specify the |inputenc| key. %\changes{v2.3a}{2008/02/25}{add hint about \pkg{babel} having to be loaded first} % \item When loading the package with the \opt{babel} option, you must load % the \pkg{babel} package before \microtype. %\end{itemize} % %\changes{v1.8}{2005/06/23}{add hint about error messages} %\paragraph{Possible error messages and how to get rid of them:} %\begin{itemize} %\lstset{deletekeywords={[1]{expansion,auto}},belowskip=-\smallskipamount,frame=none, % xleftmargin=0pt,backgroundcolor=,basicstyle=\MacroFont\footnotesize} %\changes{v1.9a}{2005/11/15}{add explanation for error message in mode} % \item %\begin{verbatim} %! Font csnameendcsname=cmr10+20 at 10.0pt not loadable: Metric (TFM) file not found. %\end{verbatim} % This error message will occur if you are trying to employ font expansion % while creating output. Remember, that \emph{automatic} font expansion % only works when running \pdftex\ in mode. Although expansion is also % possible in mode, it requires that all instances of the expanded fonts % exist on your \TeX\ system. % %\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40} % \item %\begin{verbatim} %! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. %\end{verbatim} % Automatic font expansion has been improved in \pdftex\ 1.40, in that it now % not only works with Type\,1 fonts but also with TrueType, OpenType and even % non-embedded fonts. The above error message indicates either that you are % trying to apply expansion to a bitmap~(|pk|) font, which is still not % possible, or that the font isn't found at all, \eg, because of missing map % entries. % %\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with % regard to older \pdftex\ versions} % \item %\begin{verbatim} %Warning: pdflatex: font ptmr8r cannot be expanded (not an included Type1 font) %\end{verbatim} % and the viewer complains about a missing font, \eg, Adobe Reader thusly: %\begin{verbatim}[aboveskip=\smallskipamount] %Could not find a font in the Resources dictionary - using Helvetica instead. %\end{verbatim} % With \pdftex\ versions older than 1.40, font expansion can only be applied if % the font is actually embedded in the file. If you get the above error % message, your \TeX\ system is not set up to embed (or `download') the base % PostScript fonts (\eg, Times, Helvetica, Courier). In most \TeX\ % distributions, this can be changed in the file \file{updmap.cfg} by setting % |pdftexDownloadBase14| to |true|. % %\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts} % \item %\begin{verbatim} %Warning: pdflatex (file ecrm1000+20): Font ecrm1000+20 at 1200 not found %\end{verbatim} % Furthermore, \pdftex\ versions older than 1.40 require Type\,1 fonts for % automatic font expansion. When you receive a message like the above, you are % probably trying to apply font expansion to a bitmap or TrueType font. With % older \pdftex\ versions, this is only possible if you manually create % expanded instances of the fonts. % %\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max} % and \texttt{font\textunderscore mem\textunderscore size}} % \item %\begin{verbatim} %! Font T1/cmr/m/n/10=ecrm1000 at 10.0pt not loaded: Not enough room left. %\end{verbatim} % Memory parameter `|font_mem_size|' too small. %\ifcmr\else\pagebreak\fi ^^A layout % \item %\begin{verbatim} %! TeX capacity exceeded, sorry [maximum internal font number (font_max)=2000]. %\end{verbatim} % Memory parameter `|font_max|' too small. % \item %\begin{verbatim} %! TeX capacity exceeded, sorry [PDF memory size (pdf_mem_size)=65536]. %\end{verbatim} % Memory parameter `|pdf_mem_size|' too small (\pdftex\ versions older than 1.30). % % When applying micro-typographic enhancement to a large document with a lot of % fonts, \pdftex\ may be running out of some kind of memory. It can be % increased by setting the respective parameter to a larger value. For % web2c-based systems, \eg, \TeX Live, change the settings in \file{texmf.cnf}, % for MiK\TeX, in the file \file{miktex.ini} (2.4 or older) resp. % \file{pdflatex.ini} (2.5 or newer). % %\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and} % expansion is applied to a font} % \item %\begin{verbatim}[deletekeywords={[1]{expansion}}] %pdfTeX warning (font expansion): font should be expanded before its first use %\end{verbatim} % This warning will occur with \pdftex\ versions older than 1.40.4, if tracking % \emph{and} expansion is applied to a font. It is harmless and can be ignored. %\end{itemize} % % % %\section{Contributions} % % I would be glad to include configuration files for more fonts. Preparing such % configurations is quite a time-consuming task and requires a lot of patience. % To alleviate this process, this package also includes a test file that can be % used to check at least the protrusion settings (\file{test-microtype.tex}). % % If you have created a configuration file for another font, or if you have any % suggestions for enhancements in the default configuration files, I~would % gratefully accept them: \mailtoRS. %\iffalse\footnote{^^A ... OK, so nobody has any ... % Should you have lots of \pkg{pdfcprot} configuration files lying around, % I can also provide you with a \TeX\ conversion script. Just ask me.} %\fi % % %\section{Acknowledgments} % % This package would be pointless if \contributor\thanh{} % hadn't created the \pdftex\ programme in the first place, which introduced % the micro-typographic extensions and made them available to the \TeX\ world. % Furthermore, I thank him for helping me to improve this package, and not % least for promoting it in \cite{ThanhPracTeX} and \cite{ThanhEuroTeX07}. I % also thank him and the rest of the \pdftex\ team for refuting the idea that % \TeX\ is dead, and for fixing the bugs I find. % % \contributor Harald Harders has contributed protrusion % settings for Adobe Minion. I~would also like to thank him for a number of bug % reports and suggestions he had to make. % \contributor Andreas B\"uhmann has suggested the % possibility to specify ranges of font sizes, and resourcefully assisted in % implementing this. He also came up with some good ideas for the management of % complex configurations. % \contributor Ulrich Dirr has made numerous suggestion, % especially concerning the new extensions of interword spacing adjustment % and additional character kerning. % My thanks also go to \contributor Maciej Eder % for contributing settings for the encoding. % % I thank \contributor Philipp Lehman for adding to his % \pkg{csquotes} package the possibility to restore the original meanings of % all activated characters, thus allowing for these characters to be used in the % configuration files. % \contributor Peter Wilson kindly provided a % hook in his \pkg{ledmac}/\pkg{ledpar} packages, so that critical editions can % finally also benefit from character protrusion. % % Additionally, the following people have reported bugs, made suggestions or % helped otherwise (in chronological order): % \contributor Tom Kink , % \contributor Herb Schulz , % \contributor Michael Hoppe , % \contributor Gary~L. Gray , % \contributor Georg Verweyen , % \contributor Christoph Bier , % \contributor Peter Muthesius , % \contributor Bernard Gaulle \,\textdagger, % \contributor Adam Kucharczyk , % \contributor Mark Rossi , % \contributor Stephan Hennig , % \contributor Michael Zedler , % \contributor Herbert Vo\ss{} , % \contributor Ralf Stubner , % \contributor Holger Uhr , % \contributor Peter Dyballa , % \contributor Morten H\o gholm , % \contributor Steven Bath , % \contributor Daniel Flipo , % \contributor Michalis Miatidis , % \contributor Sven Naumann , % \contributor Ross Hetherington , % \contributor Geoff Vallis , % \contributor Steven~E. Harris , % \contributor Karl Berry , % \contributor Peter Meier , % \contributor Nathan Rosenblum % and % \contributor Wolfram Schaalo . % % %\begin{thebibliography}{} % \bibitem[Th\`anh 2000]{ThanhThesis} % \thanh, `Micro-typographic extensions to the \TeX\ typesetting system', % \newblock Diss. Masaryk University Brno 2000, % \newblock in: \textit{TUGBoat}, vol.~21(2000), no.~4, pp.~317--434. % \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb21-4/tb69thanh.pdf}) % %\iffalse ^^A obsolete % \bibitem[Th\`anh 2001]{ThanhTUG} % \thanh, `Margin Kerning and Font Expansion with \pdftex', % \newblock in: \textit{TUGBoat}, vol.~22(2001), no.~3: `Proceedings of the % 2001 Annual Meeting', pp.~146--148. % \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb22-3/tb72thanh.pdf}) %\fi % % \bibitem[Th\`anh 2004]{ThanhPracTeX} % \thanh, `Micro-typographic extensions of \pdftex\ in practice', % \newblock in: \textit{TUGBoat}, vol.~25(2004), no.~1: `Proceedings of the % Practical \TeX\ 2004 Conference', pp.~35--38. % \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb25-1/thanh.pdf}) % %\iffalse % \bibitem[Th\`anh 2005]{ThanhEuroTeX05} % \thanh, `Experiences with micro-typographic extensions of \pdftex\ in practice', % \newblock in: Euro\TeX\ 2005 Proceedings % ^^A 15th~Annual Meeting of the European \TeX\ Users, % ^^A March~7 -- March~11, 2005, Abbaye des Pr\'emontr\'es, Pont-\`a-Mousson, % [=~\textit{TUGBoat}, vol.~27(2006), no.~0], % pp.~159--164. % \newblock (Online at \url{http://www.tug.org/TUGboat/Articles/tb27-0/thanh.pdf}) % ^^A = \url{http://www.dante.de/dante/events/eurotex/papers/TUT07.pdf} %\fi % % \bibitem[Th\`anh 2008]{ThanhEuroTeX07} ^^A as yet only available for TUG members % \thanh, `Font-specific issues in \pdftex', % \newblock in: \textit{TUGBoat}, vol.~29(2008), no.~1: % `EuroBacho\TeX\ 2007 Proceedings', pp.~36--41. % \newblock (Online -- for members -- at % \url{https://www.tug.org/members/TUGboat/tb29-1/tb91thanh-fonts.pdf}) % % \bibitem[\pdftex\ manual]{pdftexman} % \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, % \emph{The \pdftex\ user manual}, % \newblock 25 January 2007. % \newblock (\ctanurl{systems/pdftex/}; % latest version at \url{http://sarovar.org/projects/pdftex/}) % ^^A or even \url{http://foundry.supelec.fr/scm/?group_id=23} % % \bibitem[Fontname]{fontname} % Karl Berry, \emph{Fontname. Filenames for \TeX\ fonts}, % \newblock September 2005. % \newblock (\ctanurl{info/fontname/fontname.pdf}) % % \bibitem[\LaTeXe\ font selection]{fntguide} % \LaTeX3 Project Team, \emph{\LaTeXe\ font selection}, % \newblock 27 November 2005. % \newblock (\ctanurl{macros/latex/doc/fntguide.pdf}) % % \bibitem[\pkg{pdfcprot}]{pdfcprot} % Carsten Schurig, Tobias Schlemmer, \emph{The \pkg{pdfcprot}|.sty| package}, % \newblock 10 June 2005. % \newblock (\ctanurl{macros/latex/contrib/pdfcprot/}) % % \bibitem[\pkg{soul}]{soul} % Melchior Franz, \emph{The \pkg{soul} package}, % \newblock 17 November 2003. % \newblock (\ctanurl{macros/latex/contrib/soul/}). %\changes{v2.3a}{2008/01/06}{mention \pkg{soulutf8}} % \newblock See also Heiko Oberdiek's extension of this package, \pkg{soulutf8}, % which adds Unicode support. % \newblock (\ctanurl{macros/latex/contrib/oberdiek/}) %\end{thebibliography} % % %\ifcmr\else\enlargethispage\baselineskip\fi ^^A layout %\section{Short history} %\changes{v1.5}{2004/12/11}{add `Short history'} % % The comprehensive list of changes can be % \expandafter\ifx\csname r@sec:changes\endcsname\relax % obtained by running `\texttt{makeindex \mbox{-s gglo.ist} % \mbox{-o microtype.gls} microtype.glo}'\else % found in appendix~\ref{sec:changes}\fi. % The following is a list of all changes relevant in the user land; bug and % compatibility fixes are swept under the rug. % %\newenvironment{History} % {\list\labelitemi % {\leftmargin 0pt % \parsep 0pt % \def\makelabel##1{\hss\llap{##1}}}} % {\endlist} %\newcommand\Version[2]{ % \VersionDate{#1}{#2} % \vskip\topsep % \pagebreak[2] % \item[#1](#2) % \vskip\topsep % \nopagebreak} %\newcommand\VersionDate[2]{^^A needed in the Change history % \global\expandafter\def\csname MTversiondate#1\endcsname{#2}} % %\begin{History} %\VersionDate{2.3b}{\filedate} % %\VersionDate{2.3a}{2008/02/29} % %\Version{2.3}{2007/12/23} % \item New key `|outer kerning|' for \cs{SetTracking} to customise outer kerning % [section~\ref{sub:tracking}] % \item Adjust protrusion settings for tracking even if protrusion is not enabled % \item New option `\opt{verbose}|=silent|' to turn all warnings into mere messages % [section~\ref{sub:options-misc}] % \item The \letterspace\ package also works with \pkg{eplain} or \pkg{miniltx} % [section~\ref{sec:lettersp}] % %\Version{2.2}{2007/07/14} % \item Improvements to tracking/letterspacing: retain kerning (with \pdftex\ 1.40.4); % automatically adjust protrusion settings % \item New key `|no ligatures|' for \cs{SetTracking} to disable selected or % all ligatures (with \pdftex\ 1.40.4) % [section~\ref{sub:tracking}] % \item New keys `|spacing|' and `|outer spacing|' for \cs{SetTracking} to % customise interword spacing % [section~\ref{sub:tracking}] % \item Possibility to expand a font with different parameters (with \pdftex\ 1.40.4) % ^^A ; new option `\opt{copyfonts}' % [section~\ref{sub:expansion}] % \item New optional argument for \cs{DisableLigatures} to disable selected ligatures only % [section~\ref{sec:disable-ligatures}] % \item New command \cs{DeclareMicrotypeVariants} to specify variant suffixes % [section~\ref{sub:config-file}] % \item New command \cs{textmicrotypecontext} as a wrapper for \cs{microtypecontext} % [section~\ref{sec:context}] % \item Protrusion settings for Bitstream Letter Gothic % \item Basic support for \luatex\ (if generated with the |lua| option) % %\Version{2.1}{2007/01/21} % \item New command \cs{lslig} to protect ligatures in letterspaced text % [section~\ref{sec:lettersp}] % %\Version{2.0}{2007/01/14} % \item Support for the new extensions of \pdftex\ version 1.40: % tracking/letterspacing, adjustment of interword spacing (glue), % and additional kerning % (new commands \cs{SetTracking}, \cs{SetExtraSpacing}, \cs{SetExtraKerning}; % new options `\opt{tracking}', `\opt{spacing}', `\opt{kerning}') % [sections~\ref{sub:tracking}, \ref{sub:spacing}, \ref{sub:kerning}] % \item New commands \cs{textls} and \cs{lsstyle} for letterspacing, % new option `\opt{letterspace}' % [sections~\ref{sub:option-tracking}, \ref{sec:lettersp}] % \item New option `\opt{babel}' for automatic micro-typographic adjustment to % the selected language % [sections~\ref{sub:options-misc}, \ref{sec:context}] % \item New font sets: `|smallcaps|', `|footnotesize|', `|scriptsize|' % [section~\ref{sec:font-sets}; table~\ref{tab:predefined-font-sets}] % \item New package `\letterspace' providing the commands for robust and % hyphenatable letterspacing % [section~\ref{sec:lettersp}] % %\VersionDate{1.9f}{2006/09/09} % %\Version{1.9e}{2006/07/28} % \item New key `|inputenc|' to specify the lists' input encodings % [section~\ref{sec:fine-tuning}] % \item Protrusion settings for Euler math fonts % %\Version{1.9d}{2006/05/05} % \item Support for the Central European encoding % (inheritance, generic protrusion settings, contributed by Maciej Eder; % protrusion settings for Times) % \item Protrusion settings for various Euro symbol fonts (Adobe, , \pkg{marvosym}) % \item Support for Unicode input in the configuration (\pkg{inputenc}/|utf8|) % %\Version{1.9c}{2006/02/02} % \item Protrusion settings for Garamond % %\VersionDate{1.9b}{2006/01/20} % %\Version{1.9a}{2005/12/05} % \item Defer setup until the end of the preamble; consequently, no need to % change font defaults before loading \microtype, or to put it the other % way round, \microtype\ may now be loaded at any time % ^^A ; new option `\opt{defersetup}' % \item Inside the preamble, \cs{microtypesetup} accepts all package options % [section~\ref{sub:options-cmd}] % \item Protrusion settings for encoded Charter % %\Version{1.9}{2005/10/28} % \item New command \cs{DisableLigatures} to disable ligatures of fonts % (requires \pdftex\ version 1.30 or later) % [section~\ref{sec:disable-ligatures}] % \item New command \cs{microtypecontext} to change the configuration context; % new key `|context|' for the configuration commands % [section~\ref{sec:context}] % \item New key `|font|' to add single fonts to the font sets % [section~\ref{sec:font-sets}] % \item New key `|preset|' to set all characters to the specified value before % loading the lists % \item Value `|relative|' renamed to `|character|' for `|unit|' keys % \item Support for the Polish encoding (protrusion, expansion, inheritance) % \item Support for the Vietnamese encoding (protrusion, expansion, inheritance) %^^A \item `\opt{DVIoutput}' option will work with \TeX Live 2004 % %\Version{1.8}{2005/06/23} %^^A \item If font substitution has occurred, the settings for the substitute will %^^A be used instead of those for the selected font % \item New command \cs{DeclareMicrotypeSetDefault} to declare the default font sets % [section~\ref{sec:font-sets}] % \item New option `\opt{config}' to load a different configuration file % [section~\ref{sub:options-misc}] % \item New option `\opt{unit}' to measure protrusion factors relative to a % dimension instead of the character width %