From a8a3c9df9e509bf99f4224ae9ed08b448e7a38c6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Jan 2006 23:55:09 +0000 Subject: trunk/Master/texmf-dist/source/latex/microtype git-svn-id: svn://tug.org/texlive/trunk@388 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/microtype/microtype.dtx | 11018 +++++++++++++++++++ .../source/latex/microtype/microtype.ins | 106 + 2 files changed, 11124 insertions(+) create mode 100644 Master/texmf-dist/source/latex/microtype/microtype.dtx create mode 100644 Master/texmf-dist/source/latex/microtype/microtype.ins (limited to 'Master/texmf-dist/source/latex/microtype') diff --git a/Master/texmf-dist/source/latex/microtype/microtype.dtx b/Master/texmf-dist/source/latex/microtype/microtype.dtx new file mode 100644 index 00000000000..4265e11964a --- /dev/null +++ b/Master/texmf-dist/source/latex/microtype/microtype.dtx @@ -0,0 +1,11018 @@ +%\iffalse meta-comment +% -*- TeX:DTX:UK -*- +% smartQuote: english +% $Id: microtype.dtx,v 1.25 2005-10-28 16:31:54+02 schlicht Exp schlicht $ +% ----------------------------------------------------------------------- +% The `microtype' package +% An interface to the micro-typographic extensions of pdfTeX +% Copyright (c) 2004, 2005 R Schlicht +% +% This work may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, either version 1.3 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.3 or later +% is part of all distributions of LaTeX version 2003/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 file microtype.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. +% ----------------------------------------------------------------------- +% +%<*driver> +\expandafter\newif\csname ifbeta\endcsname +%\betatrue +\ProvidesFile{microtype.dtx}[2005/10/28 v\ifbeta 2.0-beta \else 1.9 \fi] +% +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesPackage{microtype} +% [2005/10/28 v2.0-beta Micro-typography with pdfTeX (RS)] +% [2005/10/28 v1.9 Micro-typography with pdfTeX (RS)] +%<*config|cfg-u> +%\ProvidesFile +% {microtype.cfg}[2005/08/16 v1.6 microtype main configuration file (RS)] +% {mt-bch.cfg}[2005/03/15 v1.3 microtype config. file: Bitstream Charter (RS)] +% {mt-cmr.cfg}[2005/08/16 v1.8 microtype config. file: Computer Modern (RS)] +% {mt-euf.cfg}[2005/06/01 v1.0 microtype config. file: AMS Euler Fraktur (RS)] +% {mt-eus.cfg}[2005/06/01 v1.0 microtype config. file: AMS Euler script (RS)] +% {mt-msa.cfg}[2005/06/01 v1.0 microtype config. file: AMS (a) (RS)] +% {mt-msb.cfg}[2005/06/01 v1.0 microtype config. file: AMS (b) (RS)] +% {mt-pad.cfg}[2005/03/15 v1.4a microtype config. file: Adobe Garamond (RS)] +% {mt-pmn.cfg}[2004/03/15 v1.1b microtype config. file: Adobe Minion (HH)] +% {mt-ppl.cfg}[2005/08/16 v1.5 microtype config. file: Palatino (RS)] +% {mt-ptm.cfg}[2005/08/16 v1.5 microtype config. file: Times (RS)] +% +% +%<*driver> +\documentclass[10pt,a4paper]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage{textcomp} +\usepackage{array} + \newcolumntype{L}[1]{p{#1}<{\raggedright}} +\expandafter\newif\csname ifbooktabs\endcsname +\IfFileExists{booktabs.sty} + {\usepackage{booktabs}\booktabstrue}{} +\IfFileExists{url.sty} + {\usepackage{url}} + {\def\url##1{\texttt{##1}}} +% Let's abolish CM! We use Charter and Letter Gothic +% (for the pre-built documentation on CTAN): +% \def\rmdefault{bch} +% \def\ttdefault{blg} + \usepackage[T1]{fontenc} +\ifbeta + \PassOptionsToPackage{kerning=true}{microtype} +\fi + \usepackage[expansion=false]{microtype} % it's a web document + \DeclareMicrotypeSet* + [ protrusion ]* + { encoding = {*, TS1, OMS}, + family = {rm*, tt*, cmsy}, + size = {footnotesize,small,normalsize} + } +\ifbeta + \DeclareMicrotypeSet* + [ kerning ] + { lettergothic } + { encoding = T1, + family = blg } + \SetExtraKerning + { encoding = T1, + family = blg } + { + _ = {100,100}, + } +\else + \newcommand\textls[2][]{#2} + \let\lsstyle\relax +\fi +\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.92} +\makeatletter +\ifbeta + \usepackage[color]{changebar} + \cbcolor{thered} + \def\betastart{\ifbeta\cbstart} + \def\betaend{\cbend\fi} +\else + \let\betastart\ifbeta + \let\betaend\fi +\fi +% layout +\frenchspacing +\expandafter\newif\csname ifcharter\endcsname +\def\@tempa{bch} +\ifx\rmdefault\@tempa + \chartertrue + \def\bfdefault{b} + \def\PackageFont{\ttfamily} + \def\match{{\large\raisebox{-.15em}{\textbullet}}} + \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} + \newcommand*\textgeq{% being picky... + \raisebox{.2ex}{\kern1pt\underline + {\kern-1pt\textgreater\kern-1pt}\kern1pt}} + \linespread{1.07} +\else + \def\PackageFont{\sffamily} + \def\match{\textbullet} + \newcommand*\textgeq{$\geq$} + \linespread{1} +\fi +\normalfont +\setlength\textheight{\topskip} +\addtolength\textheight{44\baselineskip} +\def\paragraph{\@startsection + {paragraph}{4}{0pt}% + {3.25ex plus 1ex minus .2ex}{-1em}% + {\normalfont\normalsize\itshape}} +% macrocode +\MacroTopsep=0pt +\MacrocodeTopsep=3pt +\settowidth\MacroIndent{\scriptsize 000\ } +\def\theCodelineNo{\reset@font\color{thegrey}\scriptsize\arabic{CodelineNo}} +\def\MacroFont{\ttfamily\small} +\def\AltMacroFont{\ttfamily\footnotesize} +\tolerance=400 +\def\ImplementationSettings{% + \linespread{1}% + \tolerance=1000 + \hfuzz=20pt + \def\MacroFont{\ttfamily\footnotesize}% + \def\macro@font{\ttfamily\footnotesize}% +} +% 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[30]{\MakeUppercase{##1}}}{}} + \def\subsectionmark##1{\markright{: ##1}}} +\pagestyle{MTheadings} +% toc +\let\l@section@\l@section +\def\l@section{\vskip -.5ex\l@section@} +\let\l@subsection@\l@subsection +\def\l@subsection{\vspace{.25ex}\l@subsection@} +\def\l@subsubsection#1#2{% + \leftskip 3.8em + \rightskip 2em plus 1fil + \parindent 0pt + {\let\numberline\@gobble{\small[#1~--~#2]}}} +\def\l@table{\@dottedtocline{1}{0pt}{1.5em}} +\def\@pnumwidth{1.7em} +\long\def\tableofcontents{% + \section*{\contentsname }\ifPDF\pdfbookmark[1]{\contentsname}{section.TOC}\fi + \@mkboth{\textls[30]{\MakeUppercase{\contentsname}}}{}% + \@starttoc{toc}} +\long\def\listoftables{% + \section*{\listtablename }\ifPDF\pdfbookmark[1]{\listtablename}{section.LOT}\fi + \@mkboth{\textls[30]{\MakeUppercase{\listtablename}}}{}% + \@starttoc{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 15pt + \parindent -15pt + \everypar{\parindent 0pt}% + \leavevmode\hbox to 15pt{\@thefnmark\hss}#1} +\skip\@mpfootins=0.5\baselineskip +% lists +\def\descriptionlabel#1{\hspace\labelsep\normalfont#1} +\def\@listi{\leftmargin\leftmargini + \parsep 4.5pt plus 1pt minus 1pt + \topsep 4.5pt plus 1pt minus 1pt + \itemsep 0pt} +\let\@listI\@listi +\setlength\leftmargini{15pt} +\newenvironment{options} + {\list{}{\leftmargin 0pt + \labelwidth 0pt + \labelsep 1em + \itemindent \labelsep}} + {\endlist} +% tables +\setlength\tabcolsep{2pt} +%\def\arraystretch{1.2} +\long\def\@makecaption#1#2{% + \sbox\@tempboxa{\footnotesize\itshape#1: #2}% + \hb@xt@\hsize{\box\@tempboxa\hfil}% + \vskip 6pt} +% index and change log +\IndexPrologue{\section{Index}% + Numbers written in italic refer to the page where the corresponding entry is + described; numbers underlined refer to the code line of the definition; + numbers in roman refer to the code lines where the entry is used.} +\IfFileExists{multicol.sty}{ + %\raggedcolumns + \setcounter{finalcolumnbadness}{100} + \setcounter{IndexColumns}{2} + \def\IndexMin{12\baselineskip} + \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}] + [6\baselineskip] + \GlossaryParms + \rightskip 15pt plus 10pt + \let\item\@idxitem + \ignorespaces \makeatletter \scan@allowedfalse}% + \def\subitem{\par\hangindent 25pt}% + \def\subsubitem{\subitem\hspace*{15pt}}} + \GlossaryPrologue{% + \section{Change History}\label{sec:changes}% + \vspace*{-2\multicolsep}} +}{% + \GlossaryPrologue{% + \section{Change History}\label{sec:changes}} +} +% 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\DescribeValues#1#2{% + \let\@tempa\@empty + \let\Option@default\@empty + \@for\@tempb:=#2\do{% + \expandafter\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} +\def\OptionSep{,\,} +\def\MacroSep{\space} +\def\PrintValues[#1]{{\MacroFont\expandafter\@gobble\@tempa\hfill #1}% + \\*[.25\baselineskip]} +\def\CatIndex#1#2{\index{#2\actualchar{\protect\ttfamily #2} (#1)\encapchar hyperpage}} +\def\SpecialOptionIndex#1{\@bsphack + \CatIndex{option}{#1}% + \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\IndexNewif#1{\@bsphack + \expandafter\SpecialMainIndex\expandafter{\csname #1true\endcsname}% + \expandafter\SpecialMainIndex\expandafter{\csname #1false\endcsname}% + \@esphack} +\def\PrintDescribeMacro#1{\strut\MacroFont\color{thegreen}\string #1} +\def\PrintDescribeOption#1{\strut\MacroFont\color{thered}#1} +\def\Key#1{{\color{thered}\ttfamily#1}} +\def\Variable#1{$\langle${\rmfamily\itshape\small#1}$\rangle$} +\DeclareRobustCommand\pkg[1]{{\PackageFont#1}\@bsphack\CatIndex{package}{#1}\@esphack} +\DeclareRobustCommand\opt[1]{{\ttfamily#1}\@bsphack\CatIndex{option}{#1}\@esphack} +\DeclareRobustCommand\file[1]{{\ttfamily#1}} +% ... and whistles +\expandafter\newif\csname iflistings\endcsname +\IfFileExists{listings.sty}{ + \usepackage{listings} + \lstset{% + gobble=1, + columns=flexible, + keepspaces=true, + basicstyle=\MacroFont, + keywords=[0]{\microtypesetup,\DeclareMicrotypeSet,\UseMicrotypeSet, + \DeclareMicrotypeSetDefault,\SetProtrusion,\SetExpansion,\DisableLigatures, + \DeclareCharacterInheritance,\DeclareMicrotypeAlias,\LoadMicrotypeFile, + \microtypecontext,\Microtype@Hook}, + keywordstyle=[0]\color{thegreen}, + keywords=[1]{protrusion,expansion,activate,DVIoutput,draft,final,verbose, + config,factor,auto,stretch,shrink,step,selected,unit}, + keywordstyle=[1]\color{thered}, + comment=[l]\%, + commentstyle=\color{thegrey}, + escapeinside=<>, + frame=single, + framerule=0pt, + xleftmargin=\fboxsep, + xrightmargin=\fboxsep, +% aboveskip=\smallskipamount, + belowskip=\smallskipamount, + backgroundcolor=\color{theshade} + } + \let\verbatim\relax + \lstnewenvironment{verbatim}{}{} + \listingstrue +}{ + \let\lstset\@gobble +} +\ifbeta + \lstset{ + morekeywords=[0]{\SetExtraSpacing,\SetExtraKerning,\textls,\lsstyle, + \DeclareMicrotypeBabelHook}, + morekeywords=[1]{spacing,kerning,letterspacing,babel} + } +\fi +\ifbeta + \def\todo{\changes{zTo Do}{0000/00/00}} +\else + \def\todo#1{} +\fi +\def\Indexing{\let\special@index\codeline@wrindex} +\def\NoIndexing{\let\special@index\@gobble} +\def\GeneralChanges#1{\edef\generalname{\if!#1General\else#1\fi}} +% Heiko Oberdiek's workaround from latexbugs (latex/3540): +\begingroup + \def\x\begingroup#1\@nil{% + \endgroup + \def\DoNotIndex{% + \begingroup + \@makeother\#% + \@makeother\$% + \@makeother\%% + \@makeother\&% + \@makeother\^% + \@makeother\_% + \@makeother\|% + \@makeother\~% + \@makeother\ % + % \@makeother\{\@makeother\} cannot be used here + #1}}% +\expandafter\x\DoNotIndex\@nil +% fancy PDF document +\expandafter\newif\csname ifPDF\endcsname +\ifx\pdfoutput\undefined\else\ifx\pdfoutput\relax\else + \ifcase\pdfoutput\else\PDFtrue\fi\fi\fi +\ifPDF +% \ifx\eTeXversion\undefined \else +% \usepackage{pdfcolmk}% errors when not using etex (conflict with multicol) +% \fi + \usepackage{graphicx} + \usepackage[ + bookmarks=true, + colorlinks=true, + linkcolor=theblue, + urlcolor=theblue, + citecolor=theblue, + hyperindex=false, + hyperfootnotes=false, + pdftitle={The microtype package}, + pdfauthor={R Schlicht }, + pdfsubject={An interface to the micro-typographic extensions of pdfTeX}, + pdfkeywords={TeX, LaTeX, pdftex, typography, micro-typography, + character protrusion, margin kerning, font expansion, + kerning, spacing, letterspacing} + ]{hyperref} + \def\usage#1{\textbf{\textit{\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{\href{http://www.tex.ac.uk/tex-archive#1}{\texttt{#1}}} + \def\mailto#1{\href{mailto:#1}{\texttt{#1}}} + \def\mailtoRS{\href{mailto: R Schlicht?subject=microtype \fileversion} + {\texttt{w.m.l@gmx.net}}} +\else + \let\hyperpage\relax + \def\texorpdfstring#1#2{#1} + \def\ctanurl#1{\url{#1}} + \def\mailto#1{\texttt{#1}} + \def\mailtoRS{\mailto{w.m.l@gmx.net}} + \let\nolinkurl\texttt +\fi +\hyphenation{Ha-rald Har-ders Ber-nard Ku-char-czyk} +% abbreviations +\def\microtype{{\PackageFont microtype}} +\def\pdftex{\texorpdfstring{pdf\kern.05em\TeX}{pdfTeX}} +\def\etex{\mbox{e-\TeX}} +\DeclareRobustCommand\thanh{H\`an Th\^e\llap{\raisebox{0.5ex}{\'{}}} Th\`anh} +\DeclareRobustCommand\acro[1]{\texorpdfstring + {{\ifdim\f@size pt=1\@ptsize pt\relax\small\fi + \ifcharter\textls[30]{#1}\else#1\fi}}{#1}} +\def\spaceout#1{\ifx#1\relax\else#1\kern.06em\expandafter\spaceout\fi} +\def\ams{\acro{AMS}} +\def\ctan{\acro{CTAN}} +\def\dvi{\acro{DVI}} +\def\nfss{\acro{NFSS}} +\def\pdf{\acro{PDF}} +\def\tI{\acro{T1}} +\def\tV{\acro{T5}} +\def\otI{\acro{OT1}} +\def\otIV{\acro{OT4}} +\def\lyI{\acro{LY1}} +\def\tsI{\acro{TS1}} +\def\oml{\acro{OML}} +\def\oms{\acro{OMS}} +\def\U{\acro{U}} +\def\ascii{\acro{ASCII}} +\def\eg{e.\,g.} +\def\ie{i.\,e.} +\makeatother +\CodelineIndex +\EnableCrossrefs +\RecordChanges +%\OnlyDescription +\begin{document} + \DocInput{microtype.dtx} +\end{document} +% +% \fi +% +% ^^A ------------------------------------------------------------------------- +%\changes{v1.0}{2004/09/11}{Initial version} +%\GeneralChanges{Documentation} +% +% \GetFileInfo{microtype.dtx} +% \title{\IfFileExists{mt-logo.pdf}{\vspace{-2\baselineskip}^^A +% \includegraphics{mt-logo}\\[3.5\baselineskip]}{}^^A +% \textls[30]{The \microtype\ package}\\[.3\baselineskip]\large +% An interface to the micro-typographic extensions of \pdftex} +% \author{R Schlicht\quad\mailtoRS} +% \date{\fileversion\ --- \filedate} +% +% \maketitle +% \thispagestyle{empty} +% +%\begin{abstract} +%\noindent +% The \microtype\ package provides an interface to the micro-typographic +% extensions of \pdftex: most prominently, character protrusion and font +% expansion, furthermore +%\betastart +% the adjustment of interword spacing and additional kerning, as well as +%\betaend +% the possibility to disable all ligatures of a font.\ifbeta\else\footnote{ +% A preview of the next version with support for even more micro-typographical +% extensions is also included in this package. Footnote~\ref{fn:beta} on +% page~\pageref{fn:beta} contains the details.}\fi\ +% It allows to apply these features to customizable 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 settings for Computer Modern Roman, +% Palatino, Times, Adobe Garamond and Minion, Bitstream Charter, and the +% \ams\ math fonts, as well as some generic settings for unknown 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 require \pdftex\ 1.30^^A +%\betastart, +% adjustment of interword spacing and of kerning requires version 1.3x^^A +%\betaend. +% The package will by default enable the features that can safely be assumed to +% work. +% +%\betastart +%\bigskip\noindent\bfseries +% This is a beta version! New features are marked with a red bar. +%\betaend +%\end{abstract} +% +%\newpage +%\tableofcontents +%\listoftables +% +%\newpage +%\section{Micro-Typography with \pdftex}\label{sec:micro-type} +% +% \pdftex, the \TeX\ extension written by \thanh, introduces two 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: \textit{character +% protrusion} (also known as margin kerning) and \textit{font expansion}. +% Quoting \thanh's thesis: +% +%\begin{quote}\small +%\ifPDF +% \dimen0=\lpcode\font`\`em +% \divide\dimen0 by 500 ^^A double +% \hskip-\dimen0 ^^A cheat! +%\fi +% `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}] +%\end{quote} +% +% Both these features have been lacking a simple \LaTeX\ user interface for +% quite some time. Then, the \pkg{pdfcprot} package was released [\cite{pdfcprot}], +% which allowed \LaTeX\ users to employ character protrusion without having to +% mess much with the internals. +% +% Font expansion, however, was still most difficult to utilize, since it +% required that the font metrics are available in all levels of expansion. +% Therefore, anybody who wanted to use 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 can be expected to +% prove 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. +% +%\betastart +%\bigskip +% 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.3x introduced the \emph{adjustment of interword spacing}, additional +% \emph{kerning settings} and the possibility to \emph{disable all ligatures} +% of a font. +% +% 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 words ends with an +% `r', the following space should be a tiny bit smaller than that following an, +% say, `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~\mbox{--,} \pdftex\ provides the possibility to modify these +% parameters independently from one other. 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 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 (and will of course +% apply as usual), this additional kerning is based on single characters, not +% on character pairs. +% +% Another application for this feature is letterspacing, which was even more +% difficult to achieve on the macro level. This package introduces a new +% command \cs{textls}, which can be used much like the normal text commands. +%\betaend +% +% Finally, the possibility to disable all ligatures of a font has been introduced. +% This may be useful when using typewriter fonts. +% +%\ifcharter\else\enlargethispage\baselineskip\fi ^^A layout +%\bigskip\noindent +% The \microtype\ package provides an interface to all these micro-typographic +% extensions.\footnote{ +% Therefore, it is an alternative, not a supplement, to the \pkg{pdfcprot} +% package, which provides an interface to character protrusion.} +% All micro-typographic aspects may be customized to your taste and needs in a +% straightforward manner. The next chapters will present a survey of all +% options and customization possibilities. +% +% +%\section{Invoking the Package} +% +% There is nothing surprising in loading this package: +%{\lstset{morekeywords=[1]{microtype}} +%\begin{verbatim} +%\usepackage{microtype} +%\end{verbatim}} +%\noindent +% 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. +% +% +%\section{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). +% +%\subsection{Micro-Typographic Options}\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 \dvi\ (see section~\ref{sub:options-misc}). +% +% 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 \pdf\ files with a +% new \pdftex): +%\begin{verbatim} +%\usepackage[protrusion=true,expansion=true]{microtype} +%\end{verbatim} +%\begin{verbatim} +%\usepackage[protrusion,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 that is not +% desired, you may pass the value |compatibility| to the \opt{protrusion} +% and/or \opt{expansion} options. Typographically, however, the results may be +% suboptimal. +% +%\enlargethispage\baselineskip ^^A layout +% 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. +% +%\betastart +%\bigskip +%\Describe{Option}{spacing}{true,!false,:font set name} +%\DescribeOption{kerning} +% The new extensions of interword spacing and additional kerning adjustment do +% not feature a compatibility layer. 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 extension is enabled. +%\betaend +% +%\bigskip\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{Options for 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). +% +%\bigskip +%\Describe{Option}{unit}{!character,:dimension} +% This option is described in section~\ref{sub:protrusion}, apropos the command +% \cs{SetProtrusion}. Use with care. +% +% +%\subsection{Options for 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 \pdf; +% 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[p.~20]{pdftexman}). If expanded +% instances of the fonts are available, they will be used regardless whether +% \opt{auto} is true or not. +% +%\changes{v1.9}{2005/08/27}{add remark about Type\,1 fonts required for +% automatic font expansion} +% Automatic font expansion requires fonts in Type\,1 format. Therefore, if you +% are using the Computer Modern Roman fonts in \tI\ encoding\footnote{ +% En passant, it may be noted that Type\,1 format and \tI\ 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}). +% +%\bigskip +%\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. +% +%\pagebreak ^^A layout +%\bigskip +%\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} +% +%\bigskip +%\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. +% +% Beginning with version 1.5, where this option was introduced, it 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{Miscellaneous Options}\label{sub:options-misc} +% +%\Describe{Option}{DVIoutput}{true,!false} +% \pdftex\ is not only able to generate \pdf\ output but can also spit out \dvi\ +% files.\footnote{ +% \TeX\ systems are beginning to switch to pdfe\TeX\ as the default engine +% even for \dvi\ 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 \pdf\ 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 \dvi\ files, font expansion has to be enabled explicitly. +% \emph{Automatic} font expansion will not work because dvips (resp. the \dvi\ +% viewer) is not able to generate the expanded fonts on the fly. +% +%\bigskip +%\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}. 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. +% +%\bigskip +%\Describe{Option}{verbose}{true,!false,errors} +% Information on the settings used for each font will be written into the log +% file if you enable the \opt{verbose} option, which is disabled by default. +% +% 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. +% +%\bigskip +%\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|. +% +%\betastart +%\bigskip +%\Describe{Option}{letterspacing}{:number}[100] +% This option changes the default amount that the command \cs{textls}, which is +% described below in section~\ref{sec:lettersp}, will space out its argument. +% The amount is specified in thousandth of 1em. +% +%\bigskip +%\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. +%\betaend +% +% +%\subsection{Changing Settings Later}\label{sec:options-cmd} +% +%\Describe{Macro}{\microtypesetup}{key\,=\,value list} +% This command may be used in the document body to change the general settings +% of the micro-typographic extensions. It accepts the keys: \Key{expansion}, +% \Key{protrusion} and \Key{activate}, which in turn may receive the values +% |true|, |false|, |compatibility| or |nocompatibility| (but not the name of a +% font set). +%\ifbeta +% For \Key{spacing} and \Key{kerning}, there is no compatibility level, +% therefore, only the values |true| and |false| are admissible here. +%\fi +% Using this command, you could for instance temporarily disable font expansion +% by saying: +%\begin{verbatim} +%\microtypesetup{expansion=false} +%\end{verbatim} +% +% +%\section{Declaring Font Sets}\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 expanded. You +% may want to customize the set of fonts that should get the benefit of +% micro-typographic treatment. This can be achieved by specifying attributes of +% the font that have to be matched for them to be taken into account. +% +%\bigskip +%\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 +% set can subsequently be activated by calling: +%\iflistings +%\begin{verbatim} +%\UseMicrotypeSet[<\Variable{features}>]{<\Variable{set name}>} +%\end{verbatim} +%\else +%\begin{flushleft}\small +%|\UseMicrotypeSet[|\Variable{features}|]{|\Variable{set name}|}| +%\end{flushleft} +%\fi +% +%\bigskip\noindent +% 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 \nfss\ +% 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 = {T1,OT1,LY1}, +% family = {rm*,sf*}, +% series = {m}, +% size = {normalsize,footnotesize,small,large} +% } +%\end{verbatim} +% If you now call +%{\lstset{deletekeywords=[1]{expansion}} +%\begin{verbatim} +%\UseMicrotypeSet[expansion]{basictext} +%\end{verbatim}} +%\noindent +% in the document's preamble, only fonts in the text encodings \tI, \otI\ or +% \lyI, 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 expanded. 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 = {T1,OT1,LY1,TS1} } +%\end{verbatim} +% is far less restrictive. The only condition is that the encoding must match. +% +% If a value is followed by an asterisk (like `|rm*|' and `|sf*|' in the example +% above), it does not designate an \nfss\ code, but will expand to the current +% |\|\meta{value}|default|, \eg\ \cmd{\rmdefault}.\footnote{ +% Note that this expansion will take place immediately, so you should make +% all relevant changes \emph{before} loading the \microtype\ package.} +% For example, if you want to include the bold font, too, you should say `|bf*|' +% instead of `|b|' (\cmd{\bfdefault} for Computer Modern is `|bx|', while for +% other fonts, it might be `|b|' or even `|sb|'). A single asterisk means +% |\|\meta{characteristic}|default|, \eg\ \cmd{\encodingdefault}, respectively +% \cmd{\normalsize} for the size axis. +% +% Sizes may be either 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-|'). +% +%\bigskip\noindent +% Additionally to this declaration scheme, you can add single fonts to +% a set using the `|font|' key, which expects the concatenation of all font +% characteristics, 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: +%{\lstset{deletekeywords=[1]{protrusion}} +%\begin{verbatim} +%\DeclareMicrotypeSet* +% [ protrusion ] +% { myset } +% { encoding = T1, +% family = rm*, +% font = {T1/tt*/m/n/*, +% T1/tt*/m/it/*} } +%\end{verbatim}} +%\noindent +% As you can tell from the example, the asterisk notation is also allowed for +% the |font| key. Size selection commands are possible, too, however, ranges are +% not allowed. +% +%\begin{table}\small +%\caption{Predefined font sets}\label{tab:predefined-font-sets} +%\begin{tabular}{@{}L{65pt}L{74pt}*3{L{43pt}}L{67pt}@{}} +%\ifbooktabs\toprule\else\hline\fi +% \footnotesize Set name +% & \multicolumn{5}{l}{\footnotesize Font attributes}\\ +%\ifbooktabs\cmidrule{2-6}\fi +% & \footnotesize Encoding +% & \footnotesize Family +% & \footnotesize Series +% & \footnotesize Shape +% & \footnotesize Size\\ +%\ifbooktabs\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3} +% \cmidrule(r){4-4}\cmidrule(r){5-5}\cmidrule{6-6}\else\hline\fi +% |all| +% & -- +% & -- +% & -- +% & -- +% & -- \\ +%\ifbooktabs\cmidrule(r){1-1}\fi +% |alltext|\linebreak\linebreak(|allmath|) +% & \fontsize{8}{11}\selectfont \otI, \tI, \lyI,\linebreak \otIV, \tV, \tsI\linebreak (\oml, \oms, \U) +% & -- +% & -- +% & -- +% & -- \\ +%\ifbooktabs\cmidrule(r){1-1}\fi +% |basictext|\linebreak\linebreak(|basicmath|) +% & \fontsize{8}{11}\selectfont \otI, \tI, \lyI,\linebreak \otIV, \tV\linebreak (\oml, \oms) +% & |\rm*|,\linebreak |\sf*| +% & m +% & -- +% & \cmd{\normalsize}, \cmd{\footnotesize}, \cmd{\small}, \cmd{\large} \\ +%\ifbooktabs\cmidrule(r){1-1}\fi +% |normalfont| +% & |\encoding*| +% & |\family*| +% & |\series*| +% & |\shape*| +% & |\normalsize| \\ +%\ifbooktabs\bottomrule\else\hline\fi +%\end{tabular} +% \vskip8pt +% `|*|' = `|default|' +%\end{table} +% +% Table~\ref{tab:predefined-font-sets} lists the six predefined font sets. They +% may also be activated by passing their name to the feature options +% \opt{expansion} and \opt{protrusion} +%\ifbeta +% and \opt{spacing} and \opt{kerning} +%\fi +% when loading the package, for example: +%\begin{verbatim} +%\usepackage[protrusion=allmath,expansion=basicmath]{microtype} +%\end{verbatim} +% +%\bigskip +%\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. +% +%\bigskip +%\Describe{Macro}{\DeclareMicrotypeSetDefault}{?features,set name} +% If the package has been loaded without activating any font sets in the package +% options, the sets declared by this command will be activated (provisionally). +% By default, the `|basictext|' font set will be used for font expansion, the +% `|alltext|' set for character protrusion. +% +%\bigskip\noindent +% This command will only have an effect inside the main configuration file (cf. +% section~\ref{sub:config-file}). The commands \cs{DeclareMicrotypeSet} and +% \cs{UseMicrotypeSet} 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 amount of protrusion. 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 customizing these finer aspects of micro-typography. +% +%\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 Computer +% Modern Roman family in encoding~\tI. +% +%\paragraph{The protrusion settings} +% consist of \meta{character}\,|=|\,\meta{protrusion factors} pairs. +% +% The \meta{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 \tI\ encoding:~|029|, |"1D|, |'35|). +% \mbox{8-bit} characters may be entered directly or in the \LaTeX\ +% \mbox{7-bit} way of defining them: both |Ä| and |\"A| are valid, provided the +% character is actually included in the encoding(s). You also have the +% possibility to declare lists of characters that should inherit protrusion or +% expansion factors (see section~\ref{sub:inherit}). +% +% The \meta{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{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}. +% +%\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. +% +%\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.\par +% 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 +% with a different factor applied to them: +%\begin{verbatim} +%\SetProtrusion +% [ load = cmr-T1, +% factor = 700 ] +% { 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. +% However, all provided settings are created under the assumption +% that the values are relative to the character width. Therefore, you +% should only ask for a different \opt{unit} if you are certain that +% none of the default settings will 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{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 has been loaded with the \opt{selected} option. Otherwise, +% the expansion settings will be ignored. +% +%\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{The set of fonts} +% is declared in the same way as for \cs{SetProtrusion}. +% +%\ifbeta\pagebreak\fi ^^A layout +%\paragraph{Options:} +%\begin{options} +% \item[\Key{name}, \Key{load}, \Key{preset}, \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, or to determine the context of the list. +%\changes{v1.8}{2005/06/23}{add example of how to get rid of a widow} +% \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. +% You could take advantage of the |stretch| and |shrink| options to +% allow for more expansion in this particular paragraph. There is one +% problem that has to be worked around, however: \pdftex\ prohibits the +% use of the same font with different expansion parameters. If you do +% not want to create a clone of the font setup (this would require +% duplicating the \file{tfm}/\file{vf} files under a new name, and +% writing new \file{fd} files and \file{map} entries), you could exploit +% a dirty trick and load a minimally larger font for the paragraph in +% question. E.\,g., for a document printed in 10pt:\footnote{ +% Note that the \cmd{\expandpar} command can only be applied to +% complete paragraphs. If you are using Computer Modern Roman, you +% have to load the \pkg{fix-cm} package to be able to select fonts +% in arbitrary sizes. Finally, the reason I suggest to use a larger +% font, and not a smaller one, is to prevent a different design size +% being selected.} +%{\lstset{gobble=2} +%\begin{verbatim} +% \SetExpansion +% [ stretch = 30, +% shrink = 60 ] +% { encoding = *, +% size = 10.001 } +% { } +% \newcommand{\expandpar}[1] +% {{\fontsize{10.001}{\baselineskip}\selectfont #1}} +% % ... +% \expandpar{This paragraph contains an `unnecessary' widow.} +%\end{verbatim}} +% \item[\Key{factor}] +% This option provides a different method to alter expansion settings for +% certain fonts, working around another restriction of \pdftex: It does +% not allow different expansion limits or steps within one paragraph. +% 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} +% +%\medskip\noindent +% These options in the optional first argument will even be taken into account +% if the package has not been loaded with the \opt{selected} option. +% +% If the \opt{selected} option has been passed to the package (cf. +% section~\ref{sub:options-expansion}), 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. +% +%\betastart +%\subsection{Interword Spacing}\label{sub:interword-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 about what a `space' is may be in order: Between +% two words, \TeX\ will insert a so called glue, which is characterized by +% three parameters -- the normal distance between two words, the maximum amount +% that this distance may be stretched, and the maximum amount that it may be +% shrunk. 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. +% +%\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{The set of fonts} is declared in the usual way. +% +%\paragraph{Options:} +%\begin{options} +% \item[\Key{name}, \Key{load}, \Key{factor}, \Key{context}] +% These options serve the same function as in the previous configuration +% commands. +% \item[\Key{unit}] Like in \cs{SetProtrusion}, 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. For example, with these 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\ \cmd{\fontdimen}\,2), as well as the maximum +% stretch amount and the maximum shrink amount of the interword space +% (\cmd{\fontdimen}\,3 and \cmd{\fontdimen}\,4). As another example, +% setting all three value to |-1000| would completely cancel a space after +% the respective character. By default, the unit is measured by the space +% dimensions. +% \item[\Key{preset}] Preset all characters to the specified three values, +% possibly scaled by a |factor|, and relative to the |unit|. +%\end{options} +% +% +%\subsection{Additional Kerning}\label{sub:kerning} +% +%\Describe{Macro}{\SetExtraKerning}{?options,set of fonts,kerning settings} +% Fine tune the additional kerning. In contrast to standard kerning, which +% is always associated with a \emph{pair} of characters, the additional kerning +% relates to single characters. +% +%\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{The set of fonts}\dots\ well, you know by now~\dots +% +%\paragraph{Options:} +%\begin{options} +% \item[\Key{name}, \Key{load}, \Key{factor}] +% 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 are relative to 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. +% \item[\Key{preset}] Preset all characters to the specified values. +%\end{options} +%\betaend +% +% +%\subsection{Character Inheritance}\label{sub:inherit} +% +% \Describe{Macro}{\DeclareCharacterInheritance} +% {?features,set of fonts,inheritance lists} +% In most cases, accented characters should inherit the protrusion resp. +% expansion factors 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 lists of characters, +% so that you then only have to set up the base characters. With the optional +% argument, which may contain a comma-separated list of features, you may +% confine the scope of the list. The font set can be declared in the usual way, +% with the only exception that you must specify exactly one encoding. The +% inheritance lists are to be 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\ifbeta, \else\space and \fi +% expansion\ifbeta, spacing and kerning\fi\space 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 expansion and protrusion 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-pad.cfg}'), and may contain +% the commands \cs{SetProtrusion}, \cs{SetExpansion} and +% \cs{DeclareCharacterInheritance}. These files will be loaded automatically if +% you are actually using the respective fonts. If the font name consists of +% four characters, the package will also try to find the file for the base font +% family by removing the suffix denoting the sub-family, so that you may put +% settings for the fonts |padx| (expert set), |padj| (oldstyle numerals) and +% |pad| (plain) into one and the same file. +% +%\changes{v1.6a}{2005/02/02}{add table of fonts with tailored protrusion settings} +%\begin{table}\small +%\begin{minipage}{\textwidth} +%\def\arraystretch{1.2} +%\let\footnoterule\relax +%\def\fnref#1{\textsuperscript{\itshape#1}} +%\settowidth{\dimen0}{(} +%\def\p{\hskip\dimen0} +%\caption{Fonts with tailored protrusion settings}\label{tab:fonts} +%\begin{tabular}{@{}L{170pt}L{31pt}L{75pt}*2{L{31pt}}@{}} +%\ifbooktabs\toprule\else\hline\fi +% \footnotesize Font family (\nfss\ code) +% & \multicolumn{4}{l}{\footnotesize Features} \\ +%\ifbooktabs\cmidrule{2-5}\fi +% & \footnotesize Series +% & \footnotesize Shapes +% & \footnotesize \tsI +% & \footnotesize Math \\ +%\ifbooktabs\cmidrule(r){1-1}\cmidrule(r){2-2} +% \cmidrule(r){3-3}\cmidrule(r){4-4}\cmidrule{5-5}\else\hline\fi +% Generic +% & m +% & n, (it, sl, sc)\footnote{Incomplete} +% & (\match)\fnref{a}\\ +% Computer Modern Roman (|cmr|)\footnote{Also used for: +% Latin Modern (|lmr|), \pkg{ae} (|aer|), \pkg{zefonts} (|zer|), +% \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|)} +% & m +% & n, it, sl, sc +% & \p\match +% & \p\match \\ +% Bitstream Charter (|bch|) +% & m +% & n, it, (sl)\footnote{Settings inherited from italic shape}, sc +% & \p\match \\ +% Adobe Garamond (|pad|, |padx|, |padj|) +% & m +% & n, it, (sl)\fnref{c}, sc +% & \p\match \\ +% Adobe Minion (|pmnx|, |pmnj|) +% & m +% & n, it, (sl)\fnref{c}, sc, si +% & \p\match \\ +% Palatino (|ppl|, |pplx|, |pplj|)\footnote{Also used for: \pkg{pxfonts} (|pxr|), +% \pkg{qfonts}/QuasiPalatino (|qpl|)} +% & m +% & n, it, (sl)\fnref{c}, sc +% & (\match)\fnref{a} \\ +% Times (|ptm|, |ptmx|, |ptmj|)\footnote{Also used for: \pkg{txfonts} (|txr|), +% \pkg{qfonts}/QuasiTimes (|qtm|)} +% & m +% & n, it, (sl)\fnref{c}, sc +% & (\match)\fnref{a} \\ +% \ams\ math fonts (|msa|, |msb|, |euf|, |eus|) +% & m +% & n +% & +% & \p\match \\ +%\ifbooktabs\bottomrule\else\hline\fi +%\end{tabular} +%\end{minipage} +%\end{table} +% +% This package ships with configuration files for the font families Computer +% Modern Roman, Palatino, the inescapable Times, Adobe Garamond and +% Minion\footnote{ +% By courtesy of Harald Harders (\mailto{h.harders@tu-bs.de}).}, +% for Bitstream Charter and the \ams\ math fonts. +% Table~\ref{tab:fonts} lists them all. +% +% If you have created a file for another font and you are willing to share, +% don't hesitate to send it to me so that it can be included in future releases +% of this package. +% +%\bigskip +%\Describe{Macro}{\DeclareMicrotypeAlias}{font name,alias font} +% You may use this command for fonts that are very similar, or actually the same +% (for instance if you did not stick to the Berry naming scheme when installing +% the font). An example would be the Latin Modern fonts which are clones of the +% Computer Modern fonts, 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 in the default configuration file, along with others for the +% virtual fonts provided by the packages \pkg{ae}, \pkg{zefonts}, \pkg{eco} and +% \pkg{hfoldsty}. +% +%\bigskip +%\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|. +% +% +%\pagebreak ^^A layout +%\section{Disabling Ligatures}\label{sec:disable-ligatures} +% +%\Describe{Macro}{\DisableLigatures}{set of fonts} +% A new feature has been introduced with \pdftex\ 1.30: The possibility to +% completely disable all ligatures of a font (which will also switch off +% kerning). While this purposely \textit{lowers} the micro-typographic quality +% instead of raising it, it is especially useful for typewriter fonts, so that, +% \eg, in a \tI\ 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 \tI\ encoding: +%\begin{verbatim} +%\DisableLigatures{encoding = T1, family = tt* } +%\end{verbatim} +% +% +%\betastart +%\section{Letterspacing}\label{sec:lettersp} +% +%\Describe{Macro}{\textls}{?amount,general text} +%\DescribeMacro{\lsstyle} +% Until recently, it has been quite difficult to achieve letterspacing with +% \TeX.\footnote{^^A +% Many renowned typographers would have praised \TeX\ for this difficulty, +% since `he who would letterspace lower-case text, would steal sheep' +% (credited, among others, to Eric Gill). To learn more about the pros and +% cons of letterspacing, I suggest to read the documentation of the +% \cite{soul} package.} +% The most robust solution is provided by the \cite{soul} package; however, it +% can still fail in certain circumstances. Employing \pdftex's new extension of +% additional kerning, letterspacing is now entirely robust, since the extra +% kerning will be inserted on the typesetting level, not on the macro level. In +% contrast to the \pkg{soul} implementation, there are two major differences: +% Firstly, the downside: hyphenation will be suppressed (this restriction will +% hopefully be lifted some day). Secondly, ligatures will not be broken up, +% which is usually typographically correct. If this is not desired, you can +% split the ligatures with a pair of braces |{}| between them. +% +% By default, the text will be spaced out by 0.1em on both sides of every +% character; this amount may altered in the optional argument to \cs{textls} or +% globally with the \opt{letterspacing} package option (see +% section~\ref{sub:options-misc}). You may also fine tune the kerning for each +% character by defining a list for the |letterspacing| context. The default +% declarations can be found in the main configuration file. Improvements are +% welcome. +% +% Font switches inside \cs{textls} may lead to undesired results, therefore you +% should start a new letterspacing group when changing to a different font. +%\betaend +% +% +%\section{Context-sensitive setup}\label{sec:context} +% +% In previous versions of \microtype, each font was set up exactly once for +% the entire document. Since version 1.9, it is possible to apply different +% settings to a font depending on the context it appears in. +% +%\bigskip +%\Describe{Macro}{\microtypecontext}{key=value list} +% This command may be used anywhere in the document (also in the preamble) to +% change the micro-typographic context. For each feature (\Key{protrusion}, +% \Key{expansion}\ifbeta, \Key{spacing} and \Key{kerning}\fi), one context may +% be specified. Only settings which have been specified with the corresponding +% `|context|' keyword will then be applied. This makes it possible to use +% different settings for different parts of the document.\ifbeta\else\footnote{ +% This feature is especially useful for the new experimental extensions of +% \pdftex: adjustment of interword spacing (glue) and the possibility to +% specify additional character kerning. The former may improve the appearance +% of the text even more, the latter allows for instance to insert small +% spaces before certain characters (\eg, for typesetting in the French +% tradition) without having to use active characters; also, letterspacing can +% be implemented in a robust way. Currently, these extensions are only +% available through patches from \url{http://pdftex.sarovar.org/}. However, +% if you are adventurous, know how to apply the patches and you are able to +% compile \pdftex\ yourself, you can easily experiment with them, since +% \microtype\ already supports these new extensions. To generate the extended +% version of the \microtype\ package and its documentation, simply remove the +% comments before `\texttt{\textbackslash betatrue}' near the beginning of +% \file{microtype.ins} and \file{microtype.dtx}.\label{fn:beta}}\fi +% +%\betastart +% 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 insert +%\begin{verbatim} +%\microtypecontext{kerning=} +%\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. The current language will then be +% automatically detected and the contexts set accordingly. +% +%\bigskip +%\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} +% {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 has been loaded with the \opt{babel} +% option (see section~\ref{sub:options-misc}). +% Currently, \microtype\ supports French and Turkish kerning, and English +% spacing (aka. \cmd{\nonfrenchspacing}). For unknown languages, all contexts +% will be reset. +%\betaend +% +% +%\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\%. +% +%\paragraph{Don't use font expansion for web documents.} +% Because each expanded instance of the font will be embedded in the \pdf\ file, +% 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. +% +%\betastart +%\paragraph{Only employ kerning adjustment if it is customary in the language's +%typographic tradition.} +% In contrast to protrusion, expansion and spacing adjustment, kerning +% adjustment 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 any additional spaces before the punctuation characters. +%\betaend +% +%\changes{v1.7}{2005/03/23}{add hint about compatibility} +%\paragraph{Compatibility.} +% The package should work happily together with all other \LaTeX\ packages +% (except \pkg{pdfcprot}). However, life isn't perfect, so problems are to be +% expected. Currently, you should be aware of the following issues concerning +% the loading order of packages: +%\begin{itemize} +% \item All packages that change the default fonts and encodings (\eg\ +% \pkg{mathpazo}, \pkg{fontenc}) should be loaded before \microtype, so +% that variables used in the configuration file (\eg\ `|rm*|' for +% \cmd{\rmdefault}) don't expand to a different value than in the body of +% the document (as explained in section~\ref{sec:font-sets}). +% \item When using 8-bit characters in the configuration, \pkg{inputenc} must +% be loaded first. Unicode input in the configuration is currently not +% supported. +% \item The \pkg{CJK} package must be loaded before \microtype.\footnote{ +% And it might still not work. I simply don't know, since I know +% nothing about \pkg{CJK}. Feedback on the interaction of both +% packages -- positive or negative -- would be appreciated.} +%\end{itemize} +% +%\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 apply character protrusion to +% all fonts part of 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 of 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 +% incantation, added to the document's preamble, would serve the same +% purpose:\footnote{ +% 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.} +%\begin{verbatim} +%\makeatletter +%\g@addto@macro\verbatim{\pdfprotrudechars=0 \pdfadjustspacing=0\relax} +%\makeatother +%\end{verbatim} +% +%\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{belowskip=-\smallskipamount,frame=none,xleftmargin=0pt,backgroundcolor=} +% \item +%\begin{verbatim} +%font ____ cannot be expanded (not an included Type1 font) +%\end{verbatim} +% Font expansion can only be applied if the font is actually embedded in the +% \pdf\ file. If you receive 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|. +% Otherwise, consult the local guide of your \TeX\ system. +% \item +%\begin{verbatim} +%! TeX capacity exceeded, sorry [PDF memory size (pdf_mem_size)=65536]. +%\end{verbatim} +% When applying micro-typographic enhancement to a large number of fonts, you +% may be running out of \pdftex\ memory. You can increase it by setting +% |pdf_mem_size| to a larger value (maximum 524\,288). For te\TeX-based +% systems, change the settings in \file{texmf.cnf}, for MiK\TeX, in the file +% \file{miktex.ini}. Beginning with version 1.30 of \pdftex, the memory will +% grow dynamically, so that this problem can no longer arise. +%\end{itemize} +% +% +%\section{Contributions}\label{sec:contrib} +% +% 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.\footnote{ +% Should you have lots of \pkg{pdfcprot} configuration files lying around, +% I can also provide you with a \TeX\ conversion script. Just ask me.} +% +% +%\section{Acknowledgments} +% +%\def\contributor#1 <#2\at#3>{#1 (\mailto{#2@#3})} +%\def\contributor#1 <#2\at#3>{\textit{#1}} +% +% 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}]. +% +% \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. +%\ifbeta +% \contributor Ulrich Dirr has made numerous suggestion +% especially concerning the new extensions of interword spacing adjustment +% and additional character kerning. +%\fi +% +% 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 or helped otherwise +% (in chronological order): +%\ifbeta\else +% \contributor Ulrich Dirr , +%\fi +% \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 , +% \contributor Adam Kucharczyk , +% \contributor Mark Rossi , +% \contributor Stephan Hennig , +% \contributor Michael Zedler , +%and +% \contributor Herbert Voss . +% +% +%\begin{thebibliography}{} +% \bibitem[Th\`anh 2000]{ThanhThesis} +% \thanh, \emph{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 +% \bibitem[Th\`anh 2001]{ThanhTUG} +% \thanh, \emph{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, \emph{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]{ThanhEuroTeX} +% \thanh, \emph{Experiences with micro-typographic extensions of \pdftex\ in practice}, +% \newblock in: Proceedings of Euro\TeX\ 2005, 15\textsuperscript{th}~Annual +% Meeting of the European \TeX\ Users, March~7 -- March~11, 2005, +% Abbaye des Pr\'emontr\'es, Pont-\`a-Mousson, pp.~81--88. +% \newblock (Online at \url{http://www.dante.de/dante/events/eurotex/papers/TUT07.pdf}) +%\fi +% +% \bibitem[\pdftex\ manual]{pdftexman} +% \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, \emph{The \pdftex\ user manual}, +% \newblock August 21, 2005. +% \newblock (Available from \ctan\ at \ctanurl{/systems/pdftex/manual}; +% latest version at \url{http://sarovar.org/projects/pdftex/}) +% +% \bibitem[\LaTeXe\ font selection]{fntguide} +% \LaTeX3 Project Team, \emph{\LaTeXe\ font selection}, +% \newblock February 10, 2004. +% \newblock (Available from \ctan\ at \ctanurl{/macros/latex/doc/fntguide.pdf}) +% +% \bibitem[\texttt{pdfcprot}]{pdfcprot} +% Carsten Schurig, \emph{The |pdfcprot.sty| package}, +% \newblock August 14, 2002. +% \newblock (Available from \ctan\ at \ctanurl{/macros/latex/contrib/pdfcprot/}) +% +%\ifbeta +% \bibitem[\texttt{soul}]{soul} +% Melchior Franz, \emph{The |soul| package}, +% \newblock November 13, 2003. +% \newblock (Available from \ctan\ at \ctanurl{/macros/latex/contrib/soul/}) +%\fi +%\end{thebibliography} +% +% +%\section{Short History}\label{sec:short-history} +%\changes{v1.5}{2004/12/11}{add short history (section~\ref{sec: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}'^^A +% \else +% found in appendix~\ref{sec:changes}^^A +% \fi. +% The following is a list of all changes relevant in the user land; bug fixes +% are swept under the rug. +% +%\newenvironment{History} +% {\list{}{ +% \leftmargin 15pt +% \itemindent-15pt +% \labelwidth 22pt +% \labelsep 0pt +% \parsep 0pt +% \itemsep 0pt plus 2pt +% \def\makelabel##1{##1\hss} +% }} +% {\endlist} +%\def\Version #1 (#2.#3.#4){ +% \vskip 1ex plus 1pt +% \pagebreak[2] +% \VersionDate{#1}{#4/#3/#2} +% \item[#1](\number#2.\,\number#3.\,#4)^^A \number removes leading zeroes +% \nopagebreak[4] +%} +%\def\VersionDate#1#2{^^A needed in the Change History +% \global\expandafter\def\csname MTversiondate#1\endcsname{#2}} +% +%\begin{History} +%\betastart +%\Version 2.0 (28.10.2005) +% \item Support for the new extensions of \pdftex\ version 1.3x: adjustment of +% interword spacing (glue), and additional kerning +% (new commands \cs{SetExtraSpacing} and \cs{SetExtraKerning}, +% new options `\opt{spacing}', `\opt{kerning}'; +% see section~\ref{sub:interword-spacing} and~\ref{sub:kerning}) +% \item New option `\opt{babel}' to activate automatic adjustment to the +% \pkg{babel} package +% (see sections~\ref{sub:options-misc} and~\ref{sec:context}) +% \item New commands \cs{textls} and \cs{lsstyle} for letterspacing +% (requires \pdftex\ version 1.3x; +% see section~\ref{sec:lettersp}) +%\betaend +% +%\Version 1.9 (28.10.2005) +% \item New command \cs{DisableLigatures} to disable ligatures of fonts +% (requires \pdftex\ version 1.30 or later; +% see section~\ref{sec:disable-ligatures}) +% \item New command \cs{microtypecontext} to change the configuration context; +% new key `|context|' for the configuration commands +% (see section~\ref{sec:context}) +% \item New key `|font|' to add single fonts to the font sets +% (see 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 \otIV\ encoding (protrusion, expansion, inheritance) +% \item Support for the Vietnamese \tV\ encoding (protrusion, expansion, inheritance) +% \item `\opt{DVIoutput}' will work with \TeX Live 2004 +% +%\Version 1.8 (23.06.2005) +% \item If font substitution has occurred, the settings for the substitute will +% be used instead of those for the selected font +% \item New command \cs{DeclareMicrotypeSetDefault} to declare the default font +% sets (see section~\ref{sec:font-sets}) +% \item New option `\opt{config}' to load a different configuration file +% (see section~\ref{sub:options-misc}) +% \item New option `\opt{unit}' to measure protrusion factors relative to a +% dimension instead of the character width +% (see section~\ref{sub:protrusion}) +% \item Renamed commands from \cs{..MicroType..} to \cs{..Microtype..} +% \item Protrusion settings for \ams\ math fonts +% \item Protrusion settings for Times in \lyI\ encoding completed +% \item The `|allmath|' font set also includes \U\ encoding +% \item 8-bit characters in the configuration files finally work as advertised, +% even if made active by the \pkg{csquotes} package +% \item When using the \pkg{ledmac} package, character protrusion will work +% for the first time ever (requires \pdftex\ version 1.30 or later) +% +%\Version 1.7 (23.03.2005) +% \item Possibility to specify ranges of font sizes in the set declarations +% and protrusion and expansion settings +% (see sections~\ref{sec:font-sets} and~\ref{sec:fine-tuning}) +% \item Always take font size into account when trying to find protrusion resp. +% expansion settings for a given font +% (see section~\ref{sec:fine-tuning}) +% \item New command \cs{LoadMicrotypeFile} to load a font configuration file +% manually (see section~\ref{sub:config-file}) +% \item Hook \cs{Microtype@Hook} for font package authors (see section~\ref{sub:hook}) +% \item New option `\opt{verbose}|=errors|' to turn all warnings into errors +%^^A \item Compatibility with the \pkg{chemsym} and \pkg{statex} packages +% \item Disable expansion inside \cmd{\showhyphens} +% \item Warning when running in draft mode +% +%\Version 1.6a (02.02.2005) +% \item Compatibility with the \pkg{frenchpro} package +% +%\Version 1.6 (24.01.2005) +% \item New option `\opt{factor}' to influence protrusion resp. expansion of +% all characters of a font or font set +% (see sections~\ref{sub:options-protrusion} and~\ref{sec:fine-tuning}) +% \item When \pdftex\ is too old to expand fonts automatically, expansion +% has to be enabled explicitly, automatic expansion will be disabled +% (see section~\ref{sub:options-microtype}) +% \item Protrusion settings of digits improved +% \item Use \etex\ extensions, if available +% +%\Version 1.5 (15.12.2004) +% \item When output mode is \dvi, font expansion has to be enabled +% explicitly, automatic expansion will be disabled +% (see section~\ref{sub:options-microtype}) +% \item New option `\opt{selected}' to enable selected expansion +% (see sections~\ref{sub:options-expansion} and \ref{sub:expansion}); +% default is: |false| +% \item New default for expansion option `\opt{step}': 4 (min(\opt{stretch},\opt{shrink})/5) +% (see section~\ref{sub:options-expansion}) +% \item Protrusion settings for Bitstream Charter +% \item Compatibility with Turkish \pkg{babel} +% +%\Version 1.4b (26.11.2004) +% \item \cs{UseMicrotypeSet} requires the set to be declared +% (see section~\ref{sec:font-sets}) +% \item Internal optimization +%^^A\Version 1.4a (17.11.2004) +% +%^^A \item Bug fix update (font setup inside |tabular|s) +%\VersionDate{1.4a}{2004/11/17} +%\Version 1.4 (12.11.2004) +% \item Set up fonts independently from \LaTeX\ font loading +% (therefore, no risk of overlooking fonts anymore, and the package may +% be loaded at any time) +% \item \cs{microtypesetup} now sets the correct level of protrusion +% (see chapter~\ref{sec:options-cmd}) +% \item New option: `\opt{final}' +% +%\Version 1.3 (27.10.2004) +% \item Compatibility with the \pkg{german} and \pkg{ngerman} packages +% +%\Version 1.2 (03.10.2004) +% \item New font sets: `|allmath|' and `|basicmath|' +% (see section~\ref{sec:font-sets} and table~\ref{tab:predefined-font-sets}) +% \item Protrusion settings for Computer Modern Roman math symbols +% \item Protrusion settings for \tsI\ encoding completed for Computer Modern +% Roman and Adobe Garamond +% \item If an alias font name is specified, it will be used as an alternative, +% not as a replacement (see section~\ref{sub:config-file}) +% \item More tests for sanity of settings and whether all fonts will be set up +% \item More robust parsing of sizes in font sets +% +%\Version 1.1 (21.09.2004) +% \item Protrusion settings for Adobe Minion, contributed by Harald Harders +% \item New command: \cs{DeclareCharacterInheritance} +% (see section~\ref{sub:inherit}) +% \item Characters may also be specified as octal or hexadecimal numbers +% (see section~\ref{sec:fine-tuning}) +% \item Configuration file names in lowercase (see section~\ref{sub:config-file}) +% +%\Version 1.0 (11.09.2004) +% \item First \ctan\ release +%\end{History} +% +% \GeneralChanges! +% +% \StopEventually{ +% \typeout{:?1000} ^^A tell WinEdt not to bother about overfull boxes +% \appendix +% \PrintChanges +% \PrintIndex +% \typeout{:?1111} +% } +% +% +% ^^A ========================================================================= +% +%\DoNotIndex{\!,\",\',\(,\),\*,\+,\,,\-,\.,\/,\:,\;,\<,\=,\>,\?,\[,\\,\],\`, +% \#,\$,\%,\&,\^,\_,\|,\~,\ } ^^A won't work: \{,\} +%\DoNotIndex{\advance,\aftergroup,\begingroup,\catcode,\char,\chardef, ^^A TeX +% \csname,\def,\divide,\edef,\else,\endcsname,\endgroup,\endinput,\escapechar, +% \expandafter,\fi,\gdef,\global,\hbox,\if,\ifcase,\ifdim,\iffalse,\ifhbox,\ifnum, +% \iftrue,\ifx,\input,\inputlineno,\kern,\let,\meaning,\multiply,\newcount, +% \newdimen,\newif,\newtoks,\noexpand,\number,\or,\relax,\romannumeral,\setbox, +% \space,\string,\the,\uppercase,\wd,\xdef} +%^^A\DoNotIndex{\font,\fontdimen,\nullfont} +%\DoNotIndex{\@backslashchar,\@cclv,\@cclvi,\@classoptionslist,\@currext, ^^A LaTeX +% \@currname,\@defaultunits,\@empty,\@expandtwoargs,\@firstofone,\@firstoftwo, +% \@gobble,\@ifnextchar,\@ifpackagelater,\@ifpackageloaded,\@ifpackagewith,\@ifstar, +% \@m,\@makeother,\@nameuse,\@ne,\@nil,\@nnil,\@nodocument,\@onelevel@sanitize, +% \@onlypreamble,\@ptionlist,\@removeelement,\@secondoftwo,\@spaces,\@tempa, +% \@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,\@tempswafalse,\@tempswatrue, +% \@undefined,\@unprocessedoptions,\@unusedoptionlist,\g@addto@macro,\if@tempswa, +% \m@ne,\p@,\set@display@protect,\strip@prefix,\strip@pt,\thr@@,\tw@,\z@,\zap@space} +%\DoNotIndex{\active,\makeatletter,\newcommand,\nonfrenchspacing,\normalsize, +% \renewcommand,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,\CurrentOption, +% \DeclareRobustCommand,\IfFileExists,\InputIfFileExists,\MessageBreak, +% \PackageError,\PackageInfo,\PackageWarning,\RequirePackage} +%^^A\DoNotIndex{\@@enc@update,\add@accent,\cf@encoding,\curr@fontshape, +%^^A \define@newfont,\do@subst@correction,\f@encoding,\f@size,\font@name, +%^^A \normalfont,\pickup@font,\selectfont,\set@fontsize} +%\DoNotIndex{\detokenize,\dimexpr,\eTeXversion,\ifcsname,\ifdefined,\numexpr} ^^A e-TeX +%^^A\DoNotIndex{\fontcharwd,\iffontchar} +%^^A\DoNotIndex{\{ef,lp,rp}code,\{left,right}marginkern,\{kn{bc,ac},{kn,st,sh}bs}code,\pdf*} ^^A pdfTeX +%\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision} ^^A TeXLive +%\DoNotIndex{\@inpenc@undefined@,\IeC} ^^A inputenc +%\DoNotIndex{\@disablequotes} ^^A csquotes +%\DoNotIndex{\foreign@language,\languagename,\select@language} ^^A babel +%\DoNotIndex{\percentsign} ^^A Spanish babel +%\DoNotIndex{\NoAutoSpaceBeforeFDP} ^^A French babel +%\DoNotIndex{\l@dunhbox@line} ^^A ledmac/ledpar +%\DoNotIndex{\pdfstringdefDisableCommands} ^^A hyperref +%\DoNotIndex{\define@key,\KV@@sp@def,\setkeys} ^^A keyval +%\DoNotIndex{\color@begingroup,\color@endgroup,\everypar,\hbadness,\hsize, ^^A \showhyphens +% \maxdimen,\parfillskip,\pretolerance,\showboxdepth,\tolerance,\vbox,\z@skip} +%\DoNotIndex{\CHAR,\KVo@tempa,\MT@dinfo,\MT@dinfo@nl,\tracingmicrotype,\x,\y} ^^A microtype +%\DoNotIndex{\DeclareMicroTypeSet,\UseMicroTypeSet,\DeclareMicroTypeAlias, ^^A ... old commands +% \LoadMicroTypeFile,\MicroType@Hook} +% +% ^^A ------------------------------------------------------------------------- +% +%\newpage +%\ImplementationSettings +% +%\section{Implementation} +% +% The \pkg{docstrip} modules in this file are: +%\begin{description} +% \item[|driver|:] The documentation driver, only visible in the \file{dtx} file. +% \item[|package|:] The code for the \microtype\ package (\file{microtype.sty}). +% \begin{description} +% \item[|debug|:] Code for additional output in the log file.\\ +% Used for -- surprise! -- debugging purposes. +% \end{description} +% \item[|config|:] Surrounds all configuration modules. +% \begin{description} +% \item[|m-t|:] The main configuration file (\file{microtype.cfg}). +% \item[|bch|:] Settings for Bitstream Charter (\file{mt-bch.cfg}). +% \item[|cmr|:] Settings for Computer Modern Roman (\file{mt-cmr.cfg}). +% \item[|pad|:] Settings for Adobe Garamond (\file{mt-pad.cfg}). +% \item[|ppl|:] Settings for Palatino (\file{mt-ppl.cfg}). +% \item[|ptm|:] Settings for Times (\file{mt-ptm.cfg}). +% \item[|pmn|:] Settings for Adobe Minion (\file{mt-pmn.cfg}). \\ +% Contributed by Harald Harders. +% \item[|cfg-u|:] Surrounds non-text configurations (\U\ encoding). +% \begin{description} +% \item[|msa|:] Settings for \ams\ `a' symbol font (\file{mt-msa.cfg}). +% \item[|msb|:] Settings for \ams\ `b' symbol font (\file{mt-msb.cfg}). +% \item[|euf|:] Settings for \ams\ Euler Fraktur font (\file{mt-euf.cfg}). +% \item[|eus|:] Settings for \ams\ Euler script font (\file{mt-eus.cfg}). +% \end{description} +% \end{description} +% \item[|test|:] A helper file that may be used to create and test +% protrusion settings (\file{test-microtype.tex}). +% \item[|beta|:] Support for features not yet included in an official +% release of \pdftex. +%\end{description} +% And now for something completely different. +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% These are all commands for the outside world. We define them here as dummy +% commands, so that they won't generate an error if we are not running \pdftex. +% \begin{macrocode} +\newcommand*\DeclareMicrotypeSet[3][]{} +\newcommand*\UseMicrotypeSet[2][]{} +\newcommand*\DeclareMicrotypeSetDefault[2][]{} +\newcommand*\DeclareMicrotypeAlias[2]{} +\newcommand*\SetProtrusion[3][]{} +\newcommand*\SetExpansion[3][]{} +\newcommand*\DisableLigatures[1]{} +\newcommand*\DeclareCharacterInheritance[3][]{} +\newcommand*\LoadMicrotypeFile[1]{} +\newcommand*\microtypesetup[1]{} +\newcommand*\microtypecontext[1]{} +%<*beta> +\newcommand*\SetExtraSpacing[3][]{} +\newcommand*\SetExtraKerning[3][]{} +\newcommand*\DeclareMicrotypeBabelHook[2]{} +\newcommand\textls[2][]{#2} +\newcommand\lsstyle{} +% +% \end{macrocode} +% This command also has a starred version. +% \begin{macrocode} +\def\DeclareMicrotypeSet{% + \@ifstar + {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}% + {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}% +} +\def\MT@DeclareSet[#1]#2#3{} +% \end{macrocode} +% Set declarations are only allowed in the preamble (resp. the main +% configuration file). All the other commands, on the other hand, must be +% allowed in the document, too, since they may be called inside font +% configuration files. +% \begin{macrocode} +\@onlypreamble{\DeclareMicrotypeSet} +\@onlypreamble{\UseMicrotypeSet} +\@onlypreamble{\DisableLigatures} +% \end{macrocode} +%\begin{macro}{\MT@old@cmd} +% The old command names had one more hunch. +%\changes{v1.8}{2005/04/28}{renamed commands from \cs{..MicroType..} to +% \cs{..Microtype..}} +% \begin{macrocode} +\def\MT@old@cmd#1#2{% + \MT@warning{\string#1 is deprecated. Please use\MessageBreak + \string#2 instead}% + \let#1#2#2} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\newcommand*\DeclareMicroTypeSet{% + \MT@old@cmd\DeclareMicroTypeSet + \DeclareMicrotypeSet} +\newcommand*\UseMicroTypeSet{% + \MT@old@cmd\UseMicroTypeSet + \UseMicrotypeSet} +\newcommand*\DeclareMicroTypeAlias{% + \MT@old@cmd\DeclareMicroTypeAlias + \DeclareMicrotypeAlias} +\newcommand*\LoadMicroTypeFile{% + \MT@old@cmd\LoadMicroTypeFile + \LoadMicrotypeFile} +% \end{macrocode} +%\begin{macro}{\MT@error} +%\begin{macro}{\MT@warning} +%\begin{macro}{\MT@warning@nl} +%\begin{macro}{\MT@warn@err} +%\changes{v1.7}{2005/03/16}{new macro: for \opt{verbose}\quotechar=\texttt{errors}} +%\begin{macro}{\MT@info} +%\begin{macro}{\MT@info@nl} +%\begin{macro}{\MT@vinfo} +%\changes{v1.6}{2005/01/06}{new macro: used instead of \cs{ifMT@verbose}} +% Communicate. +% \begin{macrocode} +\def\MT@error{\PackageError{microtype}} +\def\MT@warning{\PackageWarning{microtype}} +\def\MT@warning@nl#1{\MT@warning{#1\@gobble}} +\def\MT@warn@err#1{\MT@error{#1}{% + This error message appears because you loaded the `microtype'\MessageBreak + package with the option `verbose=errors'. Consult the documentation\MessageBreak + in microtype.(pdf,dvi) to find out what went wrong.}} +\def\MT@info{\PackageInfo{microtype}} +\def\MT@info@nl#1{\MT@info{#1\@gobble}} +%\let\MT@vinfo\@gobble +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% Debug. Cases for \cs{tracingmicrotype}: +%\begin{itemize} +% \item[|0|:] almost none +% \item[|1|:] + sets \& lists +% \item[|2|:] + heirs +% \item[|3|:] + slots +% \item[|4|:] + factors +%\end{itemize} +% \begin{macrocode} +%<*debug> +\let\MT@vinfo\MT@info@nl +\newcount\tracingmicrotype +\tracingmicrotype=\tw@ +\def\MT@dinfo#1#2{\ifnum\tracingmicrotype<#1\relax\else\MT@info{#2}\fi} +\def\MT@dinfo@nl#1#2{\ifnum\tracingmicrotype<#1\relax\else\MT@info@nl{#2}\fi} +% +% \end{macrocode} +% +%\subsection{Requirements} +% +%\begin{macro}{\MT@pdftex@no} +%\changes{v1.6a}{2005/02/02}{new macro} +% \pdftex's features for which we provide an interface here haven't always been +% available, and some specifics have changed over time. Therefore, we have to +% test which \pdftex\ we're using, if any. \cs{MT@pdftex@no} will be used +% throughout the package to respectively do the right thing. +% +% Currently, there are six cases for \pdftex: +%\begin{itemize} +% \item[|0|:] not running \pdftex +% \item[|1|:] \pdftex\ (\textless\ 0.14f) +% \item[|2|:] + micro-typographic extensions (0.14f, 0.14g) +% \item[|3|:] + protrusion relative to 1em (\textgeq\ 0.14h) +% \item[|4|:] + automatic font expansion; default \cmd{\efcode}\,=\,1000 (\textgeq\ 1.20) +%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30} +% \item[|5|:] + \cmd{\(left\textbar right)marginkern}; \cmd{\pdfnoligatures} (\textgeq\ 1.30) +%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.3x} +% \item[|6|:] + \cmd{\(knbs\textbar stbs\textbar shbs\textbar knbc\textbar knac)code} (\textgeq\ 1.3x) +%\end{itemize} +%\changes{v1.1}{2004/09/13}{bug fix concerning version check +% (reported by Harald Harders)} +% \begin{macrocode} +\let\MT@pdftex@no\z@ +% \end{macrocode} +%\changes{v1.9}{2005/08/29}{compatibility with \TeX Live hack +% (reported by Herbert Vo\ss)} ^^A +% ^^A in +% A hack circumventing the \TeX Live 2004 hack which undefines the \pdftex\ +% primitives in the format in order to hide the fact that \pdftex\ is being run +% from the user. This has been \emph{fixed} in \TeX Live 2005. +% \begin{macrocode} +\ifx\normalpdftexversion\@undefined \else + \let\pdftexversion \normalpdftexversion + \let\pdftexrevision\normalpdftexrevision + \let\pdfoutput \normalpdfoutput +\fi +% \end{macrocode} +% Old packages might have defined \cmd{\pdftexversion} to \cmd{\relax}. +% \begin{macrocode} +\ifx\pdftexversion\@undefined \else + \ifx\pdftexversion\relax \else +%\MT@dinfo@nl{0}{running pdftex \the\pdftexversion(\pdftexrevision)} +% \def\MT@pdftex@no{5} +%<*beta> + \ifx\knbccode\@undefined + \def\MT@pdftex@no{5} + \else + \def\MT@pdftex@no{6} + \fi +% + \ifnum\pdftexversion < 130 + \def\MT@pdftex@no{4} + \ifnum\pdftexversion < 120 + \let\MT@pdftex@no\thr@@ + \ifnum\pdftexversion = 14 + \ifnum \expandafter`\pdftexrevision < `h + \let\MT@pdftex@no\tw@ + \ifnum \expandafter`\pdftexrevision < `f + \let\MT@pdftex@no\@ne + \fi + \fi + \else + \ifnum\pdftexversion < 14 + \let\MT@pdftex@no\@ne + \fi + \fi + \fi + \fi + \fi +\fi +%\MT@dinfo@nl{0}{pdftex no: \number\MT@pdftex@no} +% \end{macrocode} +%\end{macro} +% If we are not using \pdftex\ or in case it is too old, we disable everything +% and exit here. +% \begin{macrocode} +\ifnum\MT@pdftex@no<\tw@ + \AtEndOfPackage{\let\@unprocessedoptions\relax}% + \let\CurrentOption\@empty + \MT@warning@nl{% + \ifcase\MT@pdftex@no + You don't seem to be using pdftex.\MessageBreak + \or + You are using a pdftex version older than 0.14f.\MessageBreak + microtype won't work with such antiquated versions.\MessageBreak + Please install a newer version of pdftex.\MessageBreak + \fi + All micro-typographic features will be disabled} + \expandafter + \endinput +\fi +% \end{macrocode} +% Still there? Then we can begin: +%\begin{macro}{\MT@catcodes} +%\changes{v1.3}{2004/10/27}{check some category codes (compatibility with \pkg{german})} +%\changes{v1.5}{2004/12/03}{reset catcode of `\texttt{\^}' (compatibility with \pkg{chemsym})} +% We have to make sure that the category codes of some characters are correct +% (the \pkg{german} package, for instance, makes |"| active). Probably overly +% cautious. Ceterum censeo: It should be forbidden for packages to change +% catcodes within the preamble. +% \begin{macrocode} +\def\MT@catcodes{% + \catcode`\^7 % + \@makeother\-% + \@makeother\=% + \@makeother\*% + \@makeother\,% + \@makeother\/% + \@makeother\`% + \@makeother\'% + \@makeother\"% + \@makeother\|% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@restore@catcodes} +% Polite as we are, we'll restore them afterwards. +% \begin{macrocode} +\def\MT@restore@catcodes#1{% + \ifx\relax#1\else + \noexpand\catcode`\noexpand#1\the\catcode`#1\relax + \expandafter\MT@restore@catcodes + \fi +} +\edef\MT@restore@catcodes{% + \MT@restore@catcodes\^\-\=\*\,\/\`\'\"\|\relax +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@catcodes +\AtEndOfPackage{\MT@restore@catcodes} +% \end{macrocode} +% We need the \pkg{keyval} package, including the new \cmd{\KV@@sp@def} +% implementation. +% \begin{macrocode} +\RequirePackage{keyval}[1997/11/10] +% \end{macrocode} +%\begin{macro}{\mt@toks} +% We need a token register. +%\changes{v1.9}{2005/09/28}{no longer use \cmd{\toks@}} +% \begin{macrocode} +\newtoks\mt@toks +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifMT@protrusion} \IndexNewif{MT@protrusion} +%\begin{macro}{\ifMT@expansion} \IndexNewif{MT@expansion} +%\begin{macro}{\ifMT@auto} \IndexNewif{MT@auto} +%\begin{macro}{\ifMT@selected} \IndexNewif{MT@selected} +%\begin{macro}{\ifMT@spacing} \IndexNewif{MT@spacing} +%\begin{macro}{\ifMT@kerning} \IndexNewif{MT@kerning} +%\begin{macro}{\ifMT@noligatures}\IndexNewif{MT@noligatures} +%\begin{macro}{\ifMT@DVIoutput} \IndexNewif{MT@DVIoutput} +%\begin{macro}{\ifMT@draft} \IndexNewif{MT@draft} +%\begin{macro}{\ifMT@babel} \IndexNewif{MT@babel} +% These are the global switches~\dots +% \begin{macrocode} +\newif\ifMT@protrusion +\newif\ifMT@expansion +\newif\ifMT@auto +\newif\ifMT@selected +%<*beta> +\newif\ifMT@spacing +\newif\ifMT@kerning +% +\newif\ifMT@noligatures +\newif\ifMT@DVIoutput +\newif\ifMT@draft +%\newif\ifMT@babel +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@pr@level} +%\begin{macro}{\MT@pr@factor} +%\begin{macro}{\MT@pr@unit} +%\begin{macro}{\MT@ex@level} +%\begin{macro}{\MT@ex@factor} +%\begin{macro}{\MT@stretch} +%\begin{macro}{\MT@shrink} +%\begin{macro}{\MT@step} +%\begin{macro}{\MT@sp@factor} +%\begin{macro}{\MT@sp@unit} +%\begin{macro}{\MT@kn@factor} +%\begin{macro}{\MT@kn@unit} +%\begin{macro}{\MT@letterspacing} +% \dots~and numbers. +% \begin{macrocode} +\let\MT@pr@level\tw@ +\let\MT@pr@factor\@m +\let\MT@pr@unit\@empty +\let\MT@ex@level\tw@ +\let\MT@ex@factor\@m +\let\MT@stretch\m@ne +\let\MT@shrink \m@ne +\let\MT@step \m@ne +%<*beta> +\let\MT@sp@factor\@m +\let\MT@kn@factor\@m +% \end{macrocode} +% Default unit for spacing settings is |space|, default unit for kerning is +% 1em. +% \begin{macrocode} +\let\MT@sp@unit\m@ne +\def\MT@kn@unit{1em} +\let\MT@letterspacing\m@ne +% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@pr@min} +%\begin{macro}{\MT@pr@max} +%\begin{macro}{\MT@ex@min} +%\begin{macro}{\MT@ex@max} +%\begin{macro}{\MT@sp@min} +%\begin{macro}{\MT@sp@max} +%\begin{macro}{\MT@kn@min} +%\begin{macro}{\MT@kn@max} +% Minimum and maximum values allowed by \pdftex. +% \begin{macrocode} +\def\MT@pr@min{-\@m} +\let\MT@pr@max\@m +\let\MT@ex@min\z@ +\let\MT@ex@max\@m +%<*beta> +\def\MT@sp@min{-\@m} +\let\MT@sp@max\@m +\def\MT@kn@min{-\@m} +\let\MT@kn@max\@m +% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@factor@default} +%\begin{macro}{\MT@stretch@default} +%\begin{macro}{\MT@shrink@default} +%\begin{macro}{\MT@step@default} +% Default values for expansion. +% \begin{macrocode} +\def\MT@factor@default{1000 } +\def\MT@stretch@default{20 } +\def\MT@shrink@default{20 } +\def\MT@step@default{4 } +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@letterspacing@default} +% Default value for letterspacing (in thousandths of 1em). +% \begin{macrocode} +%\def\MT@letterspacing@default{100 } +% \end{macrocode} +%\end{macro} +% +% \subsection{Compatibility} +% +% For the record, the following \LaTeX\ commands will be modified by \microtype: +%\begin{itemize} +% \item \cmd{\pickup@font} +% \item \cmd{\do@subst@correction} +% \item \cmd{\add@accent} +% \item \cmd{\showhyphens} +%\end{itemize} +% +%\begin{macro}{\MT@pdfcprot@error} +%\changes{v1.4}{2004/11/04}{check for \pkg{pdfcprot}} +% Our competitor, the \pkg{pdfcprot} package, must not be tolerated! +% \begin{macrocode} +\def\MT@pdfcprot@error{% + \MT@error{Detected the `pdfcprot' package!\MessageBreak + `microtype' and `pdfcprot' may not be used together}{% +The `pdfcprot' package provides an interface to character protrusion.\MessageBreak +So does the `microtype' package. Using both packages at the same\MessageBreak +time will almost certainly lead to undesired results. Have your choice!}% + \let\MT@pdfcprot@error\relax +} +\@ifpackageloaded{pdfcprot}\MT@pdfcprot@error\relax +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ledmac@setup} +%\begin{macro}{\MT@led@unhbox@line} +%\begin{macro}{\MT@led@kern} +% The \pkg{ledmac} package first saves each paragraph in a box, from which it +% then splits off the lines one by one. This will destroy character protrusion. +% (There aren't any problems with the \pkg{lineno} package, since it takes a +% different approach.) +%\iffalse +% We issue a warning, so that nobody can say they didn't know. +%\changes{v1.6}{2004/12/29}{warning when using the \pkg{ledmac} package} +% --- This is fixed in \pdftex\ 1.21a, so we no longer warn. +%\changes{v1.6a}{2004/02/02}{no warning when using the \pkg{ledmac} package} +% --- Actually, it was completely broken in 1.21a, but 1.21b provides a work-around. +%\fi +% ---~\dots~--- +%\changes{v1.8}{2005/04/15}{character protrusion with \pkg{ledmac}} +% After much to and fro, the situation has finally settled and there is a fix. +% Beginning with \pdftex\ version 1.21b together with \file{ledpatch.sty} as of +% 2005/06/02 (v0.4), character protrusion will work at last. +% +% Peter Wilson was so kind to provide the \cmd{\l@dunhbox@line} hook in +% \pkg{ledmac} to allow for protrusion. \cmd{\leftmarginkern} and +% \cmd{\rightmarginkern} are new primitives of \pdftex\ 1.21b (aka 1.30.0). +% \begin{macrocode} +\def\MT@ledmac@setup{% + \ifMT@protrusion + \ifnum\MT@pdftex@no > 4 + \MT@ifdefined@c\l@dunhbox@line{% + \MT@info@nl{Patching ledmac to enable character protrusion}% + \newdimen\MT@led@kern + \let\MT@led@unhbox@line\l@dunhbox@line + \renewcommand*{\l@dunhbox@line}[1]{% + \ifhbox##1% + \MT@led@kern=\rightmarginkern##1% + \kern\leftmarginkern##1% + \MT@led@unhbox@line##1% + \kern\MT@led@kern + \fi + }% + }{% + \MT@warning@nl{% + Character protrusion in paragraphs with line\MessageBreak + numbering will only work if you update ledmac}% + }% + \else + \MT@warning@nl{% + The pdftex version you are using does not allow\MessageBreak + character protrusion in paragraphs with line\MessageBreak + numbering by the `ledmac' package.\MessageBreak + Upgrade pdftex to version 1.30 or later}% + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@setupfont@hook} +% This hook will be executed every time a font is set up (inside a group). +% +% In the preamble, we check for the packages each time a font is set up. +% Thus, it will work regardless when the packages are loaded. +% +% Even for packages that don't activate any characters in the preamble (like +% \pkg{babel} and \pkg{csquotes}), we have to check here, too, in case they were +% loaded before \microtype, and a font is loaded \cmd{\AtBeginDocument}, before +% \microtype. +% \begin{macrocode} +\def\MT@setupfont@hook{% +% \end{macrocode} +%^^A\changes{v1.7}{2005/02/06}{compatibility with the \pkg{chemsym} package} +% The \pkg{chemsym} package redefines, among other commands, the Hungarian +% umlaut \cmd{\H} in a way that cannot be parsed by \microtype. As a work-around, +% we restore the usual definition of \cmd{\H} before setting up the font (which +% will be done inside a group). +%^^A\changes{v1.8}{2005/03/24}{remove superfluous \pkg{chemsym} hook} +% --- Since version 1.7, this is no longer needed, since our character parsing +% is robust enough now. +% +%^^A\changes{v1.7}{2005/03/10}{compatibility with the \pkg{statex} package} +% Same for \pkg{statex}. +%^^A\changes{v1.8}{2005/03/24}{remove superfluous \pkg{statex} hook} +% --- No longer needed, either. +% +% Spanish \pkg{babel} modifies the percent character, storing the original +% meaning in \cmd{\percentsign}. +%\changes{v1.8}{2005/03/30}{restore percent character if Spanish \pkg{babel} is loaded} +% \begin{macrocode} + \@ifpackagewith{babel}{spanish}{% + \MT@ifdefined@c\percentsign + {\let\%\percentsign}\relax + }\relax +% \end{macrocode} +%\changes{v1.8}{2005/04/22}{restore \pkg{csquotes}'s active characters} +% Using \cmd{\@disablequotes}, we can restore the original meaning of all +% characters made active by \pkg{csquotes}. +% (It would be doable for older versions, too, but we won't bother.) +% \begin{macrocode} + \@ifpackageloaded{csquotes}{% + \@ifpackagelater{csquotes}{2005/05/11}\@disablequotes\relax + }\relax +% \end{macrocode} +% \pkg{hyperref} redefines \cmd{\%} and \cmd{\#} inside a \cmd{\url}. We restore +% the original meanings (which we can only hope are correct). +%\changes{v1.8}{2005/05/20}{restore \cmd{\%} and \cmd{\#} when \pkg{hyperref} is loaded} +% \begin{macrocode} + \@ifpackageloaded{hyperref}{% + \chardef\%`\% + \chardef\#`\# + }\relax +} +% \end{macrocode} +%\end{macro} +% Check again at the end of the preamble. +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{pdfcprot}\MT@pdfcprot@error\relax + \@ifpackageloaded{ledmac}\MT@ledmac@setup\relax +% \end{macrocode} +% We can clean up \cs{MT@setupfont@hook} now. +% \begin{macrocode} + \let\MT@setupfont@hook\@empty + \@ifpackagewith{babel}{spanish}{% + \g@addto@macro\MT@setupfont@hook{% + \MT@ifdefined@c\percentsign + {\let\%\percentsign}\relax}% + }\relax + \@ifpackageloaded{csquotes}{% + \@ifpackagelater{csquotes}{2005/05/11}{% + \g@addto@macro\MT@setupfont@hook\@disablequotes + }{% + \MT@warning@nl{% + Should you receive warnings about unknown slot\MessageBreak + numbers, try upgrading the `csquotes' package}% + }% + }\relax + \@ifpackageloaded{hyperref}{% + \g@addto@macro\MT@setupfont@hook{% + \chardef\%`\% + \chardef\#`\# + }% +% \end{macrocode} +% We disable \microtype's additions inside \pkg{hyperref}'s \cmd{\pdfstringdef}, +% which redefines lots of commands. +%\changes{v1.9}{2005/09/10}{disable \microtype\ setup inside \pkg{hyperref}'s +% \cmd{\pdfstringdef} (reported by \thanh)} ^^A private mail, 10/9/05 +% \begin{macrocode} + \pdfstringdefDisableCommands{% + \let\pickup@font\MT@orig@pickupfont +%<*beta> + \let\lsstyle\@empty + \let\textls\@firstofone +% + }% + }\relax +} +% \end{macrocode} +%\changes{v1.6}{2005/01/19}{load a font, if none is active} +% We need a font (the \pkg{minimal} class doesn't load one). +% \begin{macrocode} +\expandafter\ifx\the\font\nullfont\normalfont\fi +% \end{macrocode} +% +%\subsection{Auxiliary macros} +% +%\begin{macro}{\MT@etex@no} +% Test whether we are using \etex. Cases: +%\begin{itemize} +% \item[|0|:] not running \etex +% \item[|1|:] running \etex +%\end{itemize} +% \begin{macrocode} +\let\MT@etex@no\z@ +\ifx\eTeXversion\@undefined \else + \ifx\eTeXversion\relax \else + \ifnum\eTeXversion>\z@ + \let\MT@etex@no\@ne + \fi + \fi +\fi +% \end{macrocode} +%\end{macro} +%\changes{v1.4b}{2004/11/21}{optimization: use less \cmd{\csname}s and \cmd{\expandafter}s} +%\begin{macro}{\MT@def@n} +% This is \cmd{\@namedef}. +% \begin{macrocode} +\def\MT@def@n#1{\expandafter\def\csname #1\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@edef@n} +% Its expanding version. +% \begin{macrocode} +\def\MT@edef@n#1{\expandafter\edef\csname #1\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@let@nc} +% \cmd{\let} a \cmd{\csname} sequence to a command. +% \begin{macrocode} +\def\MT@let@nc#1{\expandafter\let\csname #1\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@let@cn} +% \cmd{\let} a command to a \cmd{\csname} sequence. +% \begin{macrocode} +\def\MT@let@cn#1#2{\expandafter\let\expandafter#1\csname #2\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@let@nn} +% \cmd{\let} a \cmd{\csname} sequence to a \cmd{\csname} sequence. +% \begin{macrocode} +\def\MT@let@nn#1{\expandafter\MT@let@cn\csname #1\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@exp@string} +% Remove trailing space. +% \begin{macrocode} +\def\MT@exp@string{\expandafter\string} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@exp@one@n} +% Expand the second token once and enclose it in braces. +% \begin{macrocode} +\def\MT@exp@one@n#1#2{\expandafter#1\expandafter{#2}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@exp@two@c} +% Expand the next two tokens after \meta{\#1} once. +% \begin{macrocode} +\def\MT@exp@two@c#1{\expandafter\expandafter\expandafter#1\expandafter} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@exp@two@n} +%\changes{v1.9}{2005/09/28}{new macros: less \cmd{\expandafter}s} +% Expand the next two tokens after \meta{\#1} once and enclose them in braces. +% \begin{macrocode} +\def\MT@exp@two@n#1#2#3{\expandafter\expandafter\expandafter + #1\expandafter\expandafter\expandafter + {\expandafter#2\expandafter}\expandafter{#3}} +% \end{macrocode} +%\end{macro} +% You do not wonder why \cmd{\MT@exp@one@c} doesn't exist, do you? +%\begin{macro}{\MT@hop@fi} +%\begin{macro}{\MT@hop@else@fi} +% We need this a couple of lines down to mask \cs{ifcsname}~\dots\ \cs{fi} and +% \cs{ifdefined}~\dots\ \cs{fi}, if \cs{ifcsname} and \cs{ifdefined} aren't +% defined. +% \begin{macrocode} +\def\MT@hop@fi#1\fi{\fi#1} +\def\MT@hop@else@fi#1\else#2\fi{\fi#1} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\changes{v1.6}{2005/01/19}{use \etex's \cs{ifcsname} and \cs{ifdefined} if defined} +%\begin{macro}{\MT@ifdefined@c} +%\begin{macro}{\MT@ifdefined@n} +% Wrapper for testing whether command resp. \cmd{\csname} sequence is defined. +% \begin{macrocode} +\ifcase\MT@etex@no \MT@hop@else@fi{% +%\MT@dinfo@nl{0}{not running etex}% + \def\MT@ifdefined@c#1{% + \ifx#1\@undefined + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + } + \def\MT@ifdefined@n#1{% + \begingroup\MT@exp@two@c\endgroup + \ifx\csname #1\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + } +}\else\MT@hop@fi{% +% \end{macrocode} +% If we are running \etex, we will use its primitives \cs{ifdefined} and +% \cs{ifcsname}, which decreases memory use substantially. +% \begin{macrocode} +%\MT@dinfo@nl{0}{running etex}% + \def\MT@ifdefined@c#1{% + \ifdefined#1% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + } + \def\MT@ifdefined@n#1{% + \ifcsname#1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + } +}\fi +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@ifempty} +% Test whether argument is empty. +%\changes{v1.1}{2004/09/15}{bug fix: use category code 12 for the percent character +% (reported by Tom Kink)} ^^A +% ^^A in +% \begin{macrocode} +\begingroup +\catcode`\%=12 +\catcode`\&=14 +\gdef\MT@ifempty#1{& + \if %#1%& + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\endgroup +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ifnumber} +% Test whether argument is a number [0-9] (using an old trick by Mr. Arseneau). +% \begin{macrocode} +\def\MT@ifnumber#1{% + \if!\ifnum9<1#1!\else?\fi + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ifdimen} +% Test whether argument is dimension (or number). +%\changes{v1.4b}{2004/11/22}{don't set \cs{MT@count} globally (save stack problem)} +% \begin{macrocode} +\def\MT@ifdimen#1{% + \setbox\z@=\hbox{% + \MT@count=1#1\relax + \ifnum\MT@count=\@ne + \aftergroup\@secondoftwo + \else + \aftergroup\@firstoftwo + \fi}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ifgt} +%\begin{macro}{\MT@iflt} +%\begin{macro}{\MT@ifeq} +% Test whether dimensions are smaller, larger or equal. +% \begin{macrocode} +\def\MT@ifgt#1#2{% + \ifdim #1\p@ > #2\p@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\MT@iflt#1#2{% + \ifdim #1\p@ < #2\p@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\MT@ifeq#1#2{% + \ifdim #1\p@ = #2\p@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@ifstreq} +% Test whether two strings (fully expanded) are equal. +% \begin{macrocode} +\def\MT@ifstreq#1#2{% + \edef\x{#1}% + \edef\y{#2}% + \ifx\x\y + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@xadd} +%\changes{v1.8}{2005/04/17}{simplified} +% Add item to a list. +% \begin{macrocode} +\def\MT@xadd#1#2{% + \ifx#1\relax + \xdef#1{#2}% + \else + \xdef#1{#1#2}% + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@xaddb} +% Add item to the beginning. +% \begin{macrocode} +\def\MT@xaddb#1#2{% + \ifx#1\relax + \xdef#1{#2}% + \else + \xdef#1{#2#1}% + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@map@clist@n} +%\changes{v1.8}{2005/04/17}{new macro: used instead of \cmd{\@for}} +%\begin{macro}{\MT@map@clist@c} +%\begin{macro}{\MT@map@clist@} +%\begin{macro}{\MT@clist@function} +%\begin{macro}{\MT@clist@break} +% Run \meta{\#2} on all elements of the comma list \meta{\#1}. This and the +% following is modelled after \LaTeX3 commands. +% \begin{macrocode} +\def\MT@map@clist@n#1#2{% + \ifx\@empty#1\else + \def\MT@clist@function##1{#2}% + \expandafter\MT@map@clist@ + \expandafter#1,\@nil,\@nnil,% + \fi +} +\def\MT@map@clist@c#1{\expandafter\MT@map@clist@n\expandafter{#1}} +\def\MT@map@clist@#1,{% + \ifx\@nil#1% + \MT@clist@break + \else + \MT@clist@function{#1}% + \expandafter\MT@map@clist@ + \fi +} +\def\MT@clist@break#1\@nnil,{\fi} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@map@tlist@n} +%\changes{v1.8}{2005/04/16}{new macro: used instead of \cmd{\@tfor}} +%\begin{macro}{\MT@map@tlist@c} +%\begin{macro}{\MT@map@tlist@} +%\begin{macro}{\MT@tlist@break} +% Execute \meta{\#2} on all elements of the token list \meta{\#1}. +% \cs{MT@tlist@break} can be used to jump out of the loop. +% \begin{macrocode} +\def\MT@map@tlist@n#1#2{% + \MT@map@tlist@#2#1\@nnil +} +\def\MT@map@tlist@c#1#2{% + \expandafter\MT@map@tlist@ + \expandafter#2#1\@nnil +} +\def\MT@map@tlist@#1#2{% + \ifx\@nnil#2\else + #1{#2}% + \expandafter\MT@map@tlist@ + \expandafter#1% + \fi +} +\def\MT@tlist@break#1\@nnil{\fi} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\ifMT@inlist@}\IndexNewif{MT@inlist@} +%\begin{macro}{\MT@in@clist} +% Test whether item \meta{\#1} is in comma list \meta{\#2}. +%\changes{v1.4b}{2004/11/22}{bug fix: compare with \cmd{\\} instead of \cmd{\relax} +% (discovered by Herb Schulz)} ^^A +% ^^A in +% \begin{macrocode} +\newif\ifMT@inlist@ +\def\MT@in@clist#1#2{% + \MT@inlist@false + \def\x##1#1,##2\@nnil{% + \ifx\\##2\\\else + \MT@inlist@true + \fi + }% + \expandafter\x#2,#1,\@nnil +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@rem@from@list} +% Remove item \meta{\#1} from comma list \meta{\#2}. +%\changes{v1.9}{2005/10/28}{new macro: remove an item from a comma list} +% \begin{macrocode} +\def\MT@rem@from@list#1#2{% + \def\x##1#1,##2\@nnil{% + \ifx\\##2\\\else + \def\x####1,#1,####2\@nnil{% + \gdef#2{##1####1}% + }% + \x##2,#1,\@nnil + \fi + }% + \expandafter\x#2,#1,\@nnil +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@in@tlist} +% Test whether item is in token list. +% \begin{macrocode} +\def\MT@in@tlist#1#2{% + \MT@inlist@false + \def\x{#1}% + \MT@map@tlist@c#2\MT@in@tlist@ +} +\def\MT@in@tlist@#1{% + \edef\y{#1}% + \ifx\x\y + \MT@inlist@true + \expandafter\MT@tlist@break + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@in@rlist} +%\changes{v1.8}{2005/04/20}{made recursive} +%\begin{macro}{\MT@in@rlist@} +%\begin{macro}{\MT@in@rlist@@} +%\begin{macro}{\MT@size@name} +% Test whether size \cs{MT@size} is in a list of ranges. Store the name of the +% list in \cs{MT@size@name} +% \begin{macrocode} +\def\MT@in@rlist#1{% + \MT@inlist@false + \MT@map@tlist@c#1\MT@in@rlist@ +} +\def\MT@in@rlist@#1{% + \expandafter\MT@in@rlist@@#1% +} +\def\MT@in@rlist@@#1#2#3{% + \MT@ifeq{#2}\m@ne{% + \MT@ifeq{#1}\MT@size + \MT@inlist@true + \relax + }{% + \MT@iflt\MT@size{#1}\relax{% + \MT@iflt\MT@size{#2}% + \MT@inlist@true + \relax + }% + }% + \ifMT@inlist@ + \def\MT@size@name{#3}% + \expandafter\MT@tlist@break + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@loop} +%\changes{v1.2}{2004/09/23}{bug fix: new macro, used instead of \cmd{\loop}} +%\begin{macro}{\MT@iterate} +%\begin{macro}{\MT@repeat} +% This is the same as \LaTeX's \cmd{\loop}, which we mustn't use, since this could +% confuse an outer \cmd{\loop} in the document. +% \begin{macrocode} +\def\MT@loop#1\MT@repeat{% + \def\MT@iterate{#1\relax\expandafter\MT@iterate\fi}% + \MT@iterate + \let\MT@iterate\relax +} +\let\MT@repeat\fi +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@while@num} +% Sweetness. +% \begin{macrocode} +\def\MT@while@num#1#2{\MT@loop #2\ifnum#1\MT@repeat} +% \end{macrocode} +%\end{macro} +%\changes{v1.4}{2004/11/12}{use one instead of five counters} +%\begin{macro}{\MT@count} +%\begin{macro}{\MT@increment} +% Increment macro \meta{\#1} by one. Saves using up too many counters. +%\changes{v1.7}{2005/03/07}{use \etex's \cmd{\numexpr} if available} +% \begin{macrocode} +\newcount\MT@count +\ifcase\MT@etex@no + \def\MT@increment#1{% + \MT@count=#1\relax + \advance\MT@count \@ne + \edef#1{\number\MT@count}% + } +\else +% \end{macrocode} +% The \etex\ way is slightly faster. +% \begin{macrocode} + \def\MT@increment#1{% + \edef#1{\number\numexpr #1 + 1\relax}% + } +\fi +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@scale} +%\changes{v1.7}{2005/02/12}{new macro: use \etex's \cs{numexpr} if available} +%\changes{v1.8}{2005/03/30}{bug fix: remove spaces in non-\etex\ variant +% (reported by Mark Rossi)} ^^A +% ^^A in +% Multiply and divide a counter. If we are using \etex, we will use its +% \cmd{\numexpr} primitive. This has the advantage that it is less likely to +% run into arithmetic overflow. The result of the division will be rounded +% instead of truncated. Therefore, we'll get a different (more accurate) +% result in about half of the cases. +% \begin{macrocode} +\ifcase\MT@etex@no + \def\MT@scale#1#2#3{% + \multiply #1 #2\relax + \ifnum #3 = \z@ \else + \divide #1 #3\relax + \fi + } +\else + \def\MT@scale#1#2#3{% + \ifnum #3 = \z@ + #1=\numexpr #1 * #2\relax + \else + #1=\numexpr #1 * #2 / #3\relax + \fi + } +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@remove@spaces} +% Remove spaces around \meta{\#1} (\cmd{\KV@@sp@def} is from \pkg{keyval}). +% It will be neutralized in \cs{MT@begin@catcodes}. +% \begin{macrocode} +\def\MT@remove@spaces#1{\expandafter\KV@@sp@def\expandafter#1\expandafter{#1}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@make@string} +%\changes{v1.8}{2005/05/07}{use \cmd{\@onelevel@sanitize}} +% Set the category code of all characters to 12. +% \begin{macrocode} +\let\MT@make@string\@onelevel@sanitize +% \end{macrocode} +%\end{macro} +%\changes{v1.7}{2005/03/07}{shorter command names} +%\begin{macro}{\MT@abbr@pr} +%\begin{macro}{\MT@abbr@ex} +%\begin{macro}{\MT@abbr@pr@c} +%\begin{macro}{\MT@abbr@ex@c} +%\begin{macro}{\MT@abbr@pr@inh} +%\begin{macro}{\MT@abbr@ex@inh} +%\begin{macro}{\MT@abbr@nl} +%\begin{macro}{\MT@abbr@sp} +%\begin{macro}{\MT@abbr@sp@c} +%\begin{macro}{\MT@abbr@sp@inh} +%\begin{macro}{\MT@abbr@kn} +%\begin{macro}{\MT@abbr@kn@c} +%\begin{macro}{\MT@abbr@kn@inh} +% Some abbreviations. Thus, we can have short command names but full-length +% log output. +% \begin{macrocode} +\def\MT@abbr@pr{protrusion} +\def\MT@abbr@ex{expansion} +\def\MT@abbr@pr@c{protrusion codes} +\def\MT@abbr@ex@c{expansion codes} +\def\MT@abbr@pr@inh{protrusion inheritance} +\def\MT@abbr@ex@inh{expansion inheritance} +\def\MT@abbr@nl{noligatures} +%<*beta> +\def\MT@abbr@sp{spacing} +\def\MT@abbr@sp@c{interword spacing codes} +\def\MT@abbr@sp@inh{interword spacing inheritance} +\def\MT@abbr@kn{kerning} +\def\MT@abbr@kn@c{kerning codes} +\def\MT@abbr@kn@inh{kerning inheritance} +% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@rbba@protrusion} +%\begin{macro}{\MT@rbba@expansion} +%\begin{macro}{\MT@rbba@spacing} +%\begin{macro}{\MT@rbba@kerning} +% These we also need the other way round. +% \begin{macrocode} +\def\MT@rbba@protrusion{pr} +\def\MT@rbba@expansion{ex} +%<*beta> +\def\MT@rbba@spacing{sp} +\def\MT@rbba@kerning{kn} +% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\subsection{Setting up a font} +% +%\begin{macro}{\MT@setupfont} +% Setting up a font entails checking whether protrusion/expansion is desired for +% the current font (\cs{MT@font@name}), and if so, adjusting \cmd{\lpcode} and +% \cmd{\rpcode} (protrusion) and \cmd{\efcode} (expansion) for each character. +% \begin{macrocode} +\def\MT@setupfont{% + \ifx\MT@vinfo\MT@info@nl + \MT@info{Setting up font `\MT@exp@string\MT@font'}\fi +% \end{macrocode} +% We might have to disable stuff when used together with adventurous packages. +% \begin{macrocode} + \MT@setupfont@hook +% \end{macrocode} +% The font properties must be extracted from \cs{MT@font@name}, since the current +% value of \cmd{\f@encoding} and friends may be wrong! +% \begin{macrocode} + \MT@exp@two@c\MT@split@name\string\MT@font\@nil +% \end{macrocode} +% Try to find a configuration file for the current font family. +%\changes{v1.2}{2004/09/29}{also search for alias font file} +% \begin{macrocode} + \MT@exp@one@n\MT@find@file\MT@family + \ifx\MT@familyalias\@empty \else + \MT@exp@one@n\MT@find@file\MT@familyalias\fi +% \end{macrocode} +%\changes{v1.2}{2004/09/26}{bug fix: call \cmd{\@@enc@update} if necessary} +% We have to make sure that \cmd{\cf@encoding} expands to the correct value (for +% later, in \cs{MT@get@slot}), which isn't the case when \cmd{\selectfont} +% chooses a new encoding (this would be done a second later in +% \cmd{\selectfont}, anyway -- three lines, to be exact). +% \begin{macrocode} + \ifx\f@encoding\cf@encoding\else\@@enc@update\fi +% \end{macrocode} +% Now we can begin setting up the font for all features. The following commands +% are \cmd{\let} to \cmd{\relax} if the respective feature is generally +% disabled. +% +% Protrusion has to be set up first, says Thành! +% \begin{macrocode} + \MT@protrusion + \MT@expansion +% \end{macrocode} +% Interword spacing and kerning. +% \begin{macrocode} +%<*beta> + \MT@spacing + \MT@kerning +% +% \end{macrocode} +% Disable ligatures? +% \begin{macrocode} + \MT@noligatures +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@split@name} +%\changes{v1.7}{2005/02/27}{don't define \cs{MT@encoding} \&c. \cmd{\global}ly} +%\begin{macro}{\MT@encoding} +%\begin{macro}{\MT@family} +%\begin{macro}{\MT@series} +%\begin{macro}{\MT@shape} +%\begin{macro}{\MT@size} +% Split up the font name. +% \begin{macrocode} +\def\MT@split@name#1/#2/#3/#4/#5\@nil{% + \def\MT@encoding{#1}% + \def\MT@family{#2}% + \def\MT@series{#3}% + \def\MT@shape{#4}% + \def\MT@size{#5}% +% \end{macrocode} +%\begin{macro}{\MT@familyalias} +% Alias family? +%\changes{v1.2}{2004/09/29}{define alias font name as an alternative, not +% as a replacement} +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@family @alias}% + {\MT@let@cn\MT@familyalias{MT@\MT@family @alias}}% + {\let\MT@familyalias\@empty}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\ifMT@do}\IndexNewif{MT@do} +%\begin{macro}{\MT@feat} +%\begin{macro}{\MT@maybe@do} +% We check all features of the current font against the lists of the currently +% active font set, and set \cs{ifMT@do} accordingly. +%\changes{v1.2}{2004/09/29}{also check for alias font name} +%\changes{v1.9}{2005/09/28}{redone} +% \begin{macrocode} +\newif\ifMT@do +\def\MT@maybe@do#1{% +% \end{macrocode} +% (but only if the feature isn't globally set to false) +% \begin{macrocode} + \expandafter\csname ifMT@\csname MT@abbr@#1\endcsname\endcsname +% \end{macrocode} +% Begin with setting micro-typography to true for this font. The +% \cs{MT@checklist@...} tests will set it to false if the property is not in +% the list. The first non-empty list that does not contain a match will stop us +% (except for |font|). +% \begin{macrocode} + \MT@dotrue + \MT@map@clist@n{font,encoding,family,series,shape,size}{% + \MT@ifdefined@n{MT@checklist@##1}% + {\csname MT@checklist@##1\endcsname}% + {\MT@checklist@{##1}}% + {#1}% + }% + \else + \MT@dofalse + \fi + \ifMT@do +% \end{macrocode} +% \cs{MT@feat} stores the current feature. +% \begin{macrocode} + \def\MT@feat{#1}% + \csname MT@set@#1@codes\endcsname + \else + \MT@vinfo{... No \@nameuse{MT@abbr@#1}}% + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@checklist@} +% The generic test. +% \begin{macrocode} +\def\MT@checklist@#1#2{% + \edef\@tempa{\csname MT@#2@setname\endcsname}% + \MT@ifdefined@n{MT@#2list@#1@\@tempa}{% +% \end{macrocode} +% Begin a \cmd{\expandafter} orgy to test whether the font characteristic is in +% the list. +% \begin{macrocode} + \expandafter\expandafter\expandafter + \MT@in@clist\expandafter\expandafter\expandafter + {\csname MT@#1\expandafter\endcsname\expandafter}% + \csname MT@#2list@#1@\@tempa\endcsname + \ifMT@inlist@ +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#2}: #1 `\@nameuse{MT@#1}' in list}% + \MT@dotrue + \else +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#2}: #1 `\@nameuse{MT@#1}' not in list}% + \MT@dofalse + \expandafter\MT@clist@break + \fi + }{% +% \end{macrocode} +% If no limitations have been specified, i.e. the list for a font characteristic +% has not been defined at all, the font should be expanded resp. protruded. +% \begin{macrocode} +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#2}: #1 list empty}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@checklist@font} +% If the font matches, we skip the rest of the test. +% \begin{macrocode} +\def\MT@checklist@font#1{% + \edef\@tempa{\csname MT@#1@setname\endcsname}% + \MT@ifdefined@n{MT@#1list@font@\@tempa}{% + \MT@exp@two@n\MT@in@clist + \MT@font{\csname MT@#1list@font@\@tempa\endcsname}% + \ifMT@inlist@ +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: font `\MT@font' in list}% + \expandafter\MT@clist@break + \else +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: font `\MT@font' not in list}% + \MT@dofalse + \fi + }{% +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: font list empty}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@checklist@family} +% Also test for the alias font, if the original font is not in the list. +%\changes{v1.4b}{2004/11/22}{bug fix: don't try alias family name if encoding failed} +%\changes{v1.9}{2005/07/12}{bug fix: add two missing \cmd{\expandafter}s} +% \begin{macrocode} +\def\MT@checklist@family#1{% + \edef\@tempa{\csname MT@#1@setname\endcsname}% + \MT@ifdefined@n{MT@#1list@family@\@tempa}{% + \MT@exp@two@n\MT@in@clist + \MT@family{\csname MT@#1list@family@\@tempa\endcsname}% + \ifMT@inlist@ +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: family `\@nameuse{MT@family}' in list}% + \MT@dotrue + \else +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: family `\@nameuse{MT@family}' not in list}% + \MT@dofalse + \ifx\MT@familyalias\@empty \else + \MT@exp@two@n\MT@in@clist + \MT@familyalias{\csname MT@#1list@family@\@tempa\endcsname}% + \ifMT@inlist@ +% \MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: alias `\MT@familyalias' in list}% + \MT@dotrue +%\else\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: alias `\MT@familyalias' not in list}% + \fi + \fi + \fi + \ifMT@do \else + \expandafter\MT@clist@break + \fi + }{% +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: family list empty}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@checklist@size} +% Test whether font size is in list of size ranges. +% \begin{macrocode} +\def\MT@checklist@size#1{% + \edef\@tempa{\csname MT@#1@setname\endcsname}% + \MT@ifdefined@n{MT@#1list@size@\@tempa}{% + \expandafter\MT@in@rlist + \csname MT@#1list@size@\@tempa\endcsname + \ifMT@inlist@ +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: size `\MT@size' in list}% + \MT@dotrue + \else +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: size `\MT@size' not in list}% + \MT@dofalse + \expandafter\MT@clist@break + \fi + }{% +%\MT@dinfo@nl{1}{\@nameuse{MT@abbr@#1}: size list empty}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Protrusion} +% +%\begin{macro}{\MT@protrusion} +% Set up for protrusion? +% \begin{macrocode} +\def\MT@protrusion{\MT@maybe@do{pr}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@pr@codes} +% This macro is called by \cs{MT@setupfont}, and does all the work for setting +% up a font for protrusion. +%\changes{v1.5}{2004/12/10}{adjust protrusion factors before setting the inheriting +% characters} +%\changes{v1.6}{2004/12/18}{introduce \texttt{factor} option} +% \begin{macrocode} +\def\MT@set@pr@codes{% + \MT@reset@pr@codes +% \end{macrocode} +% Check whether and if, which list should be applied to the current font. +% \begin{macrocode} + \MT@if@list@exists{% + \MT@get@dimen@six + \MT@get@opt +% \end{macrocode} +% Get the name of the inheritance list and parse it. +% \begin{macrocode} + \MT@get@inh@list +% \end{macrocode} +% Load additional lists? +% \begin{macrocode} + \MT@load@list{\MT@pr@c@name}% +% \end{macrocode} +% Load the main list. +% \begin{macrocode} + \edef\MT@curr@list@name{protrusion list `\MT@pr@c@name'}% + \MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}% + \expandafter\MT@pr@do\@tempc,\relax,% + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@all@pr} +% Set all protrusion codes of the font. +% \begin{macrocode} +\def\MT@set@all@pr#1#2{% +%\MT@dinfo@nl{3}{-- lp/rp: setting all to \number#1/\number#2}% + \@tempcnta=\z@ + \MT@while@num{\@tempcnta < \@cclvi}{% + \lpcode\MT@font\@tempcnta=#1\relax + \rpcode\MT@font\@tempcnta=#2\relax + \advance\@tempcnta \@ne + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@reset@pr@codes} +%\begin{macro}{\MT@reset@pr@codes@} +% All protrusion codes are zero for new fonts. However, if we have to reload +% the font due to different contexts, we have to reset them. +% This command will be changed by \cs{microtypecontext} if necessary. +% \begin{macrocode} +\def\MT@reset@pr@codes@{\MT@set@all@pr\z@\z@} +\let\MT@reset@pr@codes\relax +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@gobble@settings} +%\begin{macro}{\MT@dimen@six} +%\begin{macro}{\MT@get@dimen@six} +%\changes{v1.8}{2005/05/03}{new macro: test whether \cmd{\fontdimen}6 is defined} +% If \cmd{\fontdimen}\,6 is zero, character protrusion won't work, and we can +% skip the settings (for example, the \pkg{dsfont} fonts don't specify this +% dimension; this is probably a bug). +% \begin{macrocode} +\def\MT@get@dimen@six{% + \ifnum\fontdimen6\MT@font=\z@ + \MT@warning@nl{% + Font `\MT@exp@string\MT@font' does not specify its\MessageBreak + \@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak + \@nameuse{MT@abbr@\MT@feat} will not work with this font}% + \expandafter\MT@gobble@settings + \else + \edef\MT@dimen@six{\number\fontdimen6\MT@font}% + \fi +} +\def\MT@gobble@settings#1\@tempc,\relax,{} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@pr@do} +% Split up the values and set \cmd{\lpcode} and \cmd{\rpcode}. +% \begin{macrocode} +\def\MT@pr@do#1,{% + \ifx\relax#1\@empty\else + \MT@pr@split #1==\relax + \expandafter\MT@pr@do + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@pr@split} +%\changes{v1.1}{2004/09/13}{bug fix: allow zero and negative values} +%\changes{v1.8}{2005/05/25}{get character width once only} +% The \pkg{keyval} package would remove spaces here, which we needn't do since +% \cs{SetProtrusion} ignores spaces in the protrusion list anyway. +% \begin{macrocode} +\def\MT@pr@split#1=#2=#3\relax{% + \def\@tempa{#1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \MT@get@char@unit + \MT@pr@split@val#2\relax + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@pr@split@val} +% \begin{macrocode} +\def\MT@pr@split@val#1,#2\relax{% + \def\@tempb{#1}% + \MT@ifempty\@tempb\relax{% + \MT@scale@to@em + \lpcode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char}% + }% + \def\@tempb{#2}% + \MT@ifempty\@tempb\relax{% + \MT@scale@to@em + \rpcode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char}% + }% +% \end{macrocode} +% Now we can set the values for the inheriting characters. Their slot numbers +% are saved in the macro |\MT@inh@|\meta{list name}|@|\meta{slot number}|@|. +% \begin{macrocode} + \MT@ifdefined@c\MT@pr@inh@name{% + \MT@ifdefined@n{MT@inh@\MT@pr@inh@name @\MT@char @}{% + \expandafter\MT@map@tlist@c + \csname MT@inh@\MT@pr@inh@name @\MT@char @\endcsname + \MT@set@pr@heirs + }\relax + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@scale@to@em} +% Since \pdftex\ version 0.14h, we have to adjust the protrusion factors (\ie, +% convert numbers from thousandths of character width to thousandths of an +% \emph{em} of the font). We have to do this \emph{before} setting the +% inheriting characters, so that the latter inherit the absolute value, not the +% relative one if they have a differing width (\eg\ the `ff' ligature). +%\changes{v1.5}{2004/12/10}{don't use \cmd{\lpcode} and \cmd{\rpcode} for the +% calculation} +% Unlike \file{protcode.tex} and \pkg{pdfcprot}, we do not calculate with +% \cs{lpcode} resp. \cs{rpcode}, since this would disallow protrusion factors +% larger than the character width (since \cs{[lr]pcode}'s limit is 1000). Now, +% the maximum protrusion is 1em of the font. +% +% The unit is in \cs{MT@count}, the desired factor in \cmd{\@tempb}, and the +% result will be returned in \cmd{\@tempcntb}. +% \begin{macrocode} +\ifnum\MT@pdftex@no > \tw@ + \def\MT@scale@to@em{% + \@tempcntb=\MT@count\relax +% \end{macrocode} +% For really huge fonts (100pt or so), an arithmetic overflow could occur with +% vanilla \TeX. Using \etex, this can't happen, since the intermediate value +% is 64 bit, which could only be reached with a character width larger than +% \cs{maxdimen}. +% \begin{macrocode} + \MT@scale\@tempcntb \@tempb \MT@dimen@six + \ifnum\@tempcntb=\z@ \else + \MT@scale@factor + \fi + } +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@charwd} +% Get the width of the character. When using \etex, we can employ +% \cmd{\fontcharwd} instead of building scratch boxes. +%\changes{v1.6}{2005/01/19}{use \etex's \cmd{\fontcharwd}, if available} +%\changes{v1.8}{2005/05/25}{warning for missing (resp. zero-width) characters} +% \begin{macrocode} + \ifcase\MT@etex@no + \def\MT@get@charwd{% + \setbox\z@=\hbox{\MT@font \char\MT@char}% + \MT@count=\wd\z@\relax + \ifnum\MT@count=\z@ \MT@warn@missing@char \fi + } + \else + \def\MT@get@charwd{% + \MT@count=\number\fontcharwd\MT@font\MT@char\relax + \ifnum\MT@count=\z@ \MT@warn@missing@char \fi + } + \fi +% \end{macrocode} +%\end{macro} +% No adjustment with versions 0.14f and 0.14g. +% \begin{macrocode} +\else + \def\MT@scale@to@em{% + \MT@count=\@tempb\relax + \ifnum\MT@count=\z@ \else + \MT@scale@factor + \fi + } +% \end{macrocode} +% We need this in \cs{MT@warn@code@too@large} (neutralized). +% \begin{macrocode} + \def\MT@get@charwd{\MT@count=\MT@dimen@six} +\fi +% \end{macrocode} +%\begin{macro}{\MT@get@font@dimen} +% For the |space| unit. +% \begin{macrocode} +\def\MT@get@font@dimen#1{% + \MT@count=\number\fontdimen#1\MT@font +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@missing@char} +% Warning for missing characters, or characters with zero width. +% \begin{macrocode} +\ifcase\MT@etex@no \MT@hop@else@fi{% + \def\MT@warn@missing@char{% + \MT@warning@nl{% + Character `\the\mt@toks' has a width of 0pt\MessageBreak + (it's probably missing) in font `\MT@exp@string\MT@font'.\MessageBreak + It cannot be protruded}% + } +}\else\MT@hop@fi{% + \def\MT@warn@missing@char{% + \MT@warning@nl{Character `\the\mt@toks' + \iffontchar\MT@font\MT@char has a width of 0pt \else is missing \fi + in font\MessageBreak `\MT@exp@string\MT@font'. It cannot be protruded}% + } +}\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@scale@factor} +%\changes{v1.5}{2004/12/10}{warning for factors outside limits} +%\changes{v1.9}{2005/09/28}{generalized} +% Furthermore, we might have to multiply with a factor. +% \begin{macrocode} +\def\MT@scale@factor{% + \ifnum\csname MT@\MT@feat @factor@\endcsname=\@m \else + \expandafter\MT@scale\expandafter + \@tempcntb \csname MT@\MT@feat @factor@\endcsname \@m + \fi + \ifnum\@tempcntb > \csname MT@\MT@feat @max\endcsname\relax + \@tempcnta=\csname MT@\MT@feat @max\endcsname + \MT@warn@code@too@large + \else + \ifnum\@tempcntb<\csname MT@\MT@feat @min\endcsname\relax + \@tempcnta=\csname MT@\MT@feat @min\endcsname + \MT@warn@code@too@large + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@code@too@large} +% Type out a warning if a chosen protrusion factor is too large after the +% conversion. As a special service, we also type out the maximum amount that +% may be specified in the configuration file. +%\changes{v1.7}{2005/02/17}{new macro: type out maximum protrusion factor} +% \begin{macrocode} +\def\MT@warn@code@too@large{% + \ifnum\csname MT@\MT@feat @factor@\endcsname=\@m \else + \expandafter\MT@scale\expandafter\@tempcnta\expandafter\@m + \csname MT@\MT@feat @factor@\endcsname + \fi + \MT@scale\@tempcnta \MT@dimen@six \MT@count + \MT@warning@nl{The \@nameuse{MT@abbr@\MT@feat} code \@tempb\space + is too large for character\MessageBreak + `\the\mt@toks' in \MT@curr@list@name.\MessageBreak + Setting it to the maximum of \number\@tempcnta}% + \@tempcntb=\@tempcnta +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@opt} +% The optional argument to \cs{SetProtrusion}, \cs{SetExtraSpacing} and +% \cs{SetExtraKerning} (\cs{SetExpansion} is being dealt with in +% \cs{MT@get@ex@opt}). +% \begin{macrocode} +\def\MT@get@opt{% +% \end{macrocode} +%\begin{macro}{\MT@pr@factor@} +%\begin{macro}{\MT@sp@factor@} +%\begin{macro}{\MT@kn@factor@} +% Apply a factor? +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @factor}{% + \MT@let@nn{MT@\MT@feat @factor@} + {MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @factor}% + \MT@vinfo{... : Multiplying \@nameuse{MT@abbr@\MT@feat} codes by + \number\csname MT@\MT@feat @factor@\endcsname/1000}% + }{% + \MT@let@nn{MT@\MT@feat @factor@}{MT@\MT@feat @factor}% + }% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@pr@unit@} +%\begin{macro}{\MT@sp@unit@} +%\begin{macro}{\MT@kn@unit@} +% The |unit| can only be evaluated here, since it might be font-specific. +% If it's \cmd{\@empty}, it's relative to character widths, if it's -1, relative +% to space dimensions. +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @unit}{% + \MT@let@nn{MT@\MT@feat @unit@}% + {MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @unit}% + \expandafter\ifx\csname MT@\MT@feat @unit@\endcsname\@empty + \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} codes + relative to character widths}% + \else + \expandafter\ifx\csname MT@\MT@feat @unit@\endcsname\m@ne + \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} codes + relative to width of space}% + \fi + \fi + }{% + \MT@let@nn{MT@\MT@feat @unit@}{MT@\MT@feat @unit}% + }% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@get@space@unit} +%\begin{macro}{\MT@get@char@unit} +% The codes are either relative to character widths, or to a fixed width. +% For spacing and kerning lists, they may also be relative to the width of +% the interword glue. +% Only the setting from the top list will be taken into account. +% \begin{macrocode} + \let\MT@get@char@unit\relax + \let\MT@get@space@unit\@gobble + \expandafter\ifx\csname MT@\MT@feat @unit@\endcsname\@empty + \let\MT@get@char@unit\MT@get@charwd + \else + \expandafter\ifx\csname MT@\MT@feat @unit@\endcsname\m@ne + \let\MT@get@space@unit\MT@get@font@dimen + \else + \expandafter\MT@get@unit\csname MT@\MT@feat @unit@\endcsname + \fi + \fi +% \end{macrocode} +%\end{macro} +%\end{macro} +% Preset all characters? +%\changes{v1.9}{2005/10/08}{new key `\texttt{preset}' to set all characters to +% the specified value before loading the lists} +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@feat @c@\csname MT@\MT@feat @c@name\endcsname @preset}{% + \csname MT@preset@\MT@feat\endcsname + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@unit} +%\changes{v1.8}{2005/04/14}{new macro: get unit for codes} +%\begin{macro}{\MT@get@unit@} +% If |unit| contains an |em| or |ex|, we use the corresponding \cmd{\fontdimen} +% to obtain the real size. Simply converting the |em| into points might give a +% wrong result, since the font probably isn't set up yet, so that these +% dimensions haven't been updated, either. +% \begin{macrocode} +\def\MT@get@unit#1{% + \expandafter\MT@get@unit@#1 e!\@nil + \ifx\x\@empty\else\let#1\x\fi + \@defaultunits\@tempdima#1 pt\relax\@nnil + \ifdim\@tempdima=\z@ + \MT@warning@nl{% + Cannot set \@nameuse{MT@abbr@\MT@feat} factors relative to zero\MessageBreak + width. Setting factors of list `\@nameuse{MT@\MT@feat @c@name}'\MessageBreak + relative to character widths instead}% + \let#1\@empty + \let\MT@get@char@unit\MT@get@charwd + \else + \MT@vinfo{... : Setting \@nameuse{MT@abbr@\MT@feat} factors relative + to \the\@tempdima}% + \MT@count=\number\@tempdima\relax + \fi +} +\def\MT@get@unit@#1e#2#3\@nil{% + \ifx\\#3\\\let\x\@empty \else + \if m#2% + \edef\x{#1\fontdimen6\MT@font}% + \else + \if x#2% + \edef\x{#1\fontdimen5\MT@font}% + \fi + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@pr@heirs} +% Set the inheriting characters. +% \begin{macrocode} +\def\MT@set@pr@heirs#1{% + \lpcode\MT@font#1=\lpcode\MT@font\MT@char + \rpcode\MT@font#1=\rpcode\MT@font\MT@char +%<*debug> + \MT@dinfo@nl{2}{-- heir of \MT@char: #1}% + \MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char/% + \number\rpcode\MT@font\MT@char}% +% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@preset@pr} +%\begin{macro}{\MT@preset@pr@} +% \begin{macrocode} +\def\MT@preset@pr{% + \expandafter\expandafter\expandafter\MT@preset@pr@ + \csname MT@pr@c@\MT@pr@c@name @preset\endcsname\@nil +} +\def\MT@preset@pr@#1,#2\@nil{% + \ifx\MT@pr@unit@\@empty + \MT@warning@nl{% + Cannot preset characters relative to their widths\MessageBreak + for protrusion list `\MT@pr@c@name'. Presetting them\MessageBreak + relative to 1em instead}% + \let\MT@preset@aux\MT@preset@aux@factor + \else + \let\MT@preset@aux\MT@preset@aux@space + \fi + \MT@preset@aux{#1}\@tempa + \MT@preset@aux{#2}\@tempb + \MT@set@all@pr\@tempa\@tempb +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@preset@aux} +%\begin{macro}{\MT@preset@aux@factor} +%\begin{macro}{\MT@preset@aux@space} +% Auxiliary macro for presetting. Store value \meta{\#1} in macro \meta{\#2}. +% \begin{macrocode} +\def\MT@preset@aux@factor#1#2{% + \@tempcntb=#1\relax + \MT@scale@factor + \edef#2{\number\@tempcntb}% +} +\def\MT@preset@aux@space#1#2{% + \def\@tempb{#1}% + \MT@get@space@unit\tw@ + \MT@scale@to@em + \edef#2{\number\@tempcntb}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\subsubsection{Expansion} +% +%\begin{macro}{\MT@expansion} +% Set up for expansion? +% \begin{macrocode} +\def\MT@expansion{\MT@maybe@do{ex}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@ex@codes@s} +% Setting up font expansion is a bit different because of the \opt{selected} option. +% There are two versions of this macro. +% +% If \opt{selected}|=true|, we only apply font expansion to those fonts for which a +% list has been declared (\ie, like for protrusion). +% \begin{macrocode} +\def\MT@set@ex@codes@s{% + \MT@if@list@exists{% + \MT@get@ex@opt + \MT@reset@ef@codes + \MT@get@inh@list + \MT@load@list{\MT@ex@c@name}% + \edef\MT@curr@list@name{expansion list `\MT@ex@c@name'}% + \MT@let@cn\@tempc{MT@ex@c@\MT@ex@c@name}% + \expandafter\MT@ex@do\@tempc,\relax,% + \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@\relax + }\relax +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\MT@set@ex@codes@n} +% If, on the other hand, all characters should be expanded by the same amount, +% we only take the first optional argument to \cs{SetExpansion} into account. +%\begin{macro}{\ifMT@nonselected}\IndexNewif{MT@nonselected} +% We need this boolean in \cs{MT@if@list@exists} so that no warning for missing +% lists will be issued. +% \begin{macrocode} +\newif\ifMT@nonselected +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\def\MT@set@ex@codes@n{% + \MT@nonselectedtrue + \MT@if@list@exists + \MT@get@ex@opt + {% + \let\MT@stretch@\MT@stretch + \let\MT@shrink@\MT@shrink + \let\MT@step@\MT@step + \let\MT@auto@\MT@auto + \let\MT@ex@factor@\MT@ex@factor + }% + \MT@reset@ef@codes + \pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@\relax + \MT@nonselectedfalse +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@ex@codes} +%\changes{v1.5}{2004/12/02}{allow non-selected font expansion} +%\changes{v1.6}{2004/12/26}{introduce \texttt{factor} option} +%\changes{v1.7}{2005/02/06}{two versions of this macro} +% Default is non-selected. It can be changed in the package options. +% \begin{macrocode} +\let\MT@set@ex@codes\MT@set@ex@codes@n +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@all@ex} +%\begin{macro}{\MT@reset@ef@codes@} +% At first, all expansion factors for the characters will be set to 1000 +% (respectively the |factor| of this font). +% \begin{macrocode} +\def\MT@set@all@ex#1{% +%\MT@dinfo@nl{3}{-- ex: setting all to \number#1}% + \@tempcnta=\z@ + \MT@while@num{\@tempcnta < \@cclvi}{% + \efcode\MT@font\@tempcnta=#1\relax + \advance\@tempcnta \@ne + }% +} +\def\MT@reset@ef@codes@{\MT@set@all@ex\MT@ex@factor@} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@reset@ef@codes} +% However, this is only necessary for versions prior to~1.20. +%\changes{v1.6a}{2005/01/30}{only reset \cmd{\efcode}s for older \pdftex\ versions} +% \begin{macrocode} +\ifnum\MT@pdftex@no < 4 + \let\MT@reset@ef@codes\MT@reset@ef@codes@ +\else + \def\MT@reset@ef@codes{% + \ifnum\MT@ex@factor@=\@m \else + \MT@reset@ef@codes@ + \fi + } +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ex@do} +% There's only one number per character. +% \begin{macrocode} +\def\MT@ex@do#1,{% + \ifx\relax#1\@empty \else + \MT@ex@split #1==\relax + \expandafter\MT@ex@do + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@ex@split} +% \begin{macrocode} +\def\MT@ex@split#1=#2=#3\relax{% + \def\@tempa{#1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \@tempcntb=#2\relax +% \end{macrocode} +% Take an optional factor into account. +% \begin{macrocode} + \ifnum\MT@ex@factor@=\@m \else + \MT@scale\@tempcntb \MT@ex@factor@ \@m + \fi + \ifnum\@tempcntb > \MT@ex@max + \MT@warn@ex@too@large\MT@ex@max + \else + \ifnum\@tempcntb < \MT@ex@min + \MT@warn@ex@too@large\MT@ex@min + \fi + \fi + \efcode\MT@font\MT@char=\@tempcntb +% \MT@dinfo@nl{4}{::: ef (\MT@char): \number\efcode\MT@font\MT@char}% +% \end{macrocode} +% Heirs, heirs, I love thy heirs. +% \begin{macrocode} + \MT@ifdefined@c\MT@ex@inh@name{% + \MT@ifdefined@n{MT@inh@\MT@ex@inh@name @\MT@char @}{% + \expandafter\MT@map@tlist@c + \csname MT@inh@\MT@ex@inh@name @\MT@char @\endcsname + \MT@set@ex@heirs + }\relax + }\relax + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@ex@too@large} +% \begin{macrocode} +\def\MT@warn@ex@too@large#1{% + \MT@warning@nl{Expansion factor + \number\@tempcntb\space too large for character\MessageBreak + `\the\mt@toks' in \MT@curr@list@name.\MessageBreak + Setting it to the maximum of \number#1}% + \@tempcntb=#1\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@ex@opt} +%\begin{macro}{\MT@ex@factor@} +%\begin{macro}{\MT@stretch@} +%\begin{macro}{\MT@shrink@} +%\begin{macro}{\MT@step@} +%\begin{macro}{\MT@auto@} +% Apply different values to this font? +% \begin{macrocode} +\def\MT@get@ex@opt{% + \MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @factor}{% + \MT@let@cn\MT@ex@factor@{MT@ex@c@\MT@ex@c@name @factor}% + \MT@vinfo{... : Multiplying expansion factors by \number\MT@ex@factor@/1000}% + }{% + \let\MT@ex@factor@\MT@ex@factor + }% + \MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @stretch}{% + \MT@let@cn\MT@stretch@{MT@ex@c@\MT@ex@c@name @stretch}% + \MT@vinfo{... : Setting stretch limit to \number\MT@stretch@}% + }{% + \let\MT@stretch@\MT@stretch + }% + \MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @shrink}{% + \MT@let@cn\MT@shrink@{MT@ex@c@\MT@ex@c@name @shrink}% + \MT@vinfo{... : Setting shrink limit to \number\MT@shrink@}% + }{% + \let\MT@shrink@\MT@shrink + }% + \MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @step}{% + \MT@let@cn\MT@step@{MT@ex@c@\MT@ex@c@name @step}% + \MT@vinfo{... : Setting expansion step to \number\MT@step@}% + }{% + \let\MT@step@\MT@step + }% + \MT@ifdefined@n{MT@ex@c@\MT@ex@c@name @auto}{% + \MT@let@cn\MT@auto@{MT@ex@c@\MT@ex@c@name @auto}% + \def\@tempa{autoexpand}% + \MT@vinfo{... : \ifx\@tempa\MT@auto@ En\else Dis\fi + abling automatic expansion}% + }{% + \let\MT@auto@\MT@auto + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@ex@heirs} +% \begin{macrocode} +\def\MT@set@ex@heirs#1{% + \efcode\MT@font#1=\efcode\MT@font\MT@char +%<*debug> + \MT@dinfo@nl{2}{-- heir of \MT@char: #1}% + \MT@dinfo@nl{4}{::: ef (#1) \number\efcode\MT@font\MT@char}% +% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@preset@ex} +% \begin{macrocode} +\def\MT@preset@ex{% + \@tempcntb=\csname MT@ex@c@\MT@ex@c@name @preset\endcsname\relax + \MT@scale@factor + \MT@set@all@ex\@tempcntb +} +% \end{macrocode} +%\end{macro} +% +% \begin{macrocode} +%<*beta> +% \end{macrocode} +% +%\subsubsection{Interword Space (Glue)} +% +%\begin{macro}{\MT@spacing} +% Adjustment of interword spacing? Only for sufficiently new versions of \pdftex. +% \begin{macrocode} +\ifnum\MT@pdftex@no > 5 + \def\MT@spacing{\MT@maybe@do{sp}} +\else + \let\MT@spacing\relax +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@sp@codes} +% This is all the same. +% \begin{macrocode} +\def\MT@set@sp@codes{% + \MT@reset@sp@codes + \MT@if@list@exists{% + \MT@get@dimen@six + \MT@get@opt + \MT@get@inh@list + \MT@load@list{\MT@sp@c@name}% + \edef\MT@curr@list@name{spacing list `\MT@sp@c@name'}% + \MT@let@cn\@tempc{MT@sp@c@\MT@sp@c@name}% + \expandafter\MT@sp@do\@tempc,\relax,% + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@sp@do} +% \begin{macrocode} +\def\MT@sp@do#1,{% + \ifx\relax#1\@empty \else + \MT@sp@split #1==\relax + \expandafter\MT@sp@do + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@sp@split} +% \begin{macrocode} +\def\MT@sp@split#1=#2=#3\relax{% + \def\@tempa{#1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \MT@get@char@unit + \MT@sp@split@val#2\relax + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@split@val} +% If |unit=space|, \cs{MT@get@space@unit} will be defined to fetch the +% corresponding fontdimen (2 for the first, 3 for the second and 4 for the +% third argument). +% \begin{macrocode} +\def\MT@sp@split@val#1,#2,#3\relax{% + \def\@tempb{#1}% + \MT@ifempty\@tempb\relax{% + \MT@get@space@unit\tw@ + \MT@scale@to@em + \knbscode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; knbs (\MT@char): \number\knbscode\MT@font\MT@char}% + }% + \def\@tempb{#2}% + \MT@ifempty\@tempb\relax{% + \MT@get@space@unit\thr@@ + \MT@scale@to@em + \stbscode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; stbs (\MT@char): \number\stbscode\MT@font\MT@char}% + }% + \def\@tempb{#3}% + \MT@ifempty\@tempb\relax{% + \MT@get@space@unit4% + \MT@scale@to@em + \shbscode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; shbs (\MT@char): \number\shbscode\MT@font\MT@char}% + }% + \MT@ifdefined@c\MT@sp@inh@name{% + \MT@ifdefined@n{MT@inh@\MT@sp@inh@name @\MT@char @}{% + \expandafter\MT@map@tlist@c + \csname MT@inh@\MT@sp@inh@name @\MT@char @\endcsname + \MT@set@sp@heirs + }\relax + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@sp@heirs} +% \begin{macrocode} +\def\MT@set@sp@heirs#1{% + \knbscode\MT@font#1=\knbscode\MT@font\MT@char + \stbscode\MT@font#1=\stbscode\MT@font\MT@char + \shbscode\MT@font#1=\shbscode\MT@font\MT@char +%<*debug> + \MT@dinfo@nl{2}{-- heir of \MT@char: #1}% + \MT@dinfo@nl{4}{;;; knbs/stbs/shbs (#1): \number\knbscode\MT@font\MT@char/% + \number\stbscode\MT@font\MT@char/% + \number\shbscode\MT@font\MT@char}% +% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@all@sp} +%\begin{macro}{\MT@reset@sp@codes} +%\begin{macro}{\MT@reset@sp@codes@} +% \begin{macrocode} +\def\MT@set@all@sp#1#2#3{% +%\MT@dinfo@nl{3}{-- knbs/stbs/shbs: setting all to \number#1/\number#2/\number#3}% + \@tempcnta=\z@ + \MT@while@num{\@tempcnta < \@cclvi}{% + \knbscode\MT@font\@tempcnta=#1\relax + \stbscode\MT@font\@tempcnta=#2\relax + \shbscode\MT@font\@tempcnta=#3\relax + \advance\@tempcnta \@ne + }% +} +\def\MT@reset@sp@codes@{\MT@set@all@sp\z@\z@\z@} +\let\MT@reset@sp@codes\relax +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@preset@sp} +%\begin{macro}{\MT@preset@sp@} +% \begin{macrocode} +\def\MT@preset@sp{% + \expandafter\expandafter\expandafter\MT@preset@sp@ + \csname MT@sp@c@\MT@sp@c@name @preset\endcsname\@nil +} +\def\MT@preset@sp@#1,#2,#3\@nil{% + \ifx\MT@sp@unit@\@empty + \MT@warning@nl{% + Cannot preset characters relative to their widths\MessageBreak + for spacing list `\MT@sp@c@name'. Presetting them\MessageBreak + relative to 1em instead}% + \MT@preset@aux@factor{#1}\@tempa + \MT@preset@aux@factor{#2}\@tempc + \MT@preset@aux@factor{#3}\@tempb + \else + \MT@preset@aux@space{#1}\@tempa + \def\@tempb{#2}% + \MT@get@space@unit\thr@@ + \MT@scale@to@em + \edef\@tempc{\number\@tempcntb}% + \def\@tempb{#3}% + \MT@get@space@unit4% + \MT@scale@to@em + \edef\@tempb{\number\@tempcntb}% + \fi + \MT@set@all@sp\@tempa\@tempc\@tempb +} +% \end{macrocode} +%\end{macro} +%\end{macro} +% +%\subsubsection{Additional Kerning} +% +%\begin{macro}{\MT@kerning} +% Again, only check for additional kerning for new versions of \pdftex. +% \begin{macrocode} +\ifnum\MT@pdftex@no > 5 + \def\MT@kerning{\MT@maybe@do{kn}} +\else + \let\MT@kerning\relax +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@kn@codes} +% \begin{macrocode} +\def\MT@set@kn@codes{% + \MT@reset@kn@codes + \MT@if@list@exists{% + \MT@get@dimen@six + \MT@get@opt + \MT@get@inh@list + \MT@load@list{\MT@kn@c@name}% + \edef\MT@curr@list@name{kerning list `\MT@kn@c@name'}% + \MT@let@cn\@tempc{MT@kn@c@\MT@kn@c@name}% + \expandafter\MT@kn@do\@tempc,\relax,% + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@kn@do} +% \begin{macrocode} +\def\MT@kn@do#1,{% + \ifx\relax#1\@empty \else + \MT@kn@split #1==\relax + \expandafter\MT@kn@do + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@kn@split} +% \begin{macrocode} +\def\MT@kn@split#1=#2=#3\relax{% + \def\@tempa{#1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \MT@get@char@unit + \MT@kn@split@val#2\relax + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@kn@split@val} +% Again, the unit may be measured in the space dimension; this time only +% \cmd{\fontdimen}\,2. +% \begin{macrocode} +\def\MT@kn@split@val#1,#2\relax{% + \def\@tempb{#1}% + \MT@ifempty\@tempb\relax{% + \MT@get@space@unit\tw@ + \MT@scale@to@em + \knbccode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; knbc (\MT@char): \number\knbccode\MT@font\MT@char}% + }% + \def\@tempb{#2}% + \MT@ifempty\@tempb\relax{% + \MT@get@space@unit\tw@ + \MT@scale@to@em + \knaccode\MT@font\MT@char=\@tempcntb +%\MT@dinfo@nl{4}{;;; knac (\MT@char): \number\knaccode\MT@font\MT@char}% + }% + \MT@ifdefined@c\MT@kn@inh@name{% + \MT@ifdefined@n{MT@inh@\MT@kn@inh@name @\MT@char @}{% + \expandafter\MT@map@tlist@c + \csname MT@inh@\MT@kn@inh@name @\MT@char @\endcsname + \MT@set@kn@heirs + }\relax + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@kn@heirs} +% \begin{macrocode} +\def\MT@set@kn@heirs#1{% + \knbccode\MT@font#1=\knbccode\MT@font\MT@char + \knaccode\MT@font#1=\knaccode\MT@font\MT@char +%<*debug> + \MT@dinfo@nl{2}{-- heir of \MT@char: #1}% + \MT@dinfo@nl{4}{;;; knbc (#1): \number\knbccode\MT@font\MT@char/% + \number\knaccode\MT@font\MT@char}% +% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@all@kn} +%\begin{macro}{\MT@reset@kn@codes} +%\begin{macro}{\MT@reset@kn@codes@} +% \begin{macrocode} +\def\MT@set@all@kn#1#2{% +%\MT@dinfo@nl{3}{-- knac/knbc: setting all to \number#1/\number#2}% + \@tempcnta=\z@ + \MT@while@num{\@tempcnta < \@cclvi}{% + \knbccode\MT@font\@tempcnta=#1\relax + \knaccode\MT@font\@tempcnta=#2\relax + \advance\@tempcnta \@ne + }% +} +\def\MT@reset@kn@codes@{\MT@set@all@kn\z@\z@} +\let\MT@reset@kn@codes\relax +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@preset@kn} +%\begin{macro}{\MT@preset@kn@} +% \begin{macrocode} +\def\MT@preset@kn{% + \expandafter\expandafter\expandafter\MT@preset@kn@ + \csname MT@kn@c@\MT@kn@c@name @preset\endcsname\@nil +} +\def\MT@preset@kn@#1,#2\@nil{% + \ifx\MT@kn@unit@\@empty + \MT@warning@nl{% + Cannot preset characters relative to their widths\MessageBreak + for kerning list `\MT@kn@c@name'. Presetting them\MessageBreak + relative to 1em instead}% + \let\MT@preset@aux\MT@preset@aux@factor + \else + \let\MT@preset@aux\MT@preset@aux@space + \fi +% \end{macrocode} +% Letterspacing factor. +% \begin{macrocode} + \MT@ifstreq\MT@kn@context{letterspacing}{% + \@tempcnta\MT@kn@factor@\relax + \MT@scale\@tempcnta \MT@letterspacing@ \@m + \edef\MT@kn@factor@{\number\@tempcnta}% + }\relax + \MT@preset@aux{#1}\@tempa + \MT@preset@aux{#2}\@tempb + \MT@set@all@kn\@tempa\@tempb +} +% \end{macrocode} +%\end{macro} +%\end{macro} +% +%\subsubsection{\lsstyle Letterspacing} +% +%\begin{macro}{\lsstyle} +% Letterspacing is a special case of extra kerning. It will temporarily switch +% kerning on, activate the |all| font set and load the |letterspacing| context. +% The list must have the name |letterspacing|, so that the factor will be +% applied. +% \begin{macrocode} +\ifnum\MT@pdftex@no > 5 + \DeclareRobustCommand\lsstyle{% + \ifMT@kerning +% \end{macrocode} +% We have to add the current font to the active kerning font set, so that the +% letterspacing will be reset. This will fail for font switches inside +% \cs{lsstyle}. +%\todo{fix font switch} +% \begin{macrocode} + \begingroup + \escapechar\m@ne + \expandafter\MT@exp@two@n\expandafter\MT@in@clist + \csname\curr@fontshape/\f@size\expandafter\endcsname + \csname MT@knlist@font@\MT@kn@setname\endcsname + \ifMT@inlist@ \else + \expandafter\MT@xadd + \csname MT@knlist@font@\MT@kn@setname\endcsname + {\csname\curr@fontshape/\f@size\endcsname,}% + \fi + \endgroup + \fi + \MT@kerningtrue + \pdfappendkern\@ne + \pdfprependkern\@ne + \def\MT@kn@setname{all}% + \MT@ifdefined@c\MT@letterspacing@\relax{% + \let\MT@letterspacing@\MT@letterspacing + }% + \microtypecontext{kerning=letterspacing}% + } +\else + \DeclareRobustCommand\lsstyle{% + \MT@warning{Letterspacing only works with pdftex version 1.3x\MessageBreak + or newer. You might want to use the `soul' package\MessageBreak + instead}% + \global\let\lsstyle\relax + } +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\textls} +% This command may be used like the other text commands. The optional argument +% may be used to change the letterspacing factor. +%\changes{v2.0}{2005/09/21}{new command: letterspacing} +% \begin{macrocode} +\DeclareRobustCommand\textls[2][]{% + \MT@ifempty{#1}{% + \let\MT@letterspacing@\@undefined + }{% + \KV@@sp@def\MT@letterspacing@{#1 }% + }% + {\lsstyle #2}% +} +% +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Disabling Ligatures} +% +%\begin{macro}{\MT@noligatures} +% The possibility to disable ligatures is a new features of \pdftex\ 1.30.0. +% \begin{macrocode} +\ifnum\MT@pdftex@no < 5 \MT@hop@else@fi{% + \let\MT@noligatures\relax +}\else\MT@hop@fi{% + \def\MT@noligatures{% + \csname ifMT@\MT@abbr@nl\endcsname + \MT@dotrue + \MT@map@clist@n{font,encoding,family,series,shape,size}{% + \MT@ifdefined@n{MT@checklist@##1}% + {\csname MT@checklist@##1\endcsname}% + {\MT@checklist@{##1}}% + {nl}% + }% + \else + \MT@dofalse + \fi + \ifMT@do + \pdfnoligatures\MT@font + \MT@vinfo{... Disabling ligatures}% + \fi + } +}\fi +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Loading the Configuration} +% +%\begin{macro}{\MT@load@list} +% Recurse through the lists to be loaded. +%\changes{v1.3}{2004/10/27}{check whether list exists} +%\todo{load more than one list} +% \begin{macrocode} +\def\MT@load@list#1{% + \edef\@tempa{#1}% + \MT@let@cn\@tempb{MT@\MT@feat @c@\@tempa load}% + \MT@ifstreq\@tempa\@tempb{% + \MT@warning{\@nameuse{MT@abbr@\MT@feat} list `\@tempa' cannot load itself}% + }{% + \ifx\@tempb\relax \else + \MT@ifdefined@n{MT@\MT@feat @c@\@tempb}{% + \MT@vinfo{... : First loading \@nameuse{MT@abbr@\MT@feat} list `\@tempb'}% + \begingroup + \MT@load@list{\@tempb}% + \endgroup + \edef\MT@curr@list@name{\@nameuse{MT@abbr@\MT@feat} list `\@tempb'}% + \MT@let@cn\@tempc{MT@\MT@feat @c@\@tempb}% + \expandafter\csname MT@\MT@feat @do\expandafter\endcsname\@tempc,\relax,% + }{% + \MT@warning{\@nameuse{MT@abbr@\MT@feat} list `\@tempb' undefined. + Cannot load\MessageBreak it from list `\@tempa'}% + }% + \fi + }% +} +% \end{macrocode} +%\end{macro} +%\changes{v1.1}{2004/09/13}{configuration file names in lowercase +% (suggested by Harald Harders)} +%\begin{macro}{\MT@find@file} +%\changes{v1.1}{2004/09/14}{bug fix: also check whether the file for the base +% font family has already been loaded} +% Micro-typographic settings may be written into a file |mt-|\meta{font family}|.cfg|. +%\changes{v1.8}{2005/04/16}{no longer wrap names in commands} +%\begin{macro}{\MT@file@list} +% We must also record whether we've already loaded the file. +% \begin{macrocode} +\let\MT@file@list\@empty +\def\MT@find@file#1{% +% \end{macrocode} +%\end{macro} +% Check for existence of the file only once. +% \begin{macrocode} + \MT@in@clist{#1}\MT@file@list + \ifMT@inlist@\else +% \end{macrocode} +% Don't forget that because reading the files takes place inside a group, all +% commands that may be used there have to be defined globally. +% \begin{macrocode} + \MT@begin@catcodes + \let\MT@begin@catcodes\relax + \let\MT@end@catcodes\relax + \InputIfFileExists{mt-#1.cfg}{% + \MT@vinfo{... Loading configuration file mt-#1.cfg}% + \MT@xadd\MT@file@list{#1,}% + }{% + \expandafter\MT@get@basefamily#1\relax\relax\relax + \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list + \ifMT@inlist@\else + \InputIfFileExists{mt-\@tempa.cfg}{% + \MT@vinfo{... Loading configuration file mt-\@tempa.cfg}% + \MT@xadd\MT@file@list{\@tempa,#1,}% + }{% + \MT@vinfo{... No configuration file mt-#1.cfg}% + \MT@xadd\MT@file@list{#1,}% + }% + \fi + }% + \endgroup + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@begin@catcodes} +% We have to make sure that all characters have the correct category code. +% Especially, new lines and spaces should be ignored, since files might be +% loaded in the middle of the document. This is basically \cmd{\nfss@catcodes} +% (from the \LaTeX\ kernel). I've added: +%\changes{v1.4a}{2004/11/16}{bug fix: reset some more catcodes when reading files +% (reported by Michael Hoppe)} ^^A +% ^^A in +% |&| (in |tabular|s), |!|, |?|, |;|, +%\changes{v1.7}{2005/02/06}{reset catcode of `\texttt{:}' +% (compatibility with \pkg{french}* packages)} +% |:| (|french|), |,|, |$|, |_|, |~|, +%\changes{v1.5}{2004/11/28}{reset catcode of `\texttt{\quotechar=}' +% (compatibility with Turkish \pkg{babel})} +% and |=| (Turkish \pkg{babel}). +% +%\changes{v1.8}{2005/03/29}{reset catcodes of the remaining \ascii\ characters} +% OK, now all printable characters up to 127 are `other'. We hope that letters +% are always letters and numbers other. +% +% We leave |^| at catcode 7, so that stuff like `|^^ff|' remains possible. +% +% This will be used before reading the files as well as in the configuration +% commands \cs{Set...}, and \cs{DeclareCharacterInheritance}, so that the +% catcodes are also harmless when these commands are used outside the +% configuration files. +%\changes{v1.7}{2005/02/17}{also use inside configuration commands} +% \begin{macrocode} +\def\MT@begin@catcodes{% + \begingroup + \makeatletter + \catcode`\^7% + \catcode`\ 9% + \catcode`\^^I9% + \catcode`\^^M9% + \catcode`\\\z@ + \catcode`\{\@ne + \catcode`\}\tw@ + \catcode`\#6% + \catcode`\%14% + \MT@map@tlist@n + {\!\"\$\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\[\]\_\`\|\~}% + \@makeother +% \end{macrocode} +% Inside the configuration files, we don't have to bother about spaces. +% \begin{macrocode} + \def\MT@remove@spaces##1{}% + \let\KV@@sp@def\def +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@end@catcodes} +% End group if outside configuration file (otherwise relax). +% \begin{macrocode} +\let\MT@end@catcodes\endgroup +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@basefamily} +% The family name might have a suffix +%\changes{v1.1}{2004/09/14}{only remove suffix, if it is `x' or `j'} +% for expert or old style number font set +%\changes{v1.2}{2004/09/26}{also remove `w' (swash capitals)} +% or for swash capitals (|x|, |j| or |w|). We mustn't simply remove the last +% letter, as this would make for instance |cms| out of |cmss| \textit{and} +% |cmsy| (OK, |cmex| will still become |cme|~\dots). +%\changes{v1.4b}{2004/11/25}{bug fix: failed for font names of the form \texttt{abczz} +% (reported by Georg Verweyen)} ^^A +% ^^A in: +% \begin{macrocode} +\def\MT@get@basefamily#1#2#3#4\relax{% + \ifx#2\relax \def\@tempa{#1}\else + \ifx#3\relax \def\@tempa{#1#2}\else + \def\@tempa{#1#2#3}% + \ifx\relax#4\relax \else + \MT@ifstreq{#4}{\string x}\relax{% + \MT@ifstreq{#4}{\string j}\relax{% + \MT@ifstreq{#4}{\string w}\relax{% + \def\@tempa{#1#2#3#4}}}}\fi\fi\fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@listname} +%\begin{macro}{\MT@get@listname} +%\begin{macro}{\MT@get@listname@} +% Try all combinations of font family, series, shape and size to get a list for +% the current font. +%\changes{v1.1}{2004/09/15}{don't check for empty characteristics list} +%\changes{v1.2}{2004/09/30}{alternatively check for alias font name} +%\changes{v1.7}{2005/03/15}{use \cmd{\@tfor} (Andreas B\"uhmann's idea)} +%\changes{v1.8}{2005/04/16}{made recursive} +% \begin{macrocode} +\def\MT@get@listname#1{% +%\MT@dinfo@nl{1}{trying to find \@nameuse{MT@abbr@#1} list for font \MT@font}% + \let\MT@listname\@undefined + \def\@tempb{#1}% + \MT@map@tlist@c\MT@try@order\MT@get@listname@ +} +\def\MT@get@listname@#1{% + \expandafter\MT@next@listname#1% + \ifx\MT@listname\@undefined \else + \expandafter\MT@tlist@break + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@try@order} +%\changes{v1.7}{2005/03/11}{bug fix: also check for //\meta{series}/\meta{shape}// +% (reported by Andreas B\"uhmann)} ^^A +% ^^A private mail, 10/3/2005 +%\changes{v1.7}{2005/03/11}{always check for size, too +% (suggested by Andreas B\"uhmann)} ^^A +% ^^A private mail, 10/3/2005 +% +%\begin{table}\footnotesize +%\caption{Order for matching font attributes}\label{tab:match-order} +%\catcode`\!=13 \let!\match +%\begin{tabular}{@{}L{38pt}*{16}{p{19.5pt}<{\centering}@{}}} +%\ifbooktabs\addlinespace\toprule\addlinespace\else\hline\fi +% & 1.& 2.& 3.& 4.& 5.& 6.& 7.& 8.& 9.&10.&11.&12.&13.&14.&15.&16.\\ +%\ifbooktabs\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(r){8-8}\cmidrule(r){9-9} +% \cmidrule(r){10-10}\cmidrule(r){11-11}\cmidrule(r){12-12}\cmidrule(r){13-13} +% \cmidrule(r){14-14}\cmidrule(r){15-15}\cmidrule(r){16-16}\cmidrule{17-17} +%\else\hline\fi +% Encoding & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! & ! \\ +% Family & ! & ! & ! & ! & ! & ! & ! & ! & - & - & - & - & - & - & - & - \\ +% Series & ! & ! & ! & ! & - & - & - & - & ! & ! & ! & ! & - & - & - & - \\ +% Shape & ! & ! & - & - & ! & ! & - & - & ! & ! & - & - & ! & ! & - & - \\ +% Size & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - & ! & - \\ +%\ifbooktabs\bottomrule\else\hline\fi +%\end{tabular} +%\end{table} +% +% Beginning with version 1.7, we always check for the font size. Since the +% matching order has become more logical now, it can be described in words, so +% that we don't need table~\ref{tab:match-order} in the documentation part any +% longer and can cast it off here. +% \begin{macrocode} +\def\MT@try@order{% + {1111}{1110}{1101}{1100}{1011}{1010}{1001}{1000}% + {0111}{0110}{0101}{0100}{0011}{0010}{0001}{0000}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@next@listname} +% The current context is added to the font attributes. That is, the context must +% match. +% \begin{macrocode} +\def\MT@next@listname#1#2#3#4{% + \edef\@tempa{\MT@encoding + /\ifnum#1=\@ne \MT@family\fi + /\ifnum#2=\@ne \MT@series\fi + /\ifnum#3=\@ne \MT@shape\fi + /\ifnum#4=\@ne *\fi + \MT@context}% +%\MT@dinfo@nl{1}{trying \@tempa}% + \MT@ifdefined@n{MT@\@tempb @\@tempa}{% + \MT@next@listname@#4% + }{% +% \end{macrocode} +% Also try with an alias family. +% \begin{macrocode} + \ifnum#1=\@ne + \ifx\MT@familyalias\@empty \else + \edef\@tempa{\MT@encoding + /\MT@familyalias + /\ifnum#2=\@ne \MT@series\fi + /\ifnum#3=\@ne \MT@shape\fi + /\ifnum#4=\@ne *\fi + \MT@context}% +%\MT@dinfo@nl{1}{(alias) \@tempa}% + \MT@ifdefined@n{MT@\@tempb @\@tempa}{% + \MT@next@listname@#4% + }\relax + \fi + \fi + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@next@listname@} +% If size is to be evaluated, do that, otherwise use the current list. +% \begin{macrocode} +\def\MT@next@listname@#1{% + \ifnum#1=\@ne + \expandafter\MT@in@rlist\csname MT@\@tempb @\@tempa @sizes\endcsname + \ifMT@inlist@ + \let\MT@listname\MT@size@name + \fi + \else + \MT@let@cn\MT@listname{MT@\@tempb @\@tempa}% + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@if@list@exists} +%\changes{v1.7}{2005/02/06}{don't define \cs{MT@\#1@c@name} \cmd{\global}ly, +% here and elsewhere} +%\begin{macro}{\MT@context} +% \begin{macrocode} +\def\MT@if@list@exists{% + \expandafter\let\expandafter\MT@context\csname MT@\MT@feat @context\endcsname + \MT@get@listname{\MT@feat @c}% + \MT@ifdefined@c\MT@listname{% + \MT@edef@n{MT@\MT@feat @c@name}{\MT@listname}% + \ifMT@nonselected + \MT@vinfo{... Applying non-selected expansion (list `\MT@ex@c@name')}% + \else + \MT@vinfo{... Loading \@nameuse{MT@abbr@\MT@feat} list + `\@nameuse{MT@\MT@feat @c@name}'}% + \fi + \@firstoftwo + }{% +% \end{macrocode} +% Since the name cannot be \cmd{\@empty}, this is a sound proof that no matching +% list exists. +% \begin{macrocode} + \MT@let@nc{MT@\MT@feat @c@name}\@empty +% \end{macrocode} +% Don't warn if \opt{selected}|=false|. +% \begin{macrocode} + \ifMT@nonselected + \MT@vinfo{... Applying non-selected expansion}% + \else + \MT@warning{I cannot find a \@nameuse{MT@abbr@\MT@feat} list + for font\MessageBreak`\MT@exp@string\MT@font'% + \ifx\MT@context\@empty\else\space(context: `\MT@context')\fi. + Switching off\MessageBreak\@nameuse{MT@abbr@\MT@feat} for this font}% + \fi + \@secondoftwo + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@get@inh@list} +%\changes{v1.6}{2004/12/18}{correct message if \opt{selected} is false} +%\begin{macro}{\MT@context} +% The inheritance lists are global (no context). +% \begin{macrocode} +\def\MT@get@inh@list{% + \let\MT@context\@empty + \MT@get@listname{\MT@feat @inh}% + \MT@ifdefined@c\MT@listname{% + \MT@edef@n{MT@\MT@feat @inh@name}{\MT@listname}% +%<*debug> + \MT@dinfo@nl{1}{... Using \@nameuse{MT@abbr@\MT@feat} inheritance list + `\@nameuse{MT@\MT@feat @inh@name}'}% +% + \MT@let@cn\@tempc{MT@\MT@feat @inh@\csname MT@\MT@feat @inh@name\endcsname}% +% \end{macrocode} +% If the list is \cmd{\@empty}, it has already been parsed. +%\changes{v1.2}{2004/09/26}{bug fix: set inheritance list \cmd{\global}ly to \cmd{\@empty}} +% \begin{macrocode} + \ifx\@tempc\@empty \else +%\MT@dinfo@nl{1}{parsing inheritance list ...}% + \MT@let@cn\MT@inh@name{MT@\MT@feat @inh@name}% + \def\MT@curr@list@name{inheritance list}% + \expandafter\MT@inh@do\@tempc,\relax,% + \global\MT@let@nc{MT@\MT@feat @inh@\csname MT@\MT@feat @inh@name\endcsname}\@empty + \fi + }{% + \MT@let@nc{MT@\MT@feat @inh@name}\@undefined + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +% +% \subsubsection{Translating Characters} +% +%\changes{v1.4}{2004/11/04}{don't use scratch registers in global definitions} +% Get the slot number of the character in the current encoding. +% +%\begin{macro}{\MT@get@slot} +%\changes{v1.2}{2004/09/26}{bug fix: group must also include \cs{MT@get@composite}} +%\changes{v1.4b}{2004/11/22}{don't define \cs{MT@char} globally (save stack problem)} +%\changes{v1.6a}{2005/01/30}{completely redone, hopefully more robust +% (compatible with \pkg{frenchpro}; +% problem reported by Bernard Gaulle)} ^^A +% ^^A private mail, 28/1/2005 +%\changes{v1.7}{2005/03/21}{remove backslash hack} +%\begin{macro}{\MT@char} +%\begin{macro}{\Mt@char} +% There are lots of possibilities how a character may be specified in the +% configuration files, which makes translating them into slot numbers quite +% expensive. Also, we want to have this as robust as possible, so that the user +% does not have to solve a sphinx's riddle if anything goes wrong. +% +% The character is in \cs{@tempa}, we want its slot number in \cs{MT@char}. +% \begin{macrocode} +\def\MT@get@slot{% + \escapechar`\\ + \let\Mt@char\m@ne + \MT@noresttrue +% \end{macrocode} +%\end{macro} +%\end{macro} +% Save unexpanded string in case we need to issue a warning message. +% \begin{macrocode} + \mt@toks=\expandafter\expandafter\expandafter{\expandafter\string\@tempa}% + \edef\MT@char{\expandafter\meaning\@tempa}% +% \end{macrocode} +% Now, let's walk through (hopefully all) possible cases. +%\begin{itemize} +% \item It's a letter, a character or a number. +% \begin{macrocode} + \expandafter\MT@is@letter\@tempa\relax\relax + \ifnum\Mt@char < \z@ +% \end{macrocode} +%\changes{v1.8}{2005/03/30}{bug fix: expand active characters} +% \item It might be an active character, \ie, an 8-bit character defined by +% \pkg{inputenc}. +% \begin{macrocode} + \MT@exp@two@c\MT@is@active\string\@tempa\@nil +% \end{macrocode} +% \item OK, so it must be a macro. We do not allow random commands but only +% those defined in \LaTeX's idiosyncratic font encoding scheme: +% +% If |\|\meta{encoding}|\|\meta{command} (that's \emph{one} command) is +% defined, we try to extract the slot number. +%\changes{v1.7}{2005/02/27}{test whether \cs{}\meta{encoding}\cs{\meta{..}} is defined} +%\changes{v1.8}{2005/04/05}{test whether \cs{}\meta{encoding}\cs{\meta{..}} is defined +% made more robust} +% \begin{macrocode} + \MT@ifdefined@n{\MT@encoding\MT@detokenize\@tempa}% + \MT@is@symbol + {% +% \end{macrocode} +% \item Now, we'll catch the rest, which hopefully is an accented character +% (\eg~|\"a|). +% \begin{macrocode} + \expandafter\MT@is@composite\@tempa\relax\relax + }% + \ifnum\Mt@char < \z@ +% \end{macrocode} +% \item It could also be a \cmd{\chardef}ed command (\eg\ the percent character). +% This seems the least likely case, so it's last. +%\changes{v1.7}{2005/03/20}{test for \cmd{\chardef}ed commands} +% \begin{macrocode} + \MT@exp@two@c\MT@is@char\MT@char\MT@charstring\relax\relax\relax + \fi + \fi +% \end{macrocode} +%\end{itemize} +% \begin{macrocode} + \let\MT@char\Mt@char + \ifnum\MT@char < \z@ + \MT@warn@unknown + \else +% \end{macrocode} +% If the user has specified something like `|fi|', or wanted to define a number +% but forgot to use three digits, we'll have something left of the string. In +% this case, we issue a warning and forget the complete string. +% \begin{macrocode} + \ifMT@norest \else + \MT@warn@unknown@i + \let\MT@char\m@ne + \fi + \fi + \escapechar\m@ne +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ifMT@norest}\IndexNewif{MT@norest} +%\begin{macro}{\MT@testrest} +% Switch and test whether all of the string has been used up. +% \begin{macrocode} +\newif\ifMT@norest +\def\MT@testrest#1#2{% + \MT@ifstreq{#1}{#2}\relax\MT@norestfalse +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@is@letter} +% Input is a letter, a character or a number. +%\changes{v1.8}{2005/04/04}{warning for non-\ascii\ characters} +%\changes{v1.9}{2005/10/22}{using \cmd{\catcode} should be more efficient than +% inspecting the \cmd{\meaning}} +% \begin{macrocode} +\def\MT@is@letter#1#2\relax{% + \ifcat a\noexpand#1\relax + \edef\Mt@char{\number`#1}% + \ifx\\#2\\% +%\MT@dinfo@nl{3}{> `\the\mt@toks' is a letter (\Mt@char)}% + \else + \MT@norestfalse + \fi + \else + \ifcat 1\noexpand#1\relax + \edef\Mt@char{\number`#1}% +%\MT@dinfo@nl{3}{> `\the\mt@toks' is a character (\Mt@char)}% + \ifx\\#2\\% + \ifnum\Mt@char>127 \Mt@warn@ascii \fi + \else + \MT@norestfalse + \expandafter\MT@is@number#1#2\relax\relax + \fi + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@is@number} +% Numbers may be specified as a three-digit decimal number (|029|), +%\changes{v1.1}{2004/09/13}{numbers may also be specified in hexadecimal or octal +% (suggested by Harald Harders)} +% as a hexadecimal number (prefixed with~|"|: |"1D|) or as a octal number +% (prefixed with~|'|: |'35|). They must consist of at least three characters +% (including the prefix), that is, |"F| is not permitted. +% \begin{macrocode} +\def\MT@is@number#1#2#3\relax{% + \ifx\relax#3\relax \else + \ifx\relax#2\relax \else + \MT@noresttrue + \if#1"\relax + \def\x{\uppercase{\edef\Mt@char{\number#1#2#3}}}\x +%\MT@dinfo@nl{3}{> ... a hexadecimal number: \Mt@char}% + \else + \if#1'\relax + \def\Mt@char{\number#1#2#3}% +% \MT@dinfo@nl{3}{> ... an octal number: \Mt@char}% + \else + \MT@ifnumber{#1#2#3}{% + \def\Mt@char{\number#1#2#3}% +% \MT@dinfo@nl{3}{> ... a decimal number: \Mt@char}% + }\MT@norestfalse + \fi + \fi + \ifnum\Mt@char > \@cclv + \MT@warn@number@too@large{\noexpand#1\noexpand#2\noexpand#3}% + \let\Mt@char\m@ne + \fi + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@is@active} +%\changes{v1.8}{2005/03/30}{new macro: translate \pkg{inputenc}-defined characters} +% Expand an active character. (This was completely broken in v1.7, and only +% worked by chance before.) +%\changes{v1.9}{2005/09/08}{redone: use \cmd{\set@display@protect}} +% We \cmd{\set@display@protect} to translate, \eg, |Ä| into |\"A|, that is to +% whatever it is defined in the \pkg{inputenc} encoding file. +% +% Unfortunately, the \pkg{inputenc} definitions prefer the protected/generic +% variants (\eg, \cmd{\copyright} instead of \cmd{\textcopyright}), which our +% parser won't be able to understand. +% (I'm fed up now, so you have to complain if you really, really want to be +% able to write `|©|' instead of \cmd{\textcopyright}, thus rendering your +% configuration files unportable.) +% +%\todo{Make \microtype\ Unicode-savvy?} +% Unicode characters (\pkg{inputenc}/|utf8|) are currently not supported. +% \begin{macrocode} +\def\MT@is@active#1#2\@nil{% + \ifx\\#2\\% + \ifnum\catcode`#1 = \active + \begingroup + \set@display@protect + \def\IeC##1{##1}% +% \end{macrocode} +% The character is undefined in the encoding. +% \begin{macrocode} + \def\@inpenc@undefined@##1{undefined^^J% + (microtype)\@spaces\@spaces\@spaces\@spaces + in input encoding ``##1''}% + \edef\x{% + \def\noexpand\@tempa{\@tempa}% +% \end{macrocode} +% Append what we think the translation is to the token register we use for the +% log. +% \begin{macrocode} + \mt@toks={\the\mt@toks\space (= \@tempa)}% + }% + \expandafter\endgroup\x + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@is@symbol} +% The symbol commands might expand to funny stuff, depending on context. +% Instead of simply expanding |\|\meta{command}, we construct the command +% |\|\meta{encoding}|\|\meta{command} and see whether its meaning is +% \cmd{\char}|"|\meta{hex number}, which is the case for everything that has +% been defined with \cs{DeclareTextSymbol} in the encoding definition files. +% \begin{macrocode} +\def\MT@is@symbol{% + \edef\@tempa{\expandafter + \csname\expandafter + \MT@encoding\expandafter + \string\@tempa + \endcsname}% + \expandafter\MT@exp@two@c\expandafter\MT@is@char\expandafter + \meaning\expandafter\@tempa\MT@charstring\relax\relax\relax + \ifnum\Mt@char < \z@ +% \end{macrocode} +% \dots~or, if it hasn't been defined by \cs{DeclareTextSymbol}, a letter +% (\eg\ \cmd{\i}, when using \pkg{frenchpro}). ^^A as noted by Bernard Gaulle +% ^^A private mail, 28/1/2005 +% \begin{macrocode} + \expandafter\MT@is@letter\@tempa\relax\relax + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@is@char} +%\begin{macro}{\MT@charstring} +% Here we define a helper macro that inspect the \cmd{\meaning} of its +% argument. +% \begin{macrocode} +%\def\Mt@info{\MT@dinfo@nl{3}} +\begingroup + \catcode`\/=0 + /MT@map@tlist@n{/\/C/H/A/R}/@makeother + /lowercase{% + /def/x{% + /def/MT@charstring{\CHAR"}% + /def/MT@is@char##1\CHAR"##2##3##4/relax{% + /ifx/relax##1/relax + /if##3\/relax + /edef/Mt@char{/number"##2}% + /MT@testrest/MT@charstring{##3##4}% + /else + /edef/Mt@char{/number"##2##3}% + /MT@testrest/MT@charstring{##4}% + /fi +% /Mt@info{> `/the/mt@toks' is a \char (/Mt@char)}% + /fi + }% + }% + } +/expandafter/endgroup/x +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@is@composite} +% Here, we are dealing with accented characters, specified as two tokens. +%\changes{v1.7}{2005/03/10}{new macro: construct command for composite character; +% no uncontrolled expansion} +% \begin{macrocode} +\def\MT@is@composite#1#2\relax{% + \ifx\\#2\\\else +% \end{macrocode} +% Again, we construct a control sequence, this time of the form: +% |\\|\meta{encoding}\hskip0pt|\|\meta{accent}|-|\meta{character}, \eg\ +% |\\T1\"-a|, which expands to a letter if it has been defined by +% \cs{DeclareTextComposite}. This should be robust, finally. +% \begin{macrocode} + \edef\@tempa{\expandafter + \csname\expandafter + \string\csname\MT@encoding\endcsname + \string#1-% + \string#2% + \endcsname}% + \expandafter\MT@is@letter\@tempa\relax\relax + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@detokenize} +%\changes{v1.9}{2005/08/17}{fix the non-\etex\ version} +% Translate a macro into a token list. We must be cautious not to stumble over +% accented characters consisting of two commands, like \cmd{\`}\cmd{\i} or +% \cmd{\U}\cmd{\CYRI}. With \etex, we can use \cmd{\detokenize} (and +% \cmd{\expandafter}\cmd{\string} to get rid of the trailing space). The +% non-\etex\ version requires some more fiddling. +% \begin{macrocode} +\ifcase\MT@etex@no + \def\MT@detokenize#1{\MT@exp@two@c\zap@space\strip@prefix\meaning#1 \@empty} +\else + \def\MT@detokenize#1{\detokenize + \expandafter\expandafter\expandafter{\expandafter\string#1}} +\fi +% \end{macrocode} +%\end{macro} +% Some warning messages, for performance reasons separated here. +%\begin{macro}{\MT@curr@list@name} +%\changes{v1.8}{2005/06/08}{new macro: current list type and name} +% The type and name of the current list, defined at various places. +% \begin{macrocode} +\let\MT@curr@list@name\@empty +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Mt@warn@ascii} +% For characters with character code \textgreater\ 127, we issue a warning +% (\pkg{inputenc} probably hasn't been loaded), since correspondence with +% the slot numbers would be purely coincidental. +% \begin{macrocode} +\def\Mt@warn@ascii{% + \MT@warning@nl{Character `\the\mt@toks' (= \Mt@char) + is outside of ASCII range.\MessageBreak + You must load the `inputenc' package before using\MessageBreak + 8-bit characters in \MT@curr@list@name}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@number@too@large} +% Number too large. +% \begin{macrocode} +\def\MT@warn@number@too@large#1{% + \MT@warning@nl{% + Number #1 in encoding `\MT@encoding' too large!\MessageBreak + Ignoring it in \MT@curr@list@name}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@unknown@i} +% Not all of the string has been parsed. +% \begin{macrocode} +\def\MT@warn@unknown@i{% + \MT@warning@nl{% + Unknown slot number of character `\the\mt@toks' in\MessageBreak + font encoding `\MT@encoding'. Make sure it's a single\MessageBreak + character (or a number) in \MT@curr@list@name}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@warn@unknown} +% No idea what went wrong. +% \begin{macrocode} +\def\MT@warn@unknown{% + \MT@warning@nl{% + Unknown slot number of character `\the\mt@toks' in\MessageBreak + font encoding `\MT@encoding' in \MT@curr@list@name}% +} +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Hook into \LaTeX's font selection} +% +% We append \cs{MT@setupfont} to \cmd{\pickup@font}, which is called by \LaTeX\ +% every time a font is selected. We then check whether we've already seen this +% font, and if not, set it up for micro-typography. +% This ensures that we will catch all fonts, and that we will not set up fonts +% more than once. The whole package really hangs on this command. +% +% In contrast to the \pkg{pdfcprot} package, there is no need to declare the +% fonts in advance that should benefit from micro-typographic treatment. Also, +% only those fonts that are actually being used will be set up for expansion +% and protrusion. +% +% For my reference: +%\begin{itemize} +% \item \cmd{\pickup@font} is called by \cmd{\selectfont}, \cmd{\wrong@fontshape}, +% or \\ \cmd{\getanddefine@fonts} (for math). +% \item \cmd{\pickup@font} calls \cmd{\define@newfont}. +% \item \cmd{\define@newfont} may call (inside a group!) +% \begin{itemize} +% \item \cmd{\wrong@fontshape}, which in turn will call \cmd{\pickup@font}, +% and thus \\ \cmd{\define@newfont} again, or +% \item \cmd{\extract@font}. +% \end{itemize} +% \item \cmd{\get@external@font} is called by \cmd{\extract@font}, by itself, +% and by the substitution macros +%\end{itemize} +% +%\changes{v1.2}{2004/10/02}{check for packages that might load fonts} +%\changes{v1.4}{2004/11/04}{no need to check for packages that might load fonts anymore} +%\changes{v1.4}{2004/11/04}{use \cmd{\pickup@font} instead of \cmd{\define@newfont} +% as the hook for \cs{MT@setupfont}} +% Up to version 1.3 of this package, we were using \cmd{\define@newfont} as the +% hook, which is only called for \emph{new} fonts, and therefore seemed the natural +% choice. +% However, this meant that we had to take special care to catch all fonts: We +% additionally had to set up the default font, the error font (if it wasn't the +% default font), we had to check for some packages that might have been loaded +% before \microtype\ and were loading fonts, e.g. \pkg{jurabib}, +% \pkg{ledmac}, \pkg{pifont} (loaded by \pkg{hyperref}), \pkg{tipa}, and +% probably many more. Furthermore, we had to include a hack for the +% \pkg{IEEEtran} class which loads all fonts in the class file itself (to fine +% tune inter-word spacing). Then I learned that even my favorite class, the +% \pkg{memoir} class, loads fonts. To cut this short: It seemed to get out of +% hand, and I decided that it would be better to use \cmd{\pickup@font} and +% decide for ourselves whether we've already seen that font. I hope the +% overhead isn't too large. +%\changes{v1.8}{2005/05/15}{if font substitution has occurred, set up the +% substitute font, not the selected one} +%\begin{macro}{\MT@font} +% Additionally, we hook into \cmd{\do@subst@correction}, which is called if +% a substitution has taken place, to record the name of the ersatz font. +% Unfortunately, this will only work for one-level substitutions. +% \begin{macrocode} +\let\MT@font\@empty +\g@addto@macro\do@subst@correction{% + \xdef\MT@font{\csname \curr@fontshape/\f@size\endcsname}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@orig@pickupfont} +% Check whether \cmd{\pickup@font} is defined as expected. +% The warning issued by \cmd{\CheckCommand*} would be a bit too generic. +% \begin{macrocode} +\def\MT@orig@pickupfont{\expandafter\ifx\font@name\relax\define@newfont\fi} +\ifx\pickup@font\MT@orig@pickupfont \else + \MT@warning@nl{% + Command \string\pickup@font\space is not defined as expected.\MessageBreak + Double-check whether micro-typography is indeed\MessageBreak + applied to the document.\MessageBreak (Hint: Turn on `verbose' mode)% + } +\fi +% \end{macrocode} +%\end{macro} +% Then we append our stuff. +% \begin{macrocode} +\g@addto@macro\pickup@font{% + \begingroup + \escapechar\m@ne +% \end{macrocode} +% If \cs{MT@font@name} is empty, no substitution has taken place, hence +% \cmd{\font@name} is correct. Otherwise, if they are different, +% \cmd{\font@name} does not describe the font actually used. This test will +% catch one-level substitutions, like |bx| to |b|, but it will still fail if +% the substituting font is itself substituted. +% \begin{macrocode} + \ifx\MT@font\@empty + \let\MT@font\font@name + \else + \ifx\MT@font\font@name \else + \expandafter\MT@xadd + \csname MT@\MT@curr@contexts font@list\endcsname{\font@name,}% + \fi + \fi +% \end{macrocode} +% Comma-separated lists are used to remember the fonts we've already set up. +% There is one list for each combination of contexts. +%\changes{v1.9}{2005/10/03}{allow context-specific font setup} +% \begin{macrocode} + \expandafter\MT@exp@one@n\expandafter\MT@in@clist\expandafter\MT@font + \csname MT@\MT@curr@contexts font@list\endcsname + \ifMT@inlist@ \else + \MT@setupfont +% \end{macrocode} +% Add the font to the current list and remove it from the other contexts' lists. +% \begin{macrocode} + \expandafter\MT@xadd\csname MT@\MT@curr@contexts font@list\endcsname{\MT@font,}% + \MT@map@tlist@c\MT@doc@contexts\MT@rem@from@lists + \fi + \endgroup + \global\let\MT@font\@empty +} +% \end{macrocode} +%\begin{macro}{\MT@rem@from@lists} +% Recurse through all context font lists of the document and remove the font, +% unless it's the current context. +% \begin{macrocode} +\def\MT@rem@from@lists#1{% + \MT@ifstreq{#1}\MT@curr@contexts\relax{% + \expandafter\MT@exp@one@n\expandafter\MT@rem@from@list + \expandafter\MT@font\csname MT@#1font@list\endcsname + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@pickupfont} +% Remember the patched command for later. +% \begin{macrocode} +\let\MT@pickupfont\pickup@font +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@add@accent} +%\changes{v1.8}{2005/06/14}{bug fix: disable micro-typographic setup inside \cmd{\add@accent} +% (reported by Stephan Hennig)}% ^^A +% ^^A in +% Inside \cmd{\add@accent}, we have to disable \microtype's setup, since the +% grouping in the patched \cmd{\pickup@font} would break the accent if +% different fonts are used for the base character and the accent. Fortunately, +% \LaTeX\ takes care that the fonts used for the \cmd{\accent} are already set +% up, so that we cannot be overlooking them. +% At first, I was going to change \cmd{\hmode@bgroup} only, but that is also +% used in the commands defined by \cmd{\DeclareTextFontCommand}, \ie, +% \cmd{\textit} etc. +% \begin{macrocode} +\let\MT@add@accent\add@accent +\def\add@accent#1#2{% + \let\pickup@font\MT@orig@pickupfont + \MT@add@accent{#1}{#2}% + \let\pickup@font\MT@pickupfont +} +% \end{macrocode} +%\end{macro} +%\changes{v1.6}{2004/12/29}{test whether \cmd{\pickup@font} has changed} +% We also test whether our definition has survived (\cmd{\pickup@font} is +% at least redefined by \pkg{CJK}\footnote{ +% Therefore, \microtype\ will probably not work together with \pkg{CJK}. +% However, I would be glad to be proven wrong.}). +% \begin{macrocode} +\AtBeginDocument{% + \ifx\MT@pickupfont\pickup@font \else + \MT@error{% + Another package has overwritten the definition\MessageBreak + of \string\pickup@font. I might not be able to\MessageBreak + apply any micro-typography. Please find the\MessageBreak + culprit, and load it before the microtype package + }{% +The microtype package attaches the micro-typographic setup to\MessageBreak +\string\pickup@font. If the other package has simply overwritten this\MessageBreak +command, nothing will work. If, on the other hand, it has changed\MessageBreak +the command in a cautious way, everything may be fine.\MessageBreak +In either case, please send a report to . + }% + \fi +} +% \end{macrocode} +% +% +%\subsection{Configuration} +% +%\subsubsection{Font Sets} +%\todo{allow for \texttt{load}ing and extending another set; or using more than one set?} +% +%\begin{macro}{\DeclareMicrotypeSet} +%\begin{macro}{\DeclareMicrotypeSet*} +% Calling this macro will create a comma list for every font characteristic of +% the form: |\MT|\meta{feature}|list@|\meta{characteristic}|@|\meta{set name}. +% If the optional argument is empty, lists for both expansion and protrusion +% will be created. +% +% The third argument must be a list of |key=value| pairs. If a font characteristic +% is not specified, we define the corresponding list to \cmd{\relax}, so that it +% does not constitute a constraint. +% \begin{macrocode} +\def\DeclareMicrotypeSet{% + \@ifstar + {\@ifnextchar[\MT@DeclareSetAndUseIt + {\MT@DeclareSetAndUseIt[]}}% + {\@ifnextchar[\MT@DeclareSet + {\MT@DeclareSet[]}}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@DeclareSet} +%\begin{macro}{\MT@DeclareSetAndUseIt} +% \begin{macrocode} +\def\MT@DeclareSet[#1]{% + \MT@DeclareSet@{#1}% +} +\def\MT@DeclareSetAndUseIt[#1]#2#3{% + \MT@DeclareSet@{#1}{#2}{#3}% + \UseMicrotypeSet[#1]{#2}% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@DeclareSet@} +%\changes{v1.1}{2004/09/15}{remove spaces around first argument} +% \begin{macrocode} +\def\MT@DeclareSet@#1#2#3{% + \KV@@sp@def\@tempa{#1}% + \MT@ifempty\@tempa{% + \MT@declare@sets{pr}{#2}{#3}% + \MT@declare@sets{ex}{#2}{#3}% +%<*beta> + \MT@declare@sets{sp}{#2}{#3}% + \MT@declare@sets{kn}{#2}{#3}% +% + }{% + \MT@map@clist@c\@tempa{% + {\KV@@sp@def\@tempa{##1}% + \MT@ifempty\@tempa\relax{% + \MT@exp@one@n\MT@declare@sets + {\csname MT@rbba@\@tempa\endcsname}{#2}{#3}}}% + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@curr@set@name} +% We need to remember the name of the set currently being declared. +% \begin{macrocode} +\let\MT@curr@set@name\@empty +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@declare@sets} +% Define the current set name and parse the keys. +%\changes{v1.1}{2004/09/20}{remove spaces around set name} +%\changes{v1.8}{2005/05/15}{warning when redefining a set} +% \begin{macrocode} +\def\MT@declare@sets#1#2#3{% + \KV@@sp@def\MT@curr@set@name{#2}% + \MT@ifdefined@n{MT@#1@set@@\MT@curr@set@name}{% + \MT@warning{Redefining set `\MT@curr@set@name'}% + }\relax + \global\MT@let@nc{MT@#1@set@@\MT@curr@set@name}\@empty +%\MT@dinfo{1}{declaring \@nameuse{MT@abbr@#1} set `\MT@curr@set@name'}% + \setkeys{MT@#1@set}{#3}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@set@keys} +% Define the \pkg{keyval} keys for expansion and protrusion sets. +% \begin{macrocode} +\def\MT@define@set@keys#1{% + \MT@define@set@key@{encoding}{#1}% + \MT@define@set@key@{family}{#1}% + \MT@define@set@key@{series}{#1}% + \MT@define@set@key@{shape}{#1}% + \MT@define@set@key@size{#1}% + \MT@define@set@key@font{#1}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@set@key@} +% \meta{\#1} = font axis, \meta{\#2} = feature. +%\changes{v1.8}{2005/04/16}{use comma lists instead of token lists} +% \begin{macrocode} +\def\MT@define@set@key@#1#2{% + \csname MT@#2list@#1@\MT@curr@set@name\endcsname + \define@key{MT@#2@set}{#1}[]{% + \global\MT@let@nc{MT@#2list@#1@\MT@curr@set@name}\@empty + \MT@map@clist@n{##1}{% +% \end{macrocode} +% Get rid of spaces. +% \begin{macrocode} + \KV@@sp@def\MT@val{####1}% + \MT@get@highlevel{#1}% + \MT@make@string\MT@val + \expandafter\MT@xadd + \csname MT@#2list@#1@\MT@curr@set@name\endcsname{\MT@val,}% + }% +%\MT@dinfo@nl{1}{-- #1: \@nameuse{MT@#2list@#1@\MT@curr@set@name}}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@highlevel} +% Saying, for instance, `|family=rm*|' or `|shape=bf*|' will lead to +% \cmd{\rmdefault} resp. \cmd{\bfdefault} being expanded/protruded. +% \begin{macrocode} +\def\MT@get@highlevel#1{% + \expandafter\MT@test@ast\MT@val*\@nil{% +% \end{macrocode} +% And `|family = *|' will become \cmd{\familydefault}. +% \begin{macrocode} + \MT@ifempty\@tempa{\def\@tempa{#1}}\relax + \edef\MT@val{\csname \@tempa default\endcsname}% +% \end{macrocode} +% Beware that \cmd{\rmdefault} etc. might change after this package has been +% loaded! Therefore, we check (once for each characteristic/list) at the +% beginning of the document. +%\changes{v1.2}{2004/09/26}{check whether defaults have changed} +%\changes{v1.5}{2004/12/02}{don't test defaults if called after begin document} +% \begin{macrocode} + \ifx\@nodocument\relax \else + \expandafter\ifx + \csname MT@check@\MT@curr@set@name @\@tempa\endcsname\@empty + \else + \global\MT@edef@n{MT@\MT@curr@set@name @\@tempa @default}{\MT@val}% + \edef\x{{\MT@curr@set@name}{\@tempa}}% + \MT@exp@one@n\AtBeginDocument{% + \expandafter\MT@check@default\x + }% + \global\MT@let@nc{MT@check@\MT@curr@set@name @\@tempa}\@empty + \fi + \fi + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@test@ast} +% Test whether last character is an asterisk. +%\changes{v1.7}{2005/03/10}{make it simpler} +% \begin{macrocode} +\def\MT@test@ast#1*#2\@nil{% + \def\@tempa{#1}% + \MT@ifempty{#2}% + \@gobble + \@firstofone +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@check@default} +%\changes{v1.2}{2004/09/26}{new macro} +% \begin{macrocode} +\def\MT@check@default#1#2{% + \MT@let@cn\@tempa{MT@#1@#2@default}% + \edef\@tempb{\csname #2default\endcsname}% + \ifx\@tempa\@tempb \else + \MT@warning@nl{% + \expandafter\noexpand\csname #2default\endcsname + has changed (`\@tempa' <> `\@tempb')!\MessageBreak + This might affect the `#1' font set.\MessageBreak + Please make all relevant font changes *before*\MessageBreak + loading the `microtype' package}% + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@set@key@size} +% |size| requires special treatment. +% \begin{macrocode} +\def\MT@define@set@key@size#1{% + \define@key{MT@#1@set}{size}[]{% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \expandafter\MT@get@range\MT@val--\@nil + \ifx\MT@val\relax \else + \expandafter\MT@xadd + \csname MT@#1list@size@\MT@curr@set@name\endcsname + {{{\MT@lower}{\MT@upper}\relax}}% + \fi + }% +%\MT@dinfo@nl{1}{-- size: \@nameuse{MT@#1list@size@\MT@curr@set@name}}% + }% +} +% \end{macrocode} +%\end{macro} +%\changes{v1.7}{2005/03/11}{allow specification of size ranges +% (suggested by Andreas B\"uhmann)} ^^A +% ^^A private mail, 10/3/2005 +% Font sizes may also be specified as ranges. This has been requested by Andreas +% B\"uhmann, who has also offered valuable help in implementing this. Now, it +% is for instance possible to set up different lists for fonts with optical +% sizes. (The MinionPro project is trying to do this for the OpenType version +% of Adobe's Minion. See \url{http://developer.berlios.de/projects/minionpro/}.)% +% +%\begin{macro}{\MT@get@range} +%\begin{macro}{\MT@upper} +%\begin{macro}{\MT@lower} +% Ranges will be stored as triples of +% |{|\meta{lower bound}|}{|\meta{upper bound}|}{|\meta{list name}|}|. +% For simple sizes, the upper boundary is -1. +% \begin{macrocode} +\def\MT@get@range#1-#2-#3\@nil{% + \MT@ifempty{#1}{% + \MT@ifempty{#2}{% + \let\MT@val\relax + }{% + \def\MT@lower{0}% + \def\MT@val{#2}% + \MT@get@size + \edef\MT@upper{\MT@val}% + }% + }{% + \def\MT@val{#1}% + \MT@get@size + \ifx\MT@val\relax \else + \edef\MT@lower{\MT@val}% + \MT@ifempty{#2}{% + \MT@ifempty{#3}{% + \def\MT@upper{-1}% + }{% + \def\MT@upper{2048}% + }% + }{% + \def\MT@val{#2}% + \MT@get@size + \ifx\MT@val\relax \else + \MT@ifgt\MT@lower\MT@val{% + \MT@warning{% + Invalid size range (\MT@lower\space > \MT@val) in font set + `\MT@curr@set@name'.\MessageBreak Swapping sizes}% + \edef\MT@upper{\MT@lower}% + \edef\MT@lower{\MT@val}% + }{% + \edef\MT@upper{\MT@val}% + }% + \MT@ifeq\MT@lower\MT@upper{% + \def\MT@upper{-1}% + }\relax + \fi + }% + \fi + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@get@size} +% Translate a size selection command and normalize it. +% \begin{macrocode} +\def\MT@get@size{% +% \end{macrocode} +% A single star would mean \cs{sizedefault}, which doesn't exist, so we define +% it to be \cmd{\normalsize}. +% \begin{macrocode} + \if*\MT@val\relax + \def\@tempa{\normalsize}% + \else + \MT@let@cn\@tempa{\MT@val}% + \fi + \ifx\@tempa\relax \else +% \end{macrocode} +% The \pkg{relsize} solution of parsing \cmd{\@setfontsize} does not work with the +% \pkg{ams*} classes, among others. I hope my hijacking doesn't do any harm. +%\changes{v1.2}{2004/09/26}{hijack \cmd{\set@fontsize} instead of \cmd{\@setfontsize}} +% We redefine \cmd{\set@fontsize}, and not \cmd{\@setfontsize} because some classes +% might define the size selection commands by simply using \cmd{\fontsize} +% (\eg\ the \pkg{a0poster} class). +% \begin{macrocode} + \begingroup + \def\set@fontsize##1##2##3##4\@nil{\gdef\MT@val{##2}}% + \@tempa\@nil + \endgroup + \fi +% \end{macrocode} +% Test whether we finally got a number or dimension so that we can strip the +% `|pt|' (\cmd{\@defaultunits} and \cmd{\strip@pt} are kernel macros). +%\changes{v1.2}{2004/09/27}{additional magic to catch some errors} +%\changes{v1.7}{2005/03/15}{comparison with 1 to allow size smaller than 1 +% (suggested by Andreas B\"uhmann)} ^^A +% ^^A private mail, 15/03/2005 +% \begin{macrocode} + \MT@ifdimen\MT@val{% + \@defaultunits\@tempdima\MT@val pt\relax\@nnil + \edef\MT@val{\strip@pt\@tempdima}% + }{% + \MT@warning{Could not parse font size `\MT@val'\MessageBreak + in font set `\MT@curr@set@name'}% + \let\MT@val\relax + }% +} +% \end{macrocode} +%\end{macro} +%\changes{v1.9}{2005/07/13}{\cs{DeclareMicrotypeSet}: new key: \texttt{font}} +%\begin{macro}{\MT@define@set@key@font} +% \begin{macrocode} +\def\MT@define@set@key@font#1{% + \define@key{MT@#1@set}{font}[]{% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \expandafter\MT@get@font\MT@val/////\@nil + \expandafter\MT@xadd + \csname MT@#1list@font@\MT@curr@set@name\endcsname + {\csname\MT@val\endcsname,}% + }% +%\MT@dinfo@nl{1}{-- font: \@nameuse{MT@#1list@font@\MT@curr@set@name}}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@font} +% Translate any asterisks. +% \begin{macrocode} +\def\MT@get@font#1/#2/#3/#4/#5/#6\@nil{% + \MT@ifempty{#1#2#3#4#5}\relax{% + \let\@tempb\@empty + \def\MT@temp{#1/#2/#3/#4/#5}% + \MT@get@axis{encoding}{#1}% + \MT@get@axis{family}{#2}% + \MT@get@axis{series}{#3}% + \MT@get@axis{shape}{#4}% + \MT@ifempty{#5}{% + \MT@warning{size axis is empty in font specification\MessageBreak + `\MT@temp'. Using \string\normalsize\space instead}% + \def\MT@val{*}% + }{% + \def\MT@val{#5}% + }% + \MT@get@size + \ifx\MT@val\relax\def\MT@val{0}\fi + \edef\MT@val{\expandafter\@gobble\@tempb/\MT@val}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@axis} +% \begin{macrocode} +\def\MT@get@axis#1#2{% + \def\MT@val{#2}% + \MT@get@highlevel{#1}% + \MT@ifempty\MT@val{% + \MT@warning{#1 axis is empty in font specification\MessageBreak + `\MT@temp'. Using `\csname #1default\endcsname' instead}% + \edef\@tempb{\@tempb/\csname #1default\endcsname}% + }{% + \edef\@tempb{\@tempb/\MT@val}% + }% +} +% \end{macrocode} +%\end{macro} +% We have finally assembled all pieces to define \cs{DeclareMicrotypeSet}'s +% keys. +% \begin{macrocode} +\MT@define@set@keys{pr} +\MT@define@set@keys{ex} +%<*beta> +\MT@define@set@keys{sp} +\MT@define@set@keys{kn} +% +% \end{macrocode} +% It is also used for \cs{DisableLigatures}. +% \begin{macrocode} +\MT@define@set@keys{nl} +% \end{macrocode} +%\begin{macro}{\UseMicrotypeSet} +% To use a particular set we simply redefine |MT@|\meta{feature}|@setname|. +% If the optional argument is empty, set names for all features will be +% redefined. +%\changes{v1.1}{2004/09/20}{remove spaces around first argument} +% \begin{macrocode} +\renewcommand*\UseMicrotypeSet[2][]{% + \KV@@sp@def\@tempa{#1}% + \MT@ifempty\@tempa{% + \MT@use@set{pr}{#2}% + \MT@use@set{ex}{#2}% +%<*beta> + \MT@use@set{sp}{#2}% + \MT@use@set{kn}{#2}% +% + }{% + \MT@map@clist@c\@tempa{% + {\KV@@sp@def\@tempa{##1}% + \MT@ifempty\@tempa\relax{% + \MT@exp@one@n\MT@use@set{\csname MT@rbba@\@tempa\endcsname}{#2}}}% + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@pr@setname} +%\begin{macro}{\MT@ex@setname} +%\begin{macro}{\MT@use@set} +% Only use sets that have been declared. +%\changes{v1.1}{2004/09/20}{remove spaces around set name} +%\changes{v1.4b}{2004/11/25}{don't use undeclared font sets} +%\changes{v1.6}{2005/01/19}{retain current set if new set is undeclared} +%\changes{v1.8}{2005/05/15}{bug fix: remove braces in first line} +% \begin{macrocode} +\def\MT@use@set#1#2{% + \KV@@sp@def\@tempa{#2}% + \MT@ifdefined@n{MT@#1@set@@\@tempa}{% + \global\MT@edef@n{MT@#1@setname}{\@tempa}% + \MT@info{Using \@nameuse{MT@abbr@#1} set `\@tempa'}% + }{% + \MT@ifdefined@n{MT@#1@setname}\relax{% + \global\MT@edef@n{MT@#1@setname}{\@nameuse{MT@default@#1@set}}% + }% + \MT@warning{% + The \@nameuse{MT@abbr@#1} set `\@tempa' is undeclared.\MessageBreak + Using set `\@nameuse{MT@#1@setname}' instead}% + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\DeclareMicrotypeSetDefault} +%\changes{v1.8}{2005/05/15}{new macro: set fall back font set} +% This command can be used in the main configuration file to declare the +% default font set, in case no set is specified in the package options. +% \begin{macrocode} +\renewcommand*\DeclareMicrotypeSetDefault[2][]{% + \KV@@sp@def\@tempa{#1}% + \MT@ifempty\@tempa{% + \MT@set@default@set{pr}{#2}% + \MT@set@default@set{ex}{#2}% +%<*beta> + \MT@set@default@set{sp}{#2}% + \MT@set@default@set{kn}{#2}% +% + }{% + \MT@map@clist@c\@tempa{% + {\KV@@sp@def\@tempa{##1}% + \MT@ifempty\@tempa\relax{% + \MT@exp@one@n\MT@set@default@set + {\csname MT@rbba@\@tempa\endcsname}{#2}}}% + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@default@pr@set} +%\begin{macro}{\MT@default@ex@set} +%\begin{macro}{\MT@default@kn@set} +%\begin{macro}{\MT@default@sp@set} +%\begin{macro}{\MT@set@default@set} +% \begin{macrocode} +\def\MT@set@default@set#1#2{% + \KV@@sp@def\@tempa{#2}% + \MT@ifdefined@n{MT@#1@set@@\@tempa}{% +%\MT@dinfo{1}{declaring default \@nameuse{MT@abbr@#1} set `\@tempa'}% + \global\MT@edef@n{MT@default@#1@set}{\@tempa}% + }{% + \MT@warning{% + The \@nameuse{MT@abbr@#1} set `\@tempa' is not declared.\MessageBreak + Cannot make it the default set. Using set\MessageBreak `all' instead}% + \global\MT@edef@n{MT@default@#1@set}{all}% + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\DeclareMicrotypeAlias} +% This can be used to set an alias name for a font, so that the file (and the +% settings) for the aliased font will be loaded. +%\changes{v1.5}{2004/12/03}{remove spaces around arguments} +%\changes{v1.8}{2005/05/09}{warning when overriding an alias font} +% \begin{macrocode} +\renewcommand*\DeclareMicrotypeAlias[2]{% + \KV@@sp@def\@tempa{#1}% + \KV@@sp@def\@tempb{#2}% + \MT@make@string\@tempb + \MT@ifdefined@n{MT@\@tempa @alias}{% + \MT@warning{Alias font family `\@tempb' will override + alias `\@nameuse{MT@\@tempa @alias}'\MessageBreak + for font family `\@tempa'}}\relax + \global\MT@edef@n{MT@\@tempa @alias}{\@tempb}% +% \end{macrocode} +% If we encounter this command while a font is being set up, we also set the +% alias for the current font so that if \cs{DeclareMicrotypeAlias} has been +% issued inside a configuration file, the configuration file for the alias font +% will be loaded, too. +%\changes{v1.7}{2005/03/23}{may also be used inside configuration files} +% \begin{macrocode} + \MT@ifdefined@c\MT@family{% +%\MT@dinfo{1}{Activating alias font `\@tempb' for `\MT@family'}% + \global\let\MT@familyalias\@tempb + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\LoadMicrotypeFile} +%\changes{v1.7}{2005/03/22}{new macro (suggested by Andreas B\"uhmann)} +% ^^A +% ^^A private mail, 21/3/2005 +% May be used to load a configuration file manually. +% \begin{macrocode} +\def\LoadMicrotypeFile#1{% + \KV@@sp@def\@tempa{#1}% + \MT@make@string\@tempa + \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list + \ifMT@inlist@ + \MT@vinfo{... Configuration file mt-\@tempa.cfg already loaded}% + \else + \MT@xadd\MT@file@list{\@tempa,}% + \MT@begin@catcodes + \InputIfFileExists{mt-\@tempa.cfg}{% + \MT@vinfo{... Loading configuration file mt-\@tempa.cfg}% + }{% + \MT@warning{... Configuration file mt-\@tempa.cfg\MessageBreak + does not exist}% + }% + \MT@end@catcodes + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\DisableLigatures} +%\changes{v1.9}{2005/07/11}{new macro: disable ligatures (requires \pdftex\ 1.30)} +% This is really simple now: We can re-use the set definitions of +% \cs{DeclareMicrotypeSet}; there can only be one set, which we'll call `no +% ligatures'. +% \begin{macrocode} +\ifnum\MT@pdftex@no > 4 + \renewcommand*\DisableLigatures[1]{% + \MT@noligaturestrue + \MT@declare@sets{nl}{no ligatures}{#1}% + \gdef\MT@nl@setname{no ligatures}% + } +\else +% \end{macrocode} +% If \pdftex\ is too old, we issue a warning and neutralize the command. +% \begin{macrocode} + \renewcommand*\DisableLigatures[1]{% + \MT@warning{Disabling ligatures of a font is only possible\MessageBreak + with pdftex version 1.30 or later.\MessageBreak + Ignoring \string\DisableLigatures}% + \let\DisableLigatures\@gobble + } +\fi +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Interaction with \pkg{babel}} +% +%\begin{macro}{\DeclareMicrotypeBabelHook} +% Declare the context that should be loaded when a \pkg{babel} language +% is selected. +%\changes{v2.0}{2005/10/05}{new command: interaction with \pkg{babel}} +% \begin{macrocode} +%<*beta> +\def\DeclareMicrotypeBabelHook#1#2{% + \MT@map@clist@n{#1}{% + \KV@@sp@def\@tempa{##1}% + \global\MT@def@n{MT@babel@\@tempa}{#2}% + }% +} +\@onlypreamble{\DeclareMicrotypeBabelHook} +% +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +% +% \end{macrocode} +% +%\subsubsection{Declarations} +%\GeneralChanges{Font Sets} +%\NoIndexing +% +% We now set up some default sets (in the main configuration file). +%\changes{v1.2}{2004/10/02}{new: \texttt{allmath} and \texttt{basicmath}} +%\changes{v1.8}{2005/05/25}{add \U\ encoding to \texttt{allmath}} +%\changes{v1.9}{2005/08/17}{add \otIV\ encoding to text sets} +%\changes{v1.9}{2005/08/17}{add \tV\ encoding to text sets} +% +% \begin{macrocode} +%<*config&m-t> + +%%% ---------------------------------------------------------------------- +%%% FONT SETS + +\DeclareMicrotypeSet{all} + { } + +\DeclareMicrotypeSet{allmath} + { encoding = {T1,LY1,OT1,OT4,T5,TS1,OML,OMS,U} } + +\DeclareMicrotypeSet{alltext} + { encoding = {T1,LY1,OT1,OT4,T5,TS1} } + +\DeclareMicrotypeSet{basicmath} + { encoding = {T1,LY1,OT1,OT4,T5,OML,OMS}, + family = {rm*,sf*}, + series = {m}, + size = {normalsize,footnotesize,small,large} + } + +\DeclareMicrotypeSet{basictext} + { encoding = {T1,LY1,OT1,OT4,T5}, + family = {rm*,sf*}, + series = {m}, + size = {normalsize,footnotesize,small,large} + } + +\DeclareMicrotypeSet{normalfont} + { font = */*/*/*/* } + +% \end{macrocode} +% The default sets. +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% DEFAULT SETS + +\DeclareMicrotypeSetDefault[protrusion]{alltext} +\DeclareMicrotypeSetDefault[expansion] {basictext} +%<*beta> +\DeclareMicrotypeSetDefault[spacing] {basictext} +\DeclareMicrotypeSetDefault[kerning] {alltext} +% + +% \end{macrocode} +% The Latin Modern fonts, the virtual fonts from the \pkg{ae} and \pkg{zefonts}, +% and the \pkg{eco} and \pkg{hfoldsty} packages (oldstyle numerals) all inherit +% the (basic) settings from Computer Modern Roman. Some of them are in part +% overwritten later. +%\changes{v1.2}{2004/10/03}{declare \texttt{cmr} as an alias for \texttt{cmor}} +%\changes{v1.3}{2004/10/22}{declare \texttt{cmr} as an alias for +% \texttt{aer}, \texttt{zer} and \texttt{hfor}} +% The packages \pkg{pxfonts} and \pkg{txfonts} fonts inherit Palatino and Times +% settings respectively. +%\changes{v1.8}{2005/04/19}{declare \texttt{ppl} and \texttt{ptm} as alias fonts +% for \texttt{pxr} resp. \texttt{txr}} +%\changes{v1.9}{2005/08/16}{declare \texttt{qpl} and \texttt{qtm} (\pkg{qfonts}) +% as alias fonts for \texttt{ppl} resp. \texttt{ptm}} +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% FONT ALIASES + +\DeclareMicrotypeAlias{lmr} {cmr} % lmodern +\DeclareMicrotypeAlias{aer} {cmr} % ae +\DeclareMicrotypeAlias{zer} {cmr} % zefonts +\DeclareMicrotypeAlias{cmor}{cmr} % eco +\DeclareMicrotypeAlias{hfor}{cmr} % hfoldsty +\DeclareMicrotypeAlias{pxr} {ppl} % pxfonts +\DeclareMicrotypeAlias{qpl} {ppl} % qfonts/QuasiPalatino +\DeclareMicrotypeAlias{txr} {ptm} % txfonts +\DeclareMicrotypeAlias{qtm} {ptm} % qfonts/QuasiTimes + +% \end{macrocode} +%\todo{check Times variants} +% More Times variants, to be checked: |pns|, |mns| (TimesNewRomanPS); |mnt| +% (TimesNewRomanMT), |mntx| (TimesNRExpertMT); |mtm| (TimesSmallTextMT); |pte| +% (Times\-Europa); |ptt|, |pttj| (TimesTen); TimesEighteen; TimesModernEF. +% \begin{macrocode} +%<*beta> +% \end{macrocode} +% Interaction with \pkg{babel}. +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% INTERACTION WITH THE `babel' PACKAGE + +\DeclareMicrotypeBabelHook + {french,francais} + {kerning=french, spacing=} + +\DeclareMicrotypeBabelHook + {english,american,USenglish,british,UKenglish} + {kerning=, spacing=nonfrench} + +\DeclareMicrotypeBabelHook + {turkish} + {kerning=turkish, spacing=} + +% +% +% \end{macrocode} +% +%\GeneralChanges! +%\Indexing +% +%\subsubsection{Fine Tuning} +% +% The macros \cs{SetExpansion} and \cs{SetProtrusion} provide a similar +% interface for setting the character protrusion resp. expansion factors for a +% set of fonts. +% +%\begin{macro}{\SetProtrusion} +%\begin{macro}{\MT@pr@c@name} +%\begin{macro}{\MT@load} +%\begin{macro}{\MT@extra@factor} +%\begin{macro}{\MT@extra@preset} +%\begin{macro}{\MT@extra@unit} +%\begin{macro}{\MT@extra@context} +% This macro accepts three arguments: [options,] set of font characteristics and +% list of character protrusion factors. +% +% A new macro called |\MT@pr@c@|\meta{name} will be defined to be \meta{\#3} +% (i.e. the list of characters, not expanded). +% \begin{macrocode} +%<*package> +\renewcommand*\SetProtrusion[2][]{% + \let\MT@pr@c@name\@undefined + \let\MT@load\@undefined + \let\MT@extra@factor\@undefined + \let\MT@extra@unit\@undefined + \let\MT@extra@preset\@undefined + \let\MT@extra@context\@empty +% \end{macrocode} +% Parse the optional first argument: +% \begin{macrocode} + \setkeys{MT@pr@c}{#1}% +% \end{macrocode} +% If the user hasn't specified a name, we will create one. +% \begin{macrocode} + \MT@get@codes@name{pr}% + \MT@set@pr@opt +%\MT@dinfo{1}{creating protrusion list `\MT@pr@c@name'}% + \def\MT@permutelist{pr@c}% + \setkeys{MT@pr@c}{#2}% +% \end{macrocode} +%\begin{macro}{\MT@permutelist} +% We have parsed the second argument, and can now define macros for all +% permutations of the font characteristics to point to +% |\MT@pr@c@|\meta{name},~\dots +% \begin{macrocode} + \MT@permute +% \end{macrocode} +% \dots~which we can now define to be \meta{\#3}. +% We want the catcodes to be correct even if this is called in the preamble. +% \begin{macrocode} + \MT@begin@catcodes + \MT@set@pr@list +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@pr@list} +% Here, as elsewhere, we have to make the definitions global, since they will +% occur inside a group. +% \begin{macrocode} +\def\MT@set@pr@list#1{% + \global\MT@def@n{MT@pr@c@\MT@pr@c@name}{#1}% + \MT@end@catcodes +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\SetExpansion} +%\begin{macro}{\MT@ex@c@name} +%\begin{macro}{\MT@load} +%\begin{macro}{\MT@extra@factor} +%\begin{macro}{\MT@extra@stretch} +%\begin{macro}{\MT@extra@shrink} +%\begin{macro}{\MT@extra@step} +%\begin{macro}{\MT@extra@auto} +%\begin{macro}{\MT@extra@preset} +%\begin{macro}{\MT@extra@context} +% \cs{SetExpansion} only differs in that it allows some extra options +% (|stretch|, |shrink|, |step|, |auto|). +% \begin{macrocode} +\renewcommand*\SetExpansion[2][]{% + \let\MT@ex@c@name\@undefined + \let\MT@load\@undefined + \let\MT@extra@factor\@undefined + \let\MT@extra@stretch\@undefined + \let\MT@extra@shrink\@undefined + \let\MT@extra@step\@undefined + \let\MT@extra@auto\@undefined + \let\MT@extra@preset\@undefined + \let\MT@extra@context\@empty + \setkeys{MT@ex@c}{#1}% + \MT@get@codes@name{ex}% + \MT@set@ex@opt +%\MT@dinfo{1}{creating expansion list `\MT@ex@c@name'}% + \def\MT@permutelist{ex@c}% + \setkeys{MT@ex@c}{#2}% + \MT@permute + \MT@begin@catcodes + \MT@set@ex@list +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@ex@list} +% Same story. +% \begin{macrocode} +\def\MT@set@ex@list#1{% + \global\MT@def@n{MT@ex@c@\MT@ex@c@name}{#1}% + \MT@end@catcodes +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +%<*beta> +% \end{macrocode} +%\begin{macro}{\SetExtraSpacing} +%\begin{macro}{\MT@sp@c@name} +%\begin{macro}{\MT@load} +%\begin{macro}{\MT@extra@factor} +%\begin{macro}{\MT@extra@unit} +%\begin{macro}{\MT@extra@preset} +%\begin{macro}{\MT@extra@context} +% \begin{macrocode} +\renewcommand*\SetExtraSpacing[2][]{% + \let\MT@sp@c@name\@undefined + \let\MT@load\@undefined + \let\MT@extra@factor\@undefined + \let\MT@extra@unit\@undefined + \let\MT@extra@preset\@undefined + \let\MT@extra@context\@empty + \setkeys{MT@sp@c}{#1}% + \MT@get@codes@name{sp}% + \MT@set@sp@opt +%\MT@dinfo{1}{creating space list `\MT@sp@c@name'}% + \def\MT@permutelist{sp@c}% + \setkeys{MT@sp@c}{#2}% + \MT@permute + \MT@begin@catcodes + \MT@set@sp@list +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@sp@list} +% \begin{macrocode} +\def\MT@set@sp@list#1{% + \global\MT@def@n{MT@sp@c@\MT@sp@c@name}{#1}% + \MT@end@catcodes +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\SetExtraKerning} +%\begin{macro}{\MT@kn@c@name} +%\begin{macro}{\MT@load} +%\begin{macro}{\MT@extra@factor} +%\begin{macro}{\MT@extra@unit} +%\begin{macro}{\MT@extra@preset} +%\begin{macro}{\MT@extra@context} +% \begin{macrocode} +\renewcommand*\SetExtraKerning[2][]{% + \let\MT@kn@c@name\@undefined + \let\MT@load\@undefined + \let\MT@extra@factor\@undefined + \let\MT@extra@unit\@undefined + \let\MT@extra@preset\@undefined + \let\MT@extra@context\@empty + \setkeys{MT@kn@c}{#1}% + \MT@get@codes@name{kn}% + \MT@set@kn@opt +%\MT@dinfo{1}{creating kerning list `\MT@kn@c@name'}% + \def\MT@permutelist{kn@c}% + \setkeys{MT@kn@c}{#2}% + \MT@permute + \MT@begin@catcodes + \MT@set@kn@list +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@set@kn@list} +% \begin{macrocode} +\def\MT@set@kn@list#1{% + \global\MT@def@n{MT@kn@c@\MT@kn@c@name}{#1}% + \MT@end@catcodes +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +% +% \end{macrocode} +%\begin{macro}{\MT@get@codes@name} +% Simply use a roman number as the list name if the user didn't bother creating +% one. +% \begin{macrocode} +\def\MT@get@codes@name#1{% + \MT@ifdefined@n{MT@#1@c@name}{% + \MT@ifdefined@n{MT@#1@c@\csname MT@#1@c@name\endcsname}{% + \MT@warning{Redefining list `\@nameuse{MT@#1@c@name}'}% + }\relax + }{% + \@tempcnta=\@ne + \MT@while@num{\@tempcnta > \z@}{% + \MT@ifdefined@n{MT@#1@c@#1-\romannumeral\@tempcnta}{% + \advance \@tempcnta \@ne + }{% + \MT@edef@n{MT@#1@c@name}{#1-\romannumeral\@tempcnta}% + \@tempcnta=\z@ + }% + }% + }% + \MT@let@cn\MT@curr@set@name{MT@#1@c@name}% +% \end{macrocode} +%\changes{v1.3}{2004/10/27}{bug fix: specifying \texttt{load} option does no +% longer require to give a \texttt{name}, too} +% Now that we know the name, we can cater for any set to be loaded by this list. +% \begin{macrocode} + \MT@ifdefined@c\MT@load{% + \global\MT@let@nc{MT@#1@c@\MT@curr@set@name load}\MT@load + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@pr@opt} +% Three extra option for protrusion: |factor|, |unit| and |preset|. +% \begin{macrocode} +\def\MT@set@pr@opt{% + \MT@set@opt@{pr}{factor}% + \MT@set@opt@{pr}{unit}% + \MT@set@opt@{pr}{preset}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@ex@opt} +% The extra options to \cs{SetExpansion} also have to be dealt with only after +% we know the name. +%\changes{v1.4}{2004/11/10}{bug fix: specifying extra options does no +% longer require to give a \texttt{name}, too} +% \begin{macrocode} +\def\MT@set@ex@opt{% + \MT@ifdefined@c\MT@extra@factor{% + \ifnum\MT@extra@factor>\@m + \MT@warning@nl{Expansion factor \number\MT@extra@factor\space too + large in list\MessageBreak `\MT@ex@c@name'. Setting it to the + maximum of 1000}% + \let\MT@extra@factor\@m + \fi + \global\MT@let@nc{MT@ex@c@\MT@ex@c@name @factor}\MT@extra@factor + }\relax + \MT@set@opt@{ex}{stretch}% + \MT@set@opt@{ex}{shrink}% + \MT@set@opt@{ex}{step}% + \MT@set@opt@{ex}{auto}% + \MT@set@opt@{ex}{preset}% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +%<*beta> +% \end{macrocode} +%\begin{macro}{\MT@set@sp@opt} +% \begin{macrocode} +\def\MT@set@sp@opt{% + \MT@set@opt@{sp}{factor}% + \MT@set@opt@{sp}{unit}% + \MT@set@opt@{sp}{preset}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@kn@opt} +% \begin{macrocode} +\def\MT@set@kn@opt{% + \MT@set@opt@{kn}{factor}% + \MT@set@opt@{kn}{unit}% + \MT@set@opt@{kn}{preset}% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +% +% \end{macrocode} +%\begin{macro}{\MT@set@opt@} +% \begin{macrocode} +\def\MT@set@opt@#1#2{% + \MT@ifdefined@n{MT@extra@#2}{% + \global\MT@let@nn{MT@#1@c@\csname MT@#1@c@name\endcsname @#2}{MT@extra@#2}% + }\relax +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@code@key} +% Define the keys for expansion and protrusion character code lists. +% \begin{macrocode} +\def\MT@define@code@key#1#2{% + \define@key{MT@#2}{#1}[]{% + \@tempcnta=\@ne + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% +% \end{macrocode} +% Here, too, we allow for something like `|bf*|'. It will be expanded +% immediately. +% \begin{macrocode} + \MT@get@highlevel{#1}% + \MT@edef@n{MT@temp#1\romannumeral\@tempcnta}{\MT@val}% + \advance\@tempcnta \@ne + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@code@key@size} +% \begin{macrocode} +\def\MT@define@code@key@size#1{% + \define@key{MT@#1}{size}[]{% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \expandafter\MT@get@range\MT@val--\@nil + \ifx\MT@val\relax \else + \expandafter\MT@xadd + \csname MT@tempsize\endcsname + {{{\MT@lower}{\MT@upper}{\csname MT@#1@name\endcsname}}}% + \fi + }% + }% +} +% \end{macrocode} +%\end{macro} +%\changes{v1.9}{2005/07/13}{\cs{SetProtrusion} and \cs{SetExpansion}: new key: \texttt{font}} +%\begin{macro}{\MT@define@code@key@font} +% \begin{macrocode} +\def\MT@define@code@key@font#1{% + \define@key{MT@#1}{font}[]{% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \expandafter\MT@get@font@and@size\MT@val/////\@nil + \global\MT@edef@n{MT@\MT@permutelist @\@tempb}% + {\csname MT@\MT@permutelist @name\endcsname}% + \expandafter\MT@xaddb + \csname MT@\MT@permutelist @\@tempb @sizes\endcsname + {{{\MT@val}{\m@ne}{\csname MT@#1@name\endcsname}}}% + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@font@and@size} +% Translate any asterisks and split off the size. +% \begin{macrocode} +\def\MT@get@font@and@size#1/#2/#3/#4/#5/#6\@nil{% + \MT@ifempty{#1#2#3#4#5}\relax{% + \let\@tempb\@empty + \def\MT@temp{#1/#2/#3/#4/#5}% + \MT@get@axis{encoding}{#1}% + \MT@get@axis{family}{#2}% + \MT@get@axis{series}{#3}% + \MT@get@axis{shape}{#4}% +% \end{macrocode} +% Remove leading slash and append an asterisk for the size. +% \begin{macrocode} + \edef\@tempb{\expandafter\@gobble\@tempb/*}% + \MT@ifempty{#5}{% + \MT@warning{size axis is empty in font specification\MessageBreak + `\MT@temp'. Using \string\normalsize\space instead}% + \def\MT@val{*}% + }{% + \def\MT@val{#5}% + }% + \MT@get@size + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@declare@codes} +% \begin{macrocode} +\def\MT@declare@codes#1{% + \define@key{MT@#1@c}{name}[]{% + \MT@ifempty{##1}\relax{% + \MT@def@n{MT@#1@c@name}{##1}% + }% + }% + \define@key{MT@#1@c}{load}[]{% + \MT@ifempty{##1}\relax{% + \def\MT@load{##1}% + }% + }% + \define@key{MT@#1@c}{factor}[]{% + \MT@ifempty{##1}\relax{% + \def\MT@extra@factor{##1 }% + }% + }% + \MT@define@code@key{encoding}{#1@c}% + \MT@define@code@key{family}{#1@c}% + \MT@define@code@key{series}{#1@c}% + \MT@define@code@key{shape}{#1@c}% + \MT@define@code@key@size{#1@c}% + \MT@define@code@key@font{#1@c}% + \define@key{MT@#1@c}{preset}[]{% + \MT@ifempty{##1}\relax{% + \def\MT@extra@preset{##1}% + }% + }% +% \end{macrocode} +% Only one context is allowed. This might change in the future. +% \begin{macrocode} + \define@key{MT@#1@c}{context}[]{% + \MT@ifempty{##1}\relax{% + \def\MT@extra@context{##1}% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@declare@codes{pr} +\MT@declare@codes{ex} +%<*beta> +\MT@declare@codes{sp} +\MT@declare@codes{kn} +% +% \end{macrocode} +% Protrusion codes may be relative to character width, or to any dimension. +%\changes{v1.8}{2005/04/14}{\cs{SetProtrusion}: new option: \texttt{unit}} +%\changes{v1.9}{2005/09/28}{\cs{SetProtrusion}: value `\texttt{relative}' renamed +% to `\texttt{character}' for option \texttt{unit}} +% \begin{macrocode} +\define@key{MT@pr@c}{unit}[character]{% + \let\MT@extra@unit\@empty + \KV@@sp@def\@tempa{#1}% + \MT@ifstreq\@tempa{relative}{% + \MT@warning{Value `relative' for key `unit' is deprecated.\MessageBreak + Use `unit=character' instead. For now, I'll do it\MessageBreak + for you}% + \def\@tempa{character}% + }\relax + \MT@ifstreq\@tempa{character}\relax{% +% \end{macrocode} +% Test whether it's a dimension, but do not translate it into its final +% form here, since it may be font-specific. +% \begin{macrocode} + \MT@ifdimen\@tempa{% + \let\MT@extra@unit\@tempa + }{% + \MT@warning{`\@tempa' is not a dimension.\MessageBreak + Ignoring it and setting values relative to\MessageBreak + character widths}% + }% + }% +} +% \end{macrocode} +%\changes{v2.0}{2005/09/28}{\cs{SetExtraKerning}/\cs{SetExtraSpacing}: +% new key `\texttt{space}' for option \texttt{unit}} +%\begin{macro}{\MT@define@key@unit} +% Spacing and kerning codes may additionally be relative to space dimensions. +% \begin{macrocode} +%<*beta> +\def\MT@define@key@unit#1{% + \define@key{MT@#1@c}{unit}[space]{% + \let\MT@extra@unit\@empty + \KV@@sp@def\@tempa{##1}% + \MT@ifstreq\@tempa{relative}{% + \MT@warning{Value `relative' for key `unit' is deprecated.\MessageBreak + Use `unit=character' instead. For now, I'll do it\MessageBreak + for you}% + \def\@tempa{character}% + }\relax + \MT@ifstreq\@tempa{character}\relax{% + \let\MT@extra@unit\m@ne + \MT@ifstreq\@tempa{space}\relax{% + \MT@ifdimen\@tempa{% + \let\MT@extra@unit\@tempa + }{% + \MT@warning{`\@tempa' is not a dimension.\MessageBreak + Ignoring it and setting values relative to\MessageBreak + width of space}% + }% + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@key@unit{sp} +\MT@define@key@unit{kn} +% +% \end{macrocode} +%\begin{macro}{\MT@define@ex@c@key} +% The first argument to \cs{SetExpansion} accepts some more options. +% \begin{macrocode} +\def\MT@define@ex@c@key#1{% + \define@key{MT@ex@c}{#1}[]{% + \MT@ifempty{##1}\relax{% + \MT@ifnumber{##1}{% +% \end{macrocode} +% A space terminates the number. +% \begin{macrocode} + \MT@def@n{MT@extra@#1}{##1 }% + }{% + \MT@warning{% + Value `##1' for option `#1' is not a number.\MessageBreak + Ignoring it}% + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@ex@c@key{stretch} +\MT@define@ex@c@key{shrink} +\MT@define@ex@c@key{step} +\define@key{MT@ex@c}{auto}[true]{% + \KV@@sp@def\@tempa{#1}% + \csname if\@tempa\endcsname +% \end{macrocode} +% Don't alter \cs{MT@extra@auto} for \pdftex\ version older than 1.20. +%\changes{v1.7}{2005/03/07}{\cs{SetExpansion}: bug fix: remove +% space after \texttt{autoexpand}} +%\changes{v1.7}{2005/03/07}{\cs{SetExpansion}: don't allow automatic +% expansion for old \pdftex\ versions} +% \begin{macrocode} + \ifnum\MT@pdftex@no > \thr@@ + \def\MT@extra@auto{autoexpand}% + \else + \MT@warning{pdfTeX too old for automatic font expansion}% + \fi + \else + \ifnum\MT@pdftex@no > \thr@@ + \let\MT@extra@auto\@empty + \fi + \fi +} +% \end{macrocode} +% +%\subsubsection{Character Inheritance} +% +%\begin{macro}{\DeclareCharacterInheritance} +%\changes{v1.1}{2004/09/15}{new macro: possibility to specify character inheritance} +% This macro may be used in the configuration files to declare characters that +% should inherit protrusion resp. expansion values from other characters. Thus, +% there is no need to define all accented characters (\eg\ |\`a|, |\'a|, +% |\^a|, |\~a|, |\"a|, |\r{a}|, |\k{a}|, |\u{a}|), which will make the +% configuration files look much nicer and easier to maintain. If a single +% character of an inheritance list should have a different value, one can +% simply override it. +% \begin{macrocode} +\renewcommand*\DeclareCharacterInheritance[1][]{% + \KV@@sp@def\@tempa{#1}% + \MT@begin@catcodes + \MT@set@inh@list +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@set@inh@list} +% Safe category codes. +% \begin{macrocode} +\def\MT@set@inh@list#1#2{% + \MT@ifempty\@tempa{% + \MT@declare@char@inh{pr}{#1}{#2}% + \MT@declare@char@inh{ex}{#1}{#2}% +%<*beta> + \MT@declare@char@inh{sp}{#1}{#2}% + \MT@declare@char@inh{kn}{#1}{#2}% +% + }{% + \MT@map@clist@c\@tempa{% + {\KV@@sp@def\@tempa{##1}% + \MT@ifempty\@tempa\relax{% + \MT@exp@one@n\MT@declare@char@inh + {\csname MT@rbba@\@tempa\endcsname}{#1}{#2}}}% + }% + }% + \MT@end@catcodes +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@declare@char@inh} +% The optional argument may be used to restrict the inheritance list to +% protrusion or expansion. +% \begin{macrocode} +\def\MT@declare@char@inh#1#2#3{% + \MT@let@nc{MT@#1@inh@name}\@undefined + \MT@get@inh@name{#1}% +%\MT@dinfo{1}{creating inheritance list `\@nameuse{MT@#1@inh@name}'}% + \global\MT@def@n{MT@#1@inh@\csname MT@#1@inh@name\endcsname}{#3}% + \def\MT@permutelist{#1@inh}% + \setkeys{MT@#1@inh}{#2}% + \MT@permute +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@get@inh@name} +% The inheritance lists cannot be named by the user. +% \begin{macrocode} +\def\MT@get@inh@name#1{% + \@tempcnta=\@ne + \MT@while@num{\@tempcnta > \z@}{% + \MT@ifdefined@n{MT@#1@inh@#1-inh-\romannumeral\@tempcnta}{% + \advance \@tempcnta \@ne + }{% + \MT@edef@n{MT@#1@inh@name}{#1-inh-\romannumeral\@tempcnta}% + \@tempcnta=\z@ + }% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@inh@key@encoding} +% Parse the first argument. \cs{DeclareCharacterInheritance} may also be set +% up for various combinations. +%\changes{v1.2}{2004/09/29}{check whether only one encoding specified} +% \begin{macrocode} +\def\MT@define@inh@key@encoding#1{% + \define@key{MT@#1}{encoding}[]{% + \def\MT@val{##1}% + \expandafter\MT@encoding@check\MT@val,\@nil + \MT@get@highlevel{encoding}% + \MT@edef@n{MT@tempencoding\romannumeral1}{\MT@val}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@encoding@check} +% But we only allow \emph{one} encoding. +% \begin{macrocode} +\def\MT@encoding@check#1,#2\@nil{% + \MT@ifempty{#2}\relax{% + \edef\MT@val{#1}% + \MT@warning{You may only specify one encoding for character\MessageBreak + inheritance lists. Ignoring encoding(s) #2}% + }% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@inh@keys} +% \begin{macrocode} +\def\MT@define@inh@keys#1{% + \MT@define@inh@key@encoding{#1@inh}% +% \end{macrocode} +% For the rest, we can reuse the key setup from \cs{SetProtrusion} resp. +% \cs{SetExpansion}. +% \begin{macrocode} + \MT@define@code@key{family}{#1@inh}% + \MT@define@code@key{series}{#1@inh}% + \MT@define@code@key{shape}{#1@inh}% + \MT@define@code@key@size{#1@inh}% + \MT@define@code@key@font{#1@inh}% +} +\MT@define@inh@keys{pr} +\MT@define@inh@keys{ex} +%<*beta> +\MT@define@inh@keys{sp} +\MT@define@inh@keys{kn} +% +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@inh@do} +% Parse the second argument, the inheritance lists. We define the commands +% |\MT@inh@|\meta{name}|@|\meta{slot}|@|, containing the inheriting characters. +% They will also be translated to slot numbers here, to save some time. The +% following will be executed only once, namely the first time this inheritance +% list is encountered (in \cs{MT@set@pr@codes} resp. \cs{MT@set@ex@codes}). +% \begin{macrocode} +\def\MT@inh@do#1,{% + \ifx\relax#1\@empty \else + \MT@inh@split #1==\relax + \expandafter\MT@inh@do + \fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@inh@split} +% Only gather the inheriting characters here. Their codes will actually be set +% in |MT@set@|\meta{feature}|@codes|), +% \begin{macrocode} +\def\MT@inh@split#1=#2=#3\relax{% + \def\@tempa{#1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \let\MT@val\MT@char + \MT@map@clist@n{#2}{% + \def\@tempa{##1}% + \ifx\@tempa\@empty \else + \MT@get@slot + \ifnum\MT@char > \m@ne + \expandafter\MT@xadd + \csname MT@inh@\MT@inh@name @\MT@val @\endcsname + {{\MT@char}}% + \fi + \fi + }% +%<*debug> + \MT@dinfo@nl{2}{children of #1 (\MT@val): + \@nameuse{MT@inh@\MT@inh@name @\MT@val @}}% +% + \fi + \fi +} +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Permutation} +% +%\begin{macro}{\MT@permute} +%\changes{v1.1}{2004/09/15}{don't use sets for empty encoding} +%\begin{macro}{\MT@permute@} +%\begin{macro}{\MT@permute@@} +%\begin{macro}{\MT@permute@@@} +%\begin{macro}{\MT@permute@@@@} +%\begin{macro}{\MT@permute@@@@@} +% Calling \cs{MT@permute} will define commands for all permutations +% of the specified font characteristics of the form +% |\MT@|\meta{list type}|@/|\meta{encoding}|/|\meta{family}|/|^^A +% \meta{series}|/|\hskip0pt\meta{shape}|/|\meta{\textbar*} +% to be the expansion of |\MT@|\meta{list type}|@name|, \ie, the name of +% the currently defined list. Size ranges are held in a separate macro called +% |\MT@|\meta{list type}|@/|\meta{font axes}|@sizes|, which in turn contains +% the respective \meta{list name}s attached to the ranges. +% \begin{macrocode} +\def\MT@permute{% + \let\MT@cnt@encoding\@ne + \MT@permute@ +% \end{macrocode} +% Undefine commands for the next round. +% \begin{macrocode} + \MT@permute@reset +} +\def\MT@permute@{% + \let\MT@cnt@family\@ne + \MT@permute@@ + \MT@increment\MT@cnt@encoding + \MT@ifdefined@n{MT@tempencoding\romannumeral\MT@cnt@encoding}% + \MT@permute@ + \relax +} +\def\MT@permute@@{% + \let\MT@cnt@series\@ne + \MT@permute@@@ + \MT@increment\MT@cnt@family + \MT@ifdefined@n{MT@tempfamily\romannumeral\MT@cnt@family}% + \MT@permute@@ + \relax +} +\def\MT@permute@@@{% + \let\MT@cnt@shape\@ne + \MT@permute@@@@ + \MT@increment\MT@cnt@series + \MT@ifdefined@n{MT@tempseries\romannumeral\MT@cnt@series}% + \MT@permute@@@ + \relax +} +\def\MT@permute@@@@{% + \MT@permute@@@@@ + \MT@increment\MT@cnt@shape + \MT@ifdefined@n{MT@tempshape\romannumeral\MT@cnt@shape}% + \MT@permute@@@@ + \relax +} +\def\MT@permute@@@@@{% + \MT@permute@define{encoding}% + \MT@permute@define{family}% + \MT@permute@define{series}% + \MT@permute@define{shape}% + \edef\@tempa{\MT@tempencoding + /\MT@tempfamily + /\MT@tempseries + /\MT@tempshape + /\MT@ifdefined@c\MT@tempsize *\@empty}% +% \end{macrocode} +%\changes{v1.2}{2004/09/29}{more sanity checks for \cs{SetProtrusion} and +% \cs{SetExpansion}} +% Some sanity checks: An encoding must be specified (unless nothing else is). +% \begin{macrocode} + \def\@tempb{////}% + \ifx\@tempa\@tempb \else + \ifx\MT@tempencoding\@empty + \MT@warning{% + You have to specify an encoding for\MessageBreak + \@nameuse{MT@abbr@\MT@permutelist} list + `\@nameuse{MT@\MT@permutelist @name}'.\MessageBreak + Ignoring it}% + \else + \MT@ifdefined@c\MT@tempsize{% +% \end{macrocode} +% Add the list of ranges to the beginning of the current combination, after +% checking for conflicts. +%\changes{v1.8}{2005/04/20}{add ranges to the beginning of the lists} +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@permutelist @\@tempa\MT@extra@context @sizes}{% + \MT@map@tlist@c + \MT@tempsize + \MT@check@rlist + }\relax + \expandafter\MT@xaddb + \csname MT@\MT@permutelist @\@tempa\MT@extra@context @sizes\endcsname + \MT@tempsize +%<*debug> + \MT@dinfo@nl{1}{initializing: use list for font \@tempa,\MessageBreak + sizes: \csname MT@\MT@permutelist @\@tempa\MT@extra@context + @sizes\endcsname}% +% + }{% +% \end{macrocode} +% Only one list should apply to a given combination. +% \begin{macrocode} + \MT@ifdefined@n{MT@\MT@permutelist @\@tempa\MT@extra@context}{% + \MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list + `\@nameuse{MT@\MT@permutelist @name}' will override list\MessageBreak + `\@nameuse{MT@\MT@permutelist @\@tempa\MT@extra@context}' for font `\@tempa'}% + }\relax +%<*debug> + \MT@dinfo@nl{1}{initializing: use list for font \@tempa + \ifx\MT@extra@context\@empty\else\MessageBreak + (context: \MT@extra@context)\fi}% +% + }% + \global\MT@edef@n{MT@\MT@permutelist @\@tempa\MT@extra@context}% + {\csname MT@\MT@permutelist @name\endcsname}% + \fi + \fi +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@permute@define} +% Define the commands. +% \begin{macrocode} +\def\MT@permute@define#1{% + \expandafter\@tempcnta=\csname MT@cnt@#1\endcsname\relax + \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}% + {\MT@edef@n{MT@temp#1}{\csname MT@temp#1\romannumeral\@tempcnta\endcsname}}% + {\MT@let@nc{MT@temp#1}\@empty}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@permute@reset} +% Reset the commands. +% \begin{macrocode} +\def\MT@permute@reset{% + \MT@permute@reset@{encoding}% + \MT@permute@reset@{family}% + \MT@permute@reset@{series}% + \MT@permute@reset@{shape}% + \let\MT@tempsize\@undefined +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@permute@reset@} +% \begin{macrocode} +\def\MT@permute@reset@#1{% + \@tempcnta=\@ne + \MT@loop + \MT@let@nc{MT@temp#1\romannumeral\@tempcnta}\@undefined + \advance\@tempcnta\@ne + \MT@ifdefined@n{MT@temp#1\romannumeral\@tempcnta}% + \iftrue + \iffalse + \MT@repeat +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@check@rlist} +%\changes{v1.8}{2005/04/20}{made recursive} +% For every new range item in \cs{MT@tempsize}, check whether it overlaps with +% ranges in the existing list. +% \begin{macrocode} +\def\MT@check@rlist#1{% + \expandafter\MT@check@rlist@#1% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@check@rlist@} +% Define the current new range and \dots +% \begin{macrocode} +\def\MT@check@rlist@#1#2#3{% + \def\@tempb{#1}% + \def\@tempc{#2}% + \@tempswafalse + \expandafter\MT@map@tlist@c + \csname MT@\MT@permutelist @\@tempa\MT@extra@context @sizes\endcsname + \MT@check@range +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@check@range} +% \dots~recurse through the list of existing ranges. +% \begin{macrocode} +\def\MT@check@range#1{% + \expandafter\MT@check@range@#1% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@check@range@} +% \cmd{\@tempb} and \cmd{\@tempc} are lower resp. upper bound of the new range, +% \meta{\#2} and \meta{\#3} those of the existing range. +% \begin{macrocode} +\def\MT@check@range@#1#2#3{% + \MT@ifeq{#2}\m@ne{% + \MT@ifeq\@tempc\m@ne{% +% \end{macrocode} +%\begin{itemize} +% \item Both items are simple sizes. +% \begin{macrocode} + \MT@ifeq\@tempb{#1}\@tempswatrue\relax + }{% +% \end{macrocode} +% \item Item in list is a simple size, new item is a range. +% \begin{macrocode} + \MT@ifgt\@tempb{#1}\relax{% + \MT@ifgt\@tempc{#1}{% + \@tempswatrue + \edef\@tempb{#1 (with range: \@tempb\space to \@tempc)}% + }\relax + }% + }% + }{% + \MT@ifeq\@tempc\m@ne{% +% \end{macrocode} +% \item Item in list is a range, new item is a simple size. +% \begin{macrocode} + \MT@iflt\@tempb{#2}{% + \MT@iflt\@tempb{#1}\relax\@tempswatrue + }\relax + }{% +% \end{macrocode} +% \item Both items are ranges. +% \begin{macrocode} + \MT@iflt\@tempb{#2}{% + \MT@ifgt\@tempc{#1}{% + \@tempswatrue + \edef\@tempb{#1 to #2 (with range: \@tempb\space to \@tempc)}% + }\relax + }\relax + }% + }% + \if@tempswa + \MT@warning{\@nameuse{MT@abbr@\MT@permutelist} list + `\@nameuse{MT@\MT@permutelist @name}' will override\MessageBreak + list `#3' for font \@tempa,\MessageBreak size \@tempb}% +% \end{macrocode} +% If we've already found a conflict with this item, we can skip the rest of the +% list. +% \begin{macrocode} + \expandafter\MT@tlist@break + \fi +} +% \end{macrocode} +%\end{itemize} +%\end{macro} +% +%\subsection{User Command} +% +%\begin{macro}{\microtypesetup} +%\changes{v1.4}{2004/11/04}{bug fix: set the correct levels, and remember them; +% warning when enabling an option disabled in package options} +%\changes{v1.7}{2005/02/17}{bug fix: warning also when setting to \texttt{(no)compatibility}} +%\begin{macro}{\MT@define@optionX} +% This command may be used anywhere in the document. It accepts the options: +% |protrusion|, |expansion| and |activate|, and |spacing| and |kerning|. +% Specifying font sets is not allowed. +% \begin{macrocode} +\def\microtypesetup{\setkeys{MTX}} +\def\MT@define@optionX#1#2{% + \define@key{MTX}{#1}[true]{% + \KV@@sp@def\@tempb{#1}% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \edef\@tempb{\csname MT@rbba@\@tempb\endcsname}% + \MT@ifempty\MT@val\relax{% + \@tempcnta=\m@ne + \MT@ifstreq\MT@val{true}{% +% \end{macrocode} +% Enabling micro-typography in the middle of the document is not allowed if it +% has been disabled in the package options since fonts might already have been +% loaded and hence wouldn't be set up. +% \begin{macrocode} + \MT@checksetup\@tempb{% + \expandafter\@tempcnta=\csname MT@\@tempb @level\endcsname + \MT@info{Enabling #1 + (level \number\csname MT@\@tempb @level\endcsname)}% + }% + }{% + \MT@ifstreq\MT@val{false}{% + \@tempcnta=\z@ + \MT@info{Disabling #1}% + }{% + \MT@ifstreq\MT@val{compatibility}{% + \MT@checksetup\@tempb{% + \@tempcnta=\@ne + \MT@let@nc{MT@\@tempb @level}\@ne + \MT@info{Setting #1 to level 1}% + }% + }{% + \MT@ifstreq\MT@val{nocompatibility}{% + \MT@checksetup\@tempb{% + \@tempcnta=\tw@ + \MT@let@nc{MT@\@tempb @level}\tw@ + \MT@info{Setting #1 to level 2}% + }% + }{% + \MT@warning{% + Value `\MT@val' for key `#1' not recognized.\MessageBreak + Use any of `true', `false', `compatibility' or\MessageBreak + `nocompatibility'}% + }% + }% + }% + }% + \ifnum\@tempcnta>\m@ne + #2\@tempcnta\relax + \fi + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@checksetup} +% Test whether the feature wasn't disabled in the package options. +% \begin{macrocode} +\def\MT@checksetup#1{% + \expandafter\csname ifMT@\csname MT@abbr@#1\endcsname\endcsname + \expandafter\@firstofone + \else + \MT@warning{% + You cannot enable \@nameuse{MT@abbr@#1} if it was disabled\MessageBreak + in the package options,}% + \expandafter\@gobble + \fi +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@optionX{protrusion}\pdfprotrudechars +\MT@define@optionX{expansion}\pdfadjustspacing +%<*beta> +% \end{macrocode} +%\begin{macro}{\MT@define@optionX@} +% The same for |spacing| and |kerning|, which do not have a |nocompatibility| level. +% \begin{macrocode} +\def\MT@define@optionX@#1#2{% + \define@key{MTX}{#1}[true]{% + \KV@@sp@def\@tempb{#1}% + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \edef\@tempb{\csname MT@rbba@\@tempb\endcsname}% + \MT@ifempty\MT@val\relax{% + \@tempcnta=\m@ne + \MT@ifstreq\MT@val{true}{% + \MT@checksetup\@tempb{% + \@tempcnta=\@ne + \MT@info{Enabling #1}% + }% + }{% + \MT@ifstreq\MT@val{false}{% + \@tempcnta=\z@ + \MT@info{Disabling #1}% + }{% + \MT@warning{% + Value `\MT@val' for key `#1' not recognized.\MessageBreak + Use either `true' or `false'}% + }% + }% + \ifnum\@tempcnta>\m@ne + #2\relax + \fi + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta} +\MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta + \pdfappendkern \@tempcnta} +% +\define@key{MTX}{activate}[]{% + \setkeys{MTX}{protrusion={#1}}% + \setkeys{MTX}{expansion={#1}}% +} +% \end{macrocode} +%\begin{macro}{\microtypecontext} +%\changes{v1.9}{2005/10/03}{new macro: change setup context in the document} +% The user may now also change the context, so that different setups are +% possible. This is especially useful for multi-lingual documents. +% \begin{macrocode} +\def\microtypecontext#1{% + \setkeys{MTC}{#1}% + \edef\MT@curr@contexts{\MT@pr@context|% + \MT@ex@context|% + \MT@sp@context|% + \MT@kn@context}% +%\MT@dinfo{2}{>>> current context: \MT@curr@contexts}% +% \end{macrocode} +% Keep track of all contexts in the document. +% \begin{macrocode} + \MT@exp@one@n\MT@in@tlist\MT@curr@contexts\MT@doc@contexts + \ifMT@inlist@ \else + \MT@xadd\MT@doc@contexts{{\MT@curr@contexts}}% +%\MT@dinfo{2}{>>> document contexts: \MT@doc@contexts}% + \fi + \selectfont + \aftergroup\MT@reset@context +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@reset@context} +% We have to reset the font at the end of the group. +% \begin{macrocode} +\def\MT@reset@context{% + \MT@vinfo{Resetting contexts on line \the\inputlineno}% + \selectfont +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@define@context} +% \begin{macrocode} +\def\MT@define@context#1{% + \define@key{MTC}{#1}[]{% + \KV@@sp@def\@tempb{#1}% + \edef\@tempb{\@nameuse{MT@rbba@\@tempb}}% + \KV@@sp@def\MT@val{##1}% + \MT@vinfo{--- Changing #1 context to `\MT@val'}% + \MT@edef@n{MT@\@tempb @context}{\MT@val}% +% \end{macrocode} +% We have to reset \emph{all} factors the next time we see the font. +% \begin{macrocode} + \MT@ifempty\MT@val\relax{% + \global\MT@let@nn{MT@reset@\@tempb @codes}{MT@reset@\@tempb @codes@}% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@context{protrusion} +\MT@define@context{expansion} +%<*beta> +\MT@define@context{spacing} +\MT@define@context{kerning} +% +% \end{macrocode} +%\begin{macro}{\MT@pr@context} +%\begin{macro}{\MT@ex@context} +%\begin{macro}{\MT@sp@context} +%\begin{macro}{\MT@kn@context} +%\begin{macro}{\MT@curr@contexts} +%\begin{macro}{\MT@doc@contexts} +%\begin{macro}{\MT@extra@context} +% Initialize the contexts. +% \begin{macrocode} +\let\MT@pr@context\@empty +\let\MT@ex@context\@empty +%<*beta> +\let\MT@sp@context\@empty +\let\MT@kn@context\@empty +% +\def\MT@curr@contexts{|||} +\def\MT@doc@contexts{{|||}} +\let\MT@extra@context\@empty +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% \begin{macrocode} +% \end{macrocode} +% Disable everything -- may be used as a work-around in case setting up fonts +% doesn't work in certain environments. \emph{(Undocumented.)} +% \begin{macrocode} +\def\MT@gobblethree#1#2#3{} +\let\MT@saved@setupfont\MT@setupfont +\define@key{MTX}{disable}[]{% + \MT@info{Inactivate microtype package}% + \let\MT@setupfont\MT@gobblethree +} +\define@key{MTX}{enable}[]{% + \MT@info{Reactivate microtype package}% + \let\MT@setupfont\MT@saved@setupfont +} +% \end{macrocode} +% +%\subsection{Package Options} +% +%\subsubsection{Declaring the Options} +% +%\begin{macro}{\ifMT@opt@expansion}\IndexNewif{MT@opt@expansion} +%\begin{macro}{\ifMT@opt@auto}\IndexNewif{MT@opt@auto} +% Keep track of whether the user explicitly set these options. +% \begin{macrocode} +\newif\ifMT@opt@expansion +\newif\ifMT@opt@auto +% \end{macrocode} +%\end{macro} +%\end{macro} +%\begin{macro}{\MT@define@option} +% \opt{expansion} and \opt{protrusion} may be |true|, |false|, |compatibility|, +% |nocompatibility| and/or a \meta{set name}. +%\changes{v1.9}{2005/10/06}{fix: use \texttt{true} as the default value} +% \begin{macrocode} +\def\MT@define@option#1{% + \define@key{MT}{#1}[true]{% + \csname MT@opt@#1true\endcsname + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \MT@ifempty\MT@val\relax{% + \csname MT@#1true\endcsname + \edef\@tempb{\csname MT@rbba@#1\endcsname}% + \MT@ifstreq\MT@val{true}\relax + {% + \MT@ifstreq\MT@val{false}{% + \csname MT@#1false\endcsname + }{% + \MT@ifstreq\MT@val{compatibility}{% + \MT@let@nc{MT@\@tempb @level}\@ne + }{% + \MT@ifstreq\MT@val{nocompatibility}{% + \MT@let@nc{MT@\@tempb @level}\tw@ + }{% +% \end{macrocode} +% If everything failed, it should be a set name. +% \begin{macrocode} + \MT@ifdefined@n{MT@\@tempb @set@@\MT@val}{% + \global\MT@edef@n{MT@\@tempb @setname}{\MT@val}% + }{% + \global\MT@edef@n{MT@\@tempb @setname}% + {\@nameuse{MT@default@\@tempb @set}}% + \MT@warning@nl{% + The #1 set `\MT@val' is undeclared.\MessageBreak + Using set `\@nameuse{MT@\@tempb @setname}' instead}% + }% + }% + }% + }% + }% + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@option{protrusion} +\MT@define@option{expansion} +% \end{macrocode} +% \opt{activate} is a shortcut for \opt{protrusion} and \opt{expansion} (and +% \opt{spacing}?). +%\todo{add spacing to activate, when the feature has stabilized in \pdftex} +% \begin{macrocode} +\define@key{MT}{activate}[]{% + \setkeys{MT}{protrusion={#1}}% + \setkeys{MT}{expansion={#1}}% +} +%<*beta> +% \end{macrocode} +%\begin{macro}{\MT@define@option@} +% \begin{macrocode} +\def\MT@define@option@#1{% + \define@key{MT}{#1}[true]{% + \csname MT@opt@#1true\endcsname + \MT@map@clist@n{##1}{% + \KV@@sp@def\MT@val{####1}% + \MT@ifempty\MT@val\relax{% + \csname MT@#1true\endcsname + \edef\@tempb{\csname MT@rbba@#1\endcsname}% + \MT@ifstreq\MT@val{true}\relax + {% + \MT@ifstreq\MT@val{false}{% + \csname MT@#1false\endcsname + }{% + \MT@ifdefined@n{MT@\@tempb @set@@\MT@val}{% + \global\MT@edef@n{MT@\@tempb @setname}{\MT@val}% + }{% + \global\MT@edef@n{MT@\@tempb @setname}% + {\@nameuse{MT@default@\@tempb @set}}% + \MT@warning@nl{% + The #1 set `\MT@val' is undeclared.\MessageBreak + Using set `\@nameuse{MT@\@tempb @setname}' instead}% + }% + }% + }% + }% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@define@option@{spacing} +\MT@define@option@{kerning} +% +% \end{macrocode} +%\changes{v1.5}{2004/12/02}{new option: \opt{selected}, by default false +% (suggested by \thanh)} ^^A +% ^^A private mail, 30/11/2004 +%\changes{v2.0}{2005/10/04}{new option: \opt{babel}, by default false +% (language-dependant setup suggested by Ulrich Dirr)} +% ^^A +%\begin{macro}{\MT@def@bool@opt} +% The |true|/|false| options: +% \opt{draft} (may be inherited from the class options), +% \opt{DVIoutput}, +% \opt{auto}, +% \opt{selected}, +% \opt{babel}. +% \begin{macrocode} +\def\MT@def@bool@opt#1{% + \define@key{MT}{#1}[]{% + \MT@ifempty{##1}% + {\def\@tempa{true}}% + {\def\@tempa{##1}}% + \MT@ifstreq\@tempa{true}\relax{% + \MT@ifstreq\@tempa{false}\relax{% + \MT@warning@nl{% + `##1' is not an admissible value for option\MessageBreak + `#1'. Assuming `false'}% + \def\@tempa{false}% + }% + }% + \csname MT@#1\@tempa\endcsname + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@map@tlist@n{{draft}{DVIoutput}{auto}{selected}% +%{babel}% +}\MT@def@bool@opt +% \end{macrocode} +% \opt{final} is the opposite to \opt{draft}. +%\changes{v1.4a}{2004/11/16}{new option: \opt{final}} +% \begin{macrocode} +\define@key{MT}{final}[]{% + \MT@draftfalse + \MT@ifempty{#1}% + {\def\@tempa{true}}% + {\def\@tempa{#1}}% + \MT@ifstreq\@tempa{true}\relax{% + \MT@ifstreq\@tempa{false}% + \MT@drafttrue + {% + \MT@warning@nl{% + `#1' is not an admissible value for option\MessageBreak + `final'. Assuming `true'}% + \MT@draftfalse + }% + }% +} +% \end{macrocode} +% For \opt{verbose} output, we simply redefine \cs{MT@vinfo}. +% \begin{macrocode} +\define@key{MT}{verbose}[]{% + \let\MT@vinfo\MT@info@nl + \MT@ifempty{#1}% + {\def\@tempa{true}}% + {\def\@tempa{#1}}% + \MT@ifstreq\@tempa{true}\relax{% +% \end{macrocode} +%\changes{v1.7}{2005/03/16}{new value for \opt{verbose} option: \texttt{errors}} +% Take problems seriously. +% \begin{macrocode} + \MT@ifstreq\@tempa{errors}{% + \let\MT@warning\MT@warn@err + \let\MT@warning@nl\MT@warn@err + }{% + \let\MT@vinfo\@gobble + \MT@ifstreq\@tempa{false}\relax{% + \MT@warning@nl{% + `#1' is not an admissible value for option\MessageBreak + `verbose'. Assuming `false'}% + }% + }% + }% +} +% \end{macrocode} +%\changes{v1.5}{2004/12/02}{defaults: \opt{step}: 4 +% (suggested by \thanh)} ^^A +% ^^A private mail, 30/11/2004 +%\changes{v1.6}{2004/12/18}{new option: \opt{factor}, by default 1000} +%\changes{v2.0}{2005/09/21}{new option: \opt{letterspacing}, by default 100} +%\begin{macro}{\MT@def@num@opt} +% Options with numerical keys: +% \opt{factor}, +% \opt{stretch}, +% \opt{shrink}, +% \opt{step}, +% \opt{letterspacing}. +% \begin{macrocode} +\def\MT@def@num@opt#1{% + \define@key{MT}{#1}[]{% + \MT@ifempty{##1}% + {\MT@let@cn\@tempa{MT@#1@default}}% + {\def\@tempa{##1 }}% +% \end{macrocode} +% No nonsense in \cs{MT@factor} et al.? +%\changes{v1.6}{2005/01/06}{test whether numeric options receive a number} +% A space terminates the number. +% \begin{macrocode} + \MT@ifnumber\@tempa{% + \MT@edef@n{MT@#1}{\@tempa}% + }{\MT@warning@nl{% + Value `##1' for option `#1' is not a number.\MessageBreak + Using default value of \number\@nameuse{MT@#1@default}}% + }% + }% +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@map@tlist@n{{stretch}{shrink}{step}% +%{letterspacing}% +}\MT@def@num@opt +% \end{macrocode} +% \opt{factor} will define the protrusion factor only. +%\todo{factor option for which extensions?} +% \begin{macrocode} +\define@key{MT}{factor}[]{% + \MT@ifempty{#1}% + {\let\@tempa\MT@factor@default}% + {\def\@tempa{#1 }}% + \MT@ifnumber\@tempa{% + \MT@edef@n{MT@pr@factor}{\@tempa}% + }{\MT@warning@nl{% + Value `#1' for option `factor' is not a number.\MessageBreak + Using default value of \number\MT@factor@default}% + }% +} +% \end{macrocode} +% Unit for codes. +%\changes{v1.8}{2005/04/14}{new option: \opt{unit}, by default \texttt{character}} +%\changes{v1.9}{2005/09/28}{option \opt{unit}: rename value \texttt{relative} to \texttt{character}} +% \begin{macrocode} +\define@key{MT}{unit}[]{% + \MT@ifempty{#1}% + {\def\@tempa{character}}% + {\KV@@sp@def\@tempa{#1}}% + \MT@ifstreq\@tempa{relative}{% + \MT@warning{Value `relative' for option `unit' is deprecated.\MessageBreak + Use `unit=character' instead. For now, I'll do it\MessageBreak + for you}% + \def\@tempa{character}% + }\relax + \MT@ifstreq\@tempa{character}\relax{% + \MT@ifdimen\@tempa{% + \let\MT@pr@unit\@tempa + }{% + \MT@warning@nl{`\@tempa' is not a dimension. Ignoring it and\MessageBreak + setting values relative to character widths}% + }% + }% +} +% \end{macrocode} +% The package should just work if called without any options. Therefore, +% expansion will be switched off by default if output is \dvi, since it isn't +% likely that expanded fonts are available. (This grows more important as \TeX\ +% systems are switching to the \pdftex\ engine even for \dvi\ output, so that +% the user might not even be aware of the fact that she's running \pdftex.) +% \begin{macrocode} +\MT@protrusiontrue +\ifnum\pdfoutput=\z@ \else +% \end{macrocode} +% Also, we only enable expansion by default if \pdftex\ can expand the fonts +% automatically. +%\changes{v1.6}{2004/12/23}{defaults: turn off expansion for old \pdftex\ versions} +%\todo{should spacing be enabled by default?} +% \begin{macrocode} + \ifnum\MT@pdftex@no > \thr@@ + \MT@expansiontrue + \MT@autotrue + \fi +\fi +% \end{macrocode} +% The main configuration file will be loaded before processing the package +% options. +%\changes{v1.8}{2005/05/15}{new option: \opt{config} to load a different main +% configuration file} +%\begin{macro}{\MT@config@file} +%\begin{macro}{\MT@get@config} +% However, the \opt{config} option must of course be evaluated beforehand. +% We also have to define a no-op for the regular option processing later. +% \begin{macrocode} +\define@key{MT}{config}[]{\relax} +\def\MT@get@config#1config=#2,#3\@nil{% + \MT@ifempty{#2}% + {\def\MT@config@file{microtype.cfg}}% + {\KV@@sp@def\MT@config@file{#2.cfg}}% +} +\expandafter\expandafter\expandafter\MT@get@config + \csname opt@\@currname.\@currext\endcsname,config=,\@nil +% \end{macrocode} +%\end{macro} +%\end{macro} +%\changes{v1.4b}{2004/11/25}{bug fix: set catcodes before reading global configuration file +% (reported by Christoph Bier)} ^^A +% ^^A in: +% Load the file. +% \begin{macrocode} +\IfFileExists{\MT@config@file}{% + \MT@info@nl{Loading configuration file \MT@config@file}% + \MT@begin@catcodes + \let\MT@begin@catcodes\relax + \let\MT@end@catcodes\relax + \input{\MT@config@file}% + \endgroup +}{% + \MT@warning@nl{% + Could not find configuration file `\MT@config@file'!\MessageBreak + This will almost certainly cause undesired results.\MessageBreak + Please fix your installation}% +} +% \end{macrocode} +% If no default font set has been declared in the main configuration file, +% we use the (empty, possibly non-existent) `|all|' set. +%\changes{v1.9}{2005/08/05}{disable \cs{DeclareMicrotypeSetDefault} after +% configuration file has been loaded} +% We also disable the command. +% \begin{macrocode} +\MT@ifdefined@c\MT@default@pr@set\relax{\gdef\MT@default@pr@set{all}} +\MT@ifdefined@c\MT@default@ex@set\relax{\gdef\MT@default@ex@set{all}} +%<*beta> +\MT@ifdefined@c\MT@default@sp@set\relax{\gdef\MT@default@sp@set{all}} +\MT@ifdefined@c\MT@default@kn@set\relax{\gdef\MT@default@kn@set{all}} +% +\renewcommand*\DeclareMicrotypeSetDefault[2][]{% + \MT@warning{% + The command \string\DeclareMicrotypeSetDefault\space may only\MessageBreak + be used inside the main configuration file.\MessageBreak + Ignoring it}% +} +% \end{macrocode} +% +% +%\subsubsection{Hook for Other Packages}\label{sub:hook} +% +%\makeatletter +% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar usage}} +%\makeatother +%\begin{macro}{\Microtype@Hook} +%\changes{v1.7}{2005/03/22}{new macro for font package authors} +% This hook may be used by font package authors, \eg\ to declare alias fonts. If +% it is defined, it will be executed here, \ie, after the main configuration +% file has been loaded, and before the package options are evaluated. +% +% This hook overcomes the situation that (1) the \microtype\ package should be +% loaded after all font defaults have been set up (hence, using +% \cmd{\@ifpackageloaded} in the font package is not viable), and (2) checking +% \cmd{\AtBeginDocument} can be too late, since fonts might already have been +% loaded, and consequently set up, in the preamble. +% +% Package authors should check whether the command is already defined so that +% existing definitions by other packages aren't overwritten. Example: +%\begin{verbatim} +%\def\MinionPro@MT@Hook +% {\DeclareMicrotypeAlias{MinionPro-LF}{MinionPro}} +%\@ifundefined{Microtype@Hook} +% {\let\Microtype@Hook\MinionPro@MT@Hook} +% {\g@addto@macro\Microtype@Hook{\MinionPro@MT@Hook}} +%\end{verbatim} +% \cs{MicroType@Hook} with a capital |T| is provided for compatibility reasons. +% At some point in the future, it will no longer be available, hence it should +% not be used. +% \begin{macrocode} +\MT@ifdefined@c\MicroType@Hook{% + \MT@warning@nl{% + Command \string\MicroType@Hook\space is deprecated.\MessageBreak + Use \string\Microtype@Hook\space instead}\MicroType@Hook}\relax +\MT@ifdefined@c\Microtype@Hook\Microtype@Hook\relax +% \end{macrocode} +%\end{macro} +% +%\subsubsection{Processing the Options} +% +%\begin{macro}{\MT@ProcessOptionsWithKV} +% Parse options. +% \begin{macrocode} +\def\MT@ProcessOptionsWithKV#1{% + \let\@tempc\relax + \let\KVo@tempa\@empty + \MT@map@clist@c\@classoptionslist{% + \def\CurrentOption{##1}% + \MT@ifdefined@n{KV@#1@\CurrentOption}{% + \edef\KVo@tempa{\KVo@tempa,\CurrentOption,}% + \@expandtwoargs\@removeelement\CurrentOption + \@unusedoptionlist\@unusedoptionlist + }\relax + }% + \edef\KVo@tempa{% + \noexpand\setkeys{#1}{% + \KVo@tempa\@ptionlist{\@currname.\@currext}% + }% + }% + \KVo@tempa + \AtEndOfPackage{\let\@unprocessedoptions\relax}% + \let\CurrentOption\@empty +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\MT@ProcessOptionsWithKV{MT} +% \end{macrocode} +% Now we can take the appropriate actions: +% +% \pdftex\ can create \dvi\ output, too. However, both the \dvi\ viewer and +% dvips need to find actual fonts. Therefore, expansion will only work if the +% fonts for different degrees of expansion are readily available. +% +%\changes{v1.4b}{2004/11/19}{new message if \cmd{\pdfoutput} is changed} +% Some packages depend on the value of \cmd{\pdfoutput} and will get confused if +% it is changed after they have been loaded. These packages are, among others: +% \pkg{color}, \pkg{graphics}, \pkg{hyperref}, \pkg{crop}, \pkg{contour}, +% \pkg{pstricks} and, as a matter of course, \pkg{ifpdf}. Instead of testing +% for each package (that's not our job), we issue a different message if +% \cmd{\pdfoutput} is actually changed by \opt{DVIoutput}. That must be +% sufficient! +% \begin{macrocode} +\ifMT@DVIoutput + \ifnum\pdfoutput=\z@ + \MT@info@nl{Generating DVI output} + \else + \pdfoutput\z@ + \MT@info@nl{Changing output mode to DVI} +% \end{macrocode} +% For \dvi\ output, the user must have explicitly passed the \opt{expansion} option +% to the package. +%\changes{v1.5}{2004/12/02}{defaults: turn off expansion for \dvi\ output} +% \begin{macrocode} + \ifMT@opt@expansion \else + \MT@expansionfalse + \fi + \fi +\else + \MT@info@nl{Generating \ifnum\pdfoutput=\z@ DVI \else PDF \fi output} +\fi +% \end{macrocode} +% Tell the log file which options the user has chosen (in case it's interested). +% We disable most of what we've just defined in the \arabic{CodelineNo} lines +% above if we are running in draft mode. +%\changes{v1.7}{2005/02/06}{warning when running in draft mode} +% \begin{macrocode} +\ifMT@draft + \MT@warning@nl{`draft' option active.\MessageBreak + Disabling all micro-typographic extensions.\MessageBreak + This might lead to different line and page breaks} + \MT@protrusionfalse + \MT@expansionfalse +%<*beta> + \MT@spacingfalse + \MT@kerningfalse +% + \let\MT@setupfont\relax + \def\DeclareMicrotypeSet{% + \@ifstar + {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}% + {\@ifnextchar[\MT@DeclareSet{\MT@DeclareSet[]}}% + } + \def\MT@DeclareSet[#1]#2#3{} + \renewcommand*\UseMicrotypeSet[2][]{} + \renewcommand*\SetProtrusion[3][]{} + \renewcommand*\SetExpansion[3][]{} +%<*beta> + \renewcommand*\SetExtraSpacing[3][]{} + \renewcommand*\SetExtraKerning[3][]{} +% + \renewcommand*\DeclareCharacterInheritance[3][]{} + \renewcommand*\DeclareMicrotypeAlias[2]{} + \renewcommand*\LoadMicrotypeFile[1]{} + \renewcommand*\microtypesetup[1]{} + \renewcommand*\microtypecontext[1]{} + \expandafter + \endinput +\fi +\ifMT@protrusion + \pdfprotrudechars\MT@pr@level + \MT@info@nl{Character protrusion enabled (level \number\MT@pr@level)% + \ifnum\MT@pr@factor=\MT@factor@default \else,\MessageBreak + factor: \number\MT@pr@factor\fi + \ifx\MT@pr@unit\@empty \else,\MessageBreak unit: \MT@pr@unit\fi} +% \end{macrocode} +% We have to make sure that font sets are active at the end of the package. If +% the user didn't activate any in the package options, we use those sets declared +% by \cs{DeclareMicrotypeSetDefault}. They can still be overridden later on, of +% course. +% \begin{macrocode} + \MT@ifdefined@c\MT@pr@setname{% + \MT@info@nl{Using protrusion set `\MT@pr@setname'}% + }{% + \global\let\MT@pr@setname\MT@default@pr@set + \MT@info@nl{Using default protrusion set `\MT@pr@setname'}% + } +\else + \let\MT@protrusion\relax + \MT@info@nl{No character protrusion} +\fi +\ifMT@expansion +% \end{macrocode} +% Set up the values for font expansion: If \opt{stretch} has not been specified, we +% take the default value of 20. +% \begin{macrocode} + \ifnum\MT@stretch=\m@ne + \let\MT@stretch\MT@stretch@default + \fi +% \end{macrocode} +% If \opt{shrink} has not been specified, it will inherit the value from \opt{stretch}. +% \begin{macrocode} + \ifnum\MT@shrink=\m@ne + \ifnum\MT@stretch>\z@ + \let\MT@shrink\MT@stretch + \else + \let\MT@shrink\MT@shrink@default + \fi + \fi +% \end{macrocode} +% If \opt{step} has not been specified, we will set it to min(\opt{stretch},\opt{shrink})/5, +% rounded off, minimum value 1. +%\changes{v1.5}{2004/12/02}{defaults: calculate \opt{step} as +% min(\texttt{stretch},\texttt{shrink})/5} +%\changes{v1.9}{2005/07/08}{warning if user requested zero \opt{step}} +% \begin{macrocode} + \ifnum\MT@step=\m@ne + \ifnum\MT@stretch>\MT@shrink + \ifnum\MT@shrink=\z@ + \@tempcnta=\MT@stretch + \else + \@tempcnta=\MT@shrink + \fi + \else + \ifnum\MT@stretch=\z@ + \@tempcnta=\MT@shrink + \else + \@tempcnta=\MT@stretch + \fi + \fi + \divide\@tempcnta 5\relax + \else + \@tempcnta=\MT@step + \ifnum\@tempcnta=\z@ + \MT@warning@nl{The expansion step cannot be set to zero.\MessageBreak + Setting it to one} + \fi + \fi + \ifnum\@tempcnta=\z@ \@tempcnta=\@ne \fi + \edef\MT@step{\number\@tempcnta\space} +% \end{macrocode} +%\begin{macro}{\MT@auto} +% Automatic expansion of the font? This new feature of \pdftex\ 1.20 makes the +% \textit{hz}-algorithm really usable. It must be either `|autoexpand|' or +% empty (or `|1000|' for older versions of \pdftex). +% \begin{macrocode} + \let\MT@auto\@empty + \ifMT@auto + \ifnum\MT@pdftex@no > \thr@@ +% \end{macrocode} +%\end{macro} +% We turn off automatic expansion if output mode is \dvi. +%\changes{v1.5}{2004/12/02}{disable automatic expansion for \dvi\ output} +% \begin{macrocode} + \ifnum\pdfoutput=\z@ + \ifMT@opt@auto + \MT@warning@nl{% + Automatic font expansion only works for PDF output.\MessageBreak + However, you are creating a DVI file. I will switch\MessageBreak + automatic font expansion off and hope that expanded\MessageBreak + fonts are available} + \fi + \MT@autofalse + \else + \def\MT@auto{autoexpand} + \fi +% \end{macrocode} +% Also, if \pdftex\ is too old. +%\changes{v1.1}{2004/09/13}{issue an error instead of a warning, when \pdftex\ +% version is too old for \texttt{autoexpand}} +%\changes{v1.6}{2004/12/23}{disable automatic expansion for old \pdftex\ versions} +% \begin{macrocode} + \else + \ifMT@opt@auto + \MT@warning@nl{% + The pdftex you are using is too old for automatic\MessageBreak + font expansion. I will switch it off and hope that\MessageBreak + expanded fonts are available on your system.\MessageBreak + Install pdftex version 1.20 or newer} + \fi + \MT@autofalse + \def\MT@auto{1000 } + \fi +% \end{macrocode} +% No automatic expansion. +% \begin{macrocode} + \else + \ifnum\MT@pdftex@no < 4 + \def\MT@auto{1000 } + \fi + \fi +% \end{macrocode} +% Choose the appropriate macro for selected expansion. +% \begin{macrocode} + \ifMT@selected + \let\MT@set@ex@codes\MT@set@ex@codes@s + \else + \let\MT@set@ex@codes\MT@set@ex@codes@n + \fi +% \end{macrocode} +% Filter out |stretch=0,shrink=0|, since it would result in an \pdftex\ error. +%\changes{v1.9}{2005/07/08}{disable expansion if both \opt{step} and \opt{shrink} are zero} +% \begin{macrocode} + \ifnum\MT@stretch=\z@ + \ifnum\MT@shrink=\z@ + \MT@warning@nl{% + Both the stretch and shrink limit are set to zero.\MessageBreak + Disabling font expansion} + \MT@expansionfalse + \fi + \fi +\fi +\ifMT@expansion + \pdfadjustspacing\MT@ex@level + \MT@info@nl{\ifMT@auto Automatic f\else F\fi ont expansion enabled + (level \number\MT@ex@level),\MessageBreak + stretch: \number\MT@stretch, shrink: \number\MT@shrink, + step: \number\MT@step, \ifMT@selected\else non-\fi selected} + \MT@ifdefined@c\MT@ex@setname{% + \MT@info@nl{Using expansion set `\MT@ex@setname'}% + }{% + \global\let\MT@ex@setname\MT@default@ex@set + \MT@info@nl{Using default expansion set `\MT@ex@setname'}% + } +% \end{macrocode} +%\changes{v1.7}{2005/03/02}{modify \cmd{\showhyphens}} +% Inside \cmd{\showhyphens}, font expansion should be disabled. +% \begin{macrocode} + \CheckCommand*{\showhyphens}[1]{% + \setbox0\vbox{\color@begingroup\everypar{}\parfillskip\z@skip + \hsize\maxdimen\normalfont\pretolerance\m@ne\tolerance\m@ne + \hbadness\z@\showboxdepth\z@\ #1\color@endgroup}} +% \end{macrocode} +%\begin{macro}{\showhyphens} +% I wonder why it's defined globally (in \file{ltfssbas.dtx})? +% \begin{macrocode} + \gdef\showhyphens#1{% + \setbox0\vbox{% + \color@begingroup + \pdfadjustspacing\z@ + \everypar{}% + \parfillskip\z@skip\hsize\maxdimen + \normalfont + \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1% + \color@endgroup}} +\else + \let\MT@expansion\relax + \MT@info@nl{No font expansion} +\fi +%<*beta> +\ifnum\MT@pdftex@no > 5 + \ifMT@spacing + \pdfadjustinterwordglue\@ne +% \end{macrocode} +% Warning if \cmd{\nonfrenchspacing} is active, since space factors will be +% ignored with \cmd{\pdfadjustinterwordglue}\,|>|\,0. Why 1500? Because some +% packages redefine \cmd{\frenchspacing}. See the |c.t.t| thread `\cmd{\frenchspacing} +% with AMS packages and babel', started by this message from Philipp Lehman: +% \nolinkurl{} on August 16, 2005. +% \begin{macrocode} + \AtBeginDocument{% + \ifnum\sfcode`\. > 1500 + \MT@ifstreq\MT@sp@context{nonfrench}\relax{% + \MT@warning@nl{% + \string\nonfrenchspacing\space is active. Adjustment of\MessageBreak + interword spacing will disable it. You might want\MessageBreak + to add `\string\microtypecontext{spacing=nonfrench}'\MessageBreak + to your preamble}% + }% + \fi + } + \MT@info@nl{Adjustment of interword spacing enabled} + \MT@ifdefined@c\MT@sp@setname{% + \MT@info@nl{Using spacing set `\MT@sp@setname'}% + }{% + \global\let\MT@sp@setname\MT@default@sp@set + \MT@info@nl{Using default spacing set `\MT@sp@setname'}% + } + \else + \let\MT@spacing\relax + \MT@info@nl{No adjustment of interword spacing} + \fi + \ifMT@kerning + \pdfprependkern\@ne + \pdfappendkern\@ne + \MT@info@nl{Adjustment of character kerning enabled} + \MT@ifdefined@c\MT@kn@setname{% + \MT@info@nl{Using kerning set `\MT@kn@setname'}% + }{% + \global\let\MT@kn@setname\MT@default@kn@set + \MT@info@nl{Using default kerning set `\MT@kn@setname'}% + } + \else +% \end{macrocode} +% We do \emph{not} set \cs{MT@kerning} to \cmd{\relax} since it is also used by +% \cs{textls}. +% \begin{macrocode} + \MT@info@nl{No adjustment of character kerning} + \fi + \ifnum\MT@letterspacing=\m@ne + \let\MT@letterspacing\MT@letterspacing@default + \fi +% \end{macrocode} +% If \pdftex\ is too old, we disable everything. +% \begin{macrocode} +\else + \ifMT@spacing + \MT@warning@nl{Adjustment of interword spacing only works with\MessageBreak + pdftex version 1.3x or newer. Switching it off}% + \else + \MT@info@nl{No adjustment of interword spacing} + \fi + \MT@spacingfalse + \let\MT@spacing\relax + \ifMT@kerning + \MT@warning@nl{Character kerning only works with\MessageBreak + pdftex version 1.3x or newer. Switching it off}% + \else + \MT@info@nl{No adjustment of character kerning} + \fi + \MT@kerningfalse + \let\MT@kerning\relax +\fi +% \end{macrocode} +% Interaction with \pkg{babel}. We hook into the language switching commands +% to enable language-dependent setup. +% \begin{macrocode} +\ifMT@babel + \MT@info@nl{Redefining babel's language switching commands} + \let\MT@orig@select@language\select@language + \def\select@language#1{% + \MT@orig@select@language{#1}% + \MT@ifdefined@n{MT@babel@#1}{% + \MT@vinfo{Changing to language `#1' on line \the\inputlineno}% + \expandafter\MT@exp@one@n\expandafter\microtypecontext + \csname MT@babel@#1\endcsname + }{% + \microtypecontext{protrusion=,expansion=,spacing=,kerning=}% + }% + } + \let\MT@orig@foreign@language\foreign@language + \def\foreign@language#1{% + \MT@orig@foreign@language{#1}% + \MT@ifdefined@n{MT@babel@#1}{% + \MT@vinfo{Changing to context `#1' on line \the\inputlineno}% + \expandafter\MT@exp@one@n\expandafter\microtypecontext + \csname MT@babel@#1\endcsname + }{% + \microtypecontext{protrusion=,expansion=,spacing=,kerning=}% + }% + } +% \end{macrocode} +% Disable \pkg{babel}s active characters. +% \begin{macrocode} + \ifMT@kerning + \AtBeginDocument{% + \@ifpackageloaded{babel}{% + \@tempswafalse + \@ifpackagewith{babel}{french}\@tempswatrue\relax + \@ifpackagewith{babel}{frenchb}\@tempswatrue\relax + \@ifpackagewith{babel}{francais}\@tempswatrue\relax + \if@tempswa + \NoAutoSpaceBeforeFDP + \MT@warning@nl{Switching off French babel's active punctuation characters}% + \fi + }{}% + }% + \fi +\fi +% +% +% \end{macrocode} +%\end{macro} +% That was that. +% +% ^^A ------------------------------------------------------------------------- +% ^^A From now on, don't bother indexing: +%\NoIndexing +% +%\section{Configuration Files} +%\changes{v1.6}{2005/01/24}{restructure \file{dtx} file} +% +% Let's now write the font configuration files. +% \begin{macrocode} +%<*config> + +% \end{macrocode} +% The following characters must not appear verbatim: +% +%\begin{tabular}{l@{\quad:\quad}l} +% |\| & \cmd{\textbackslash}\\ +% |{| & \cmd{\textbraceleft}\\ +% |}| & \cmd{\textbraceright}\\ +% |^| & \cmd{\textasciicircum}\\ +% |%| & \cs{\%}\\ +% |#| & \cs{\#} +%\end{tabular} +% +%\noindent +% Comma and equal sign must be guarded with braces (`|{,}|', `|{=}|'). +% Of course, numerical identification is possible in any case. +% Ligatures and \cmd{\mathchardef}ed symbols always have to be specified +% numerically. +% +%\changes{v1.1}{2004/09/14}{remove 8-bit characters from the configuration files +% (suggested by Harald Harders)} +% +%\subsection{Character Inheritance} +%\GeneralChanges{Inheritance} +% +% First the lists of inheriting characters. We only declare those characters +% that are the same on \emph{both} sides, \ie, not \OE\ for O. +% \begin{macrocode} +%<*m-t> +%%% ---------------------------------------------------------------------- +%%% CHARACTER INHERITANCE + +% \end{macrocode} +% +%\subsubsection{\otI} +% Glyphs that should possibly inherit settings on one side only: +% |012|~(`fi' ligature), |013|~(`fl'), |014|~(`ffi'), |015|~(`ffl'), +% \AE, \ae, \OE, \oe. +% \begin{macrocode} +\DeclareCharacterInheritance + { encoding = OT1 } + { f = {011}, % ff + i = {\i}, + j = {\j}, + O = {\O}, + o = {\o}, + } + +% \end{macrocode} +% +%\subsubsection{\tI} +% Candidates here: |028|~(`fi'), |029|~(`fl'), |030|~(`ffi'), |031|~(`ffl'), +% |156| (`IJ'~ligature), |188|~(`ij'), \AE, \ae, \OE, \oe. +%\changes{v1.5}{2004/12/11}{remove \cmd{\ss} from \tI\ list, add \cmd{\DJ}} +%\changes{v1.8}{2005/04/26}{remove \cmd{\DJ} from \tI\ list (it's the same as \cmd{\DH})} +% \begin{macrocode} +\DeclareCharacterInheritance + { encoding = T1 } + { A = {\`A,\'A,\^A,\~A,\"A,\r{A},\k{A},\u{A}}, + a = {\`a,\'a,\^a,\~a,\"a,\r{a},\k{a},\u{a}}, + C = {\'C,\c{C},\v{C}}, + c = {\'c,\c{c},\v{c}}, + D = {\v{D},\DH}, + d = {\v{d},\dj}, + E = {\`E,\'E,\^E,\"E,\k{E},\v{E}}, + e = {\`e,\'e,\^e,\"e,\k{e},\v{e}}, + f = {027}, % ff + G = {\u{G}}, + g = {\u{g}}, + I = {\`I,\'I,\^I,\"I,\.I}, + i = {\`i,\'i,\^i,\"i,\i}, + j = {\j}, + L = {\L,\'L,\v{L}}, + l = {\l,\'l,\v{l}}, + N = {\'N,\~N,\v{N}}, + n = {\'n,\~n,\v{n}}, + O = {\O,\`O,\'O,\^O,\~O,\"O,\H{O}}, + o = {\o,\`o,\'o,\^o,\~o,\"o,\H{o}}, + R = {\'R,\v{R}}, + r = {\'r,\v{r}}, + S = {\'S,\c{S},\v{S},\SS}, + s = {\'s,\c{s},\v{s}}, + T = {\c{T},\v{T}}, + t = {\c{t},\v{t}}, + U = {\`U,\'U,\^U,\"U,\H{U},\r{U}}, + u = {\`u,\'u,\^u,\"u,\H{u},\r{u}}, + Y = {\'Y,\"Y}, + y = {\'y,\"y}, + Z = {\'Z,\.Z,\v{Z}}, + z = {\'z,\.z,\v{z}}, + - = {127}, + } + +% \end{macrocode} +% +%\subsubsection{\lyI} +% More characters: |008|~(`fl'), |012|~(`fi'), |014|~(`ffi'), |015|~(`ffl'), +% \AE, \ae, \OE, \oe. +% \begin{macrocode} +\DeclareCharacterInheritance + { encoding = LY1 } + { A = {\`A,\'A,\^A,\~A,\"A,\r{A}}, + a = {\`a,\'a,\^a,\~a,\"a,\r{a}}, + C = {\c{C}}, + c = {\c{c}}, + D = {\DH}, + E = {\`E,\'E,\^E,\"E}, + e = {\`e,\'e,\^e,\"e}, + f = {011}, % ff + I = {\`I,\'I,\^I,\"I}, + i = {\`i,\'i,\^i,\"i,\i}, + L = {\L}, + l = {\l}, + N = {\~N}, + n = {\~n}, + O = {\`O,\'O,\^O,\~O,\"O,\O}, + o = {\`o,\'o,\^o,\~o,\"o,\o}, + S = {\v{S}}, + s = {\v{s}}, + U = {\`U,\'U,\^U,\"U}, + u = {\`u,\'u,\^u,\"u}, + Y = {\'Y,\"Y}, + y = {\'y,\"y}, + Z = {\v{Z}}, + z = {\v{z}}, + } + +% \end{macrocode} +% +%\subsubsection{\otIV} +%\changes{v1.9}{2005/08/16}{add list for \otIV} +% The Polish \otI\ extension. More interesting characters here: +% |009|~(`fk'), |012|~(`fi'), |013|~(`fl'), |014|~(`ffi'), |015|~(`ffl'), +% \AE, \ae, \OE, \oe. +% \begin{macrocode} +\DeclareCharacterInheritance + { encoding = OT4 } + { A = {\k{A}}, + a = {\k{a}}, + C = {\'C}, + c = {\'c}, + E = {\k{E}}, + e = {\k{e}}, + f = {011}, % ff + i = {\i}, + j = {\j}, + L = {\L}, + l = {\l}, + N = {\'N}, + n = {\'n}, + O = {\O,\'O}, + o = {\o,\'o}, + S = {\'S}, + s = {\'s}, + Z = {\'Z,\.Z}, + z = {\'z,\.z}, + } + +% \end{macrocode} +% +%\subsubsection{\tV} +%\changes{v1.9}{2005/08/17}{add list for \tV\ (requested by \thanh)} ^^A private email, 16/8/2005 +% The Vietnamese encoding \tV. It is so crowded with accented and double-accented +% characters that there is no room for any ligatures. +% \begin{macrocode} +\DeclareCharacterInheritance + { encoding = T5 } + { A = {\`A,\'A,\~A,\h{A},\d{A},\^A,\u{A}, + \`\Acircumflex,\'\Acircumflex,\~\Acircumflex,\h\Acircumflex,\d\Acircumflex, + \`\Abreve,\'\Abreve,\~\Abreve,\h\Abreve,\d\Abreve}, + a = {\`a,\'a,\~a,\h{a},\d{a},\^a,\u{a}, + \`\acircumflex,\'\acircumflex,\~\acircumflex,\h\acircumflex,\d\acircumflex, + \`\abreve,\'\abreve,\~\abreve,\h\abreve,\d\abreve}, + D = {\DJ}, + d = {\dj}, + E = {\`E,\'E,\~E,\h{E},\d{E},\^E, + \`\Ecircumflex,\'\Ecircumflex,\~\Ecircumflex,\h\Ecircumflex,\d\Ecircumflex}, + e = {\`e,\'e,\~e,\h{e},\d{e},\^e, + \`\ecircumflex,\'\ecircumflex,\~\ecircumflex,\h\ecircumflex,\d\ecircumflex}, + I = {\`I,\'I,\~I,\h{I},\d{I}}, + i = {\`i,\'i,\~i,\h{i},\d{i},\i}, + O = {\`O,\'O,\~O,\h{O},\d{O},\^O,\horn{O}, + \`\Ocircumflex,\'\Ocircumflex,\~\Ocircumflex,\h\Ocircumflex,\d\Ocircumflex, + \`\Ohorn,\'\Ohorn,\~\Ohorn,\h\Ohorn,\d\Ohorn}, + o = {\`o,\'o,\~o,\h{o},\d{o},\^o,\horn{o}, + \`\ocircumflex,\'\ocircumflex,\~\ocircumflex,\h\ocircumflex,\d\ocircumflex, + \`\ohorn,\'\ohorn,\~\ohorn,\h\ohorn,\d\ohorn}, + U = {\`U,\'U,\~U,\h{U},\d{U},\horn{U}, + \`\Uhorn,\'\Uhorn,\~\Uhorn,\h\Uhorn,\d\Uhorn}, + u = {\`u,\'u,\~u,\h{u},\d{u},\horn{u}, + \`\uhorn,\'\uhorn,\~\uhorn,\h\uhorn,\d\uhorn}, + Y = {\`Y,\'Y,\~Y,\h{Y},\d{Y}}, + y = {\`y,\'y,\~y,\h{y},\d{y}}, + } + +% +% \end{macrocode} +% +%\subsection{Font Expansion} +%\GeneralChanges{Expansion} +% +% These are \thanh's original expansion settings. They are used for all fonts +% (until somebody shows mercy and creates font-specific settings). +% \begin{macrocode} +%<*m-t> +%%% ---------------------------------------------------------------------- +%%% EXPANSION SETTINGS + +\SetExpansion +% [ name = default ] +% [ name = bch-default ] +% [ name = cmr-default ] +% [ name = pad-default ] +% [ name = pmn-default ] +% [ name = ppl-default ] +% [ name = ptm-default ] +% { encoding = {OT1,OT4,T1,LY1} } +% { encoding = {OT1,T1,LY1}, +% family = bch } +% family = cmr } +% family = {pad,padx,padj} } +% family = {pmn,pmnx,pmnj} } +% family = {ppl,pplx,pplj} } +% family = {ptm,ptmx,ptmj} } + { + A = 500, a = 700, + \AE = 500, \ae = 700, + B = 700, b = 700, + C = 700, c = 700, + D = 500, d = 700, + E = 700, e = 700, + F = 700, + G = 500, g = 700, + H = 700, h = 700, + K = 700, k = 700, + M = 700, m = 700, + N = 700, n = 700, + O = 500, o = 700, + \OE = 500, \oe = 700, + P = 700, p = 700, + Q = 500, q = 700, + R = 700, + S = 700, s = 700, + U = 700, u = 700, + W = 700, w = 700, + Z = 700, z = 700, + 2 = 700, + 3 = 700, + 6 = 700, + 8 = 700, + 9 = 700, + } + +% \end{macrocode} +% \tV\ encoding does not contain \cmd{\AE}, \cmd{\ae}, \cmd{\OE} and \cmd{\oe}. +% \begin{macrocode} +\SetExpansion + [ name = T5 ] + { encoding = T5 } + { + A = 500, a = 700, + B = 700, b = 700, + C = 700, c = 700, + D = 500, d = 700, + E = 700, e = 700, + F = 700, + G = 500, g = 700, + H = 700, h = 700, + K = 700, k = 700, + M = 700, m = 700, + N = 700, n = 700, + O = 500, o = 700, + P = 700, p = 700, + Q = 500, q = 700, + R = 700, + S = 700, s = 700, + U = 700, u = 700, + W = 700, w = 700, + Z = 700, z = 700, + 2 = 700, + 3 = 700, + 6 = 700, + 8 = 700, + 9 = 700, + } + +% +% \end{macrocode} +% +%\subsection{Character Protrusion} +%\GeneralChanges{Protrusion} +% +%\changes{v1.1}{2004/09/14}{add factors for some more characters} +%\changes{v1.4b}{2004/11/19}{harmonize dashes in upshape and italic +% (\texttt{cmr}, \texttt{pad}, \texttt{ppl})} +%\changes{v1.9}{2005/08/16}{settings for \otIV\ encoding (Computer Modern Roman, +% Palatino, Times)} +%\changes{v1.9}{2005/08/17}{settings for \tV\ encoding (Computer Modern Roman)} +% +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% PROTRUSION SETTINGS + +% \end{macrocode} +% For future historians, \thanh's original settings (from \file{protcode.tex}, +% converted to \microtype\ notation). +%\begin{verbatim} +%\SetProtrusion +% [ name = thanh ] +% { encoding = OT1 } +% { +% A = {50,50}, +% F = { ,50}, +% J = {50, }, +% K = { ,50}, +% L = { ,50}, +% T = {50,50}, +% V = {50,50}, +% W = {50,50}, +% X = {50,50}, +% Y = {50,50}, +% k = { ,50}, +% r = { ,50}, +% t = { ,50}, +% v = {50,50}, +% w = {50,50}, +% x = {50,50}, +% y = {50,50}, +% . = { ,700}, {,}= { ,700}, +% : = { ,500}, ; = { ,500}, +% ! = { ,200}, ? = { ,200}, +% ( = {50, }, ) = { ,50}, +% - = { ,700}, +% \textendash = { ,300}, \textemdash = { ,200}, +% \textquoteleft = {700, }, \textquoteright = { ,700}, +% \textquotedblleft = {500, }, \textquotedblright = { ,500}, +% } +%\end{verbatim} +% +% We also create configuration files for the fonts +%\changes{v1.5}{2004/11/28}{settings for Bitstream Charter} +% Bitstream Charter (\nfss\ code |bch|), +% Computer Modern Roman (|cmr|), +% Palatino (|ppl|, |pplx|, |pplj|), +% Times (|ptm|, |ptmx|, |ptmj|), +% Adobe Garamond (|pad|, |padx|, |padj|) and +%\changes{v1.1}{2004/09/14}{settings for Adobe Minion +% (contributed by Harald Harders)} +% Minion\footnote{ +% Contributed by Harald Harders (\mailto{h.harders@tu-bs.de})} +% (|pmnx|, |pmnj|), +%\changes{v1.8}{2005/06/01}{settings for \ams\ math fonts} +% and for the \ams\ math fonts (|msa|, |msb|, |euf|, |eus|). +% +%\subsubsection{Default} +% +% The default settings always use the most moderate value. +% \begin{macrocode} +%<*!cfg-u> +\SetProtrusion +% [ name = default ] +% [ name = bch-default ] +% [ name = cmr-default ] +% [ name = pad-default ] +% [ name = pmnj-default ] +% [ name = ppl-default ] +% [ name = ptm-default ] +% { encoding = OT1 } +% { } +% { encoding = OT1, +% { encoding = {OT1,OT4}, +% family = bch } +% family = {pad,padx,padj} } +% family = pmnj } +% family = {ppl,pplx,pplj} } +% family = {ptm,ptmx,ptmj} } + { + A = {50,50}, +% \AE = {50, }, +% C = {50, }, +% D = { ,50}, +% F = { ,50}, +% G = {50, }, +% J = {50, }, +% J = {100, }, + K = { ,50}, +% L = { ,50}, +% L = { ,80}, +% O = {50,50}, +% \OE = {50, }, +% Q = {50,70}, +% R = { ,50}, + T = {50,50}, + V = {50,50}, + W = {50,50}, + X = {50,50}, +% Y = {50,50}, +% Y = {80,80}, + k = { ,50}, +% l = { ,-50}, +% p = {50,50}, +% q = {50, }, + r = { ,50}, +% t = { ,70}, +% t = { ,50}, + v = {50,50}, + w = {50,50}, + x = {50,50}, +% y = { ,50}, +% y = {50,70}, +% \end{macrocode} +%\changes{v1.6}{2005/01/11}{improve settings for numbers +% (pointed out by Peter Muthesius)} ^^A +% ^^A in: +% \begin{macrocode} +% 0 = { ,50}, +% 1 = {50,50}, +% 1 = {150,150}, +% 1 = {100,200}, +% 1 = { ,50}, +% 1 = {100,100}, +% 2 = {50,50}, +% 3 = {50,50}, +% 3 = {50, }, +% 4 = {50,50}, +% 4 = {100,50}, +% 4 = {70,70}, +% 4 = {50, }, +% 4 = {70, }, +% 5 = { ,50}, +% 5 = {50,50}, +% 6 = {50, }, +% 6 = { ,50}, +% 6 = {50,50}, +% 7 = {50,50}, +% 7 = {50,80}, +% 7 = {50,100}, +% 7 = { ,50}, +% 8 = { ,50}, +% 9 = {50,50}, +% 9 = { ,50}, +% . = { ,700}, +% . = { ,600}, + {,}= { ,500}, +% : = { ,500}, +% : = { ,400}, +% ; = { ,300}, +% ; = { ,500}, + ! = { ,100}, +% ? = { ,100}, +% ? = { ,200}, +% " = {300,300}, +% @ = {50,50}, +% @ = {100,100}, + ~ = {200,250}, +% _ = {100,100}, +% _ = {200,200}, +% & = {50,100}, +% \% = {50,50}, +% \% = { ,50}, +% \% = {100,100}, +% * = {200,200}, +% * = {200,300}, +% * = {300,300}, +% + = {250,250}, +% + = {150,250}, +% + = {300,300}, +% + = {150,200}, +% ( = {100, }, ) = { ,200}, +% ( = {200, }, ) = { ,200}, +% ( = {100, }, ) = { ,300}, +% [ = {100, }, ] = { ,100}, +% \end{macrocode} +%\changes{v1.7}{2005/03/15}{fix: remove \textbackslash\ from \otI, +% add \cmd{\textbackslash} to \tI\ encoding} +% \begin{macrocode} +% / = {100,200}, +% / = { ,200}, +% / = {200,300}, +% - = {500,500}, +% - = {400,500}, +% - = {300,500}, +% - = {200,400}, +% \textendash = {200,200}, \textemdash = {150,150}, +% \textendash = {200,300}, \textemdash = {150,250}, +% \textendash = {400,300}, \textemdash = {300,200}, +% \textendash = {300,300}, \textemdash = {200,200}, +% \end{macrocode} +% Why settings for left \emph{and} right quotes? Because in some languages they +% might be used like that (see the \pkg{csquotes} package for examples). +% \begin{macrocode} +% \textquoteleft = {300,400}, \textquoteright = {300,400}, +% \textquoteleft = {500,700}, \textquoteright = {500,600}, +% \textquoteleft = {500,700}, \textquoteright = {500,700}, +% \textquoteleft = {500,500}, \textquoteright = {300,500}, +% \textquotedblleft = {300,300}, \textquotedblright = {300,300}, +% \textquotedblleft = {500,300}, \textquotedblright = {200,600}, +% \textquotedblleft = {300,400}, \textquotedblright = {300,400}, + } + +% \end{macrocode} +% Greek uppercase letters are in \otI\ encoding only. +%\changes{v1.9}{2005/07/10}{fix: remove uppercase Greek letters from \tI\ encoded CMR} +% \begin{macrocode} +%<*cmr> +\SetProtrusion + [ name = cmr-OT1, + load = cmr-default ] + { encoding = {OT1,OT4}, + family = cmr } + { + \AE = { 50, }, + "00 = { ,150}, % \Gamma + "01 = {100,100}, % \Delta + "02 = { 50, 50}, % \Theta + "03 = {100,100}, % \Lambda +% "04 = { , }, % \Xi +% "05 = { , }, % \Pi + "06 = { 50, 50}, % \Sigma + "07 = {100,100}, % \Upsilon + "08 = { 50, 50}, % \Phi + "09 = { 50, 50}, % \Psi +% "0A = { , }, % \Omega + } + +% +% \end{macrocode} +% \tI\ and \lyI\ encodings contain some more characters. The default list +% will be loaded first. +% \begin{macrocode} +\SetProtrusion +% [ name = T1-default, +% [ name = bch-T1, +% [ name = cmr-T1, +% [ name = pad-T1, +% [ name = pmnj-T1, +% [ name = ppl-T1, +% [ name = ptm-T1, +% load = default ] +% load = bch-default ] +% load = cmr-default ] +% load = pad-default ] +% load = pmnj-default ] +% load = ppl-default ] +% load = ptm-default ] +% { encoding = {T1,LY1} } +% { encoding = {T1,LY1}, +% { encoding = {T1}, +% family = bch } +% family = cmr } +% family = {pad,padx,padj} } +% family = pmnj } +% family = {ppl,pplx,pplj} } +% family = {ptm,ptmx,ptmj} } + { +% \AE = {50, }, +% \TH = { ,50}, +% \textbackslash = {100,200}, +% \textbackslash = {150,200}, +% \textbackslash = {200,300}, +% \textquotedblleft = {200,600}, +% \textquotedbl = {300,300}, +% \end{macrocode} +%\changes{v1.4}{2004/10/30}{tweak quote characters for \texttt{cmr} +% variants (\otI, \tI, \texttt{lmr})} +% The EC fonts do something weird: They insert an implicit kern between quote +% and boundary character. Therefore, we must override the settings from \otI. +% \begin{macrocode} +% \quotesinglbase = {400,400}, \quotedblbase = {400,400}, +% \quotesinglbase = {400,400}, \quotedblbase = {300,300}, +% \guilsinglleft = {400,300}, \guilsinglright = {300,400}, +% \guilsinglleft = {400,400}, \guilsinglright = {300,500}, +% \guillemotleft = {200,200}, \guillemotright = {200,200}, +% \guillemotleft = {300,200}, \guillemotright = {100,400}, +% \guillemotleft = {200,200}, \guillemotright = {150,300}, +% \guillemotleft = {300,300}, \guillemotright = {200,400}, +% \guillemotleft = {300,300}, \guillemotright = {200,400}, +% \textexclamdown = {100, }, \textquestiondown = {100, }, +% \textexclamdown = {200, }, \textquestiondown = {200, }, +% \textbraceleft = {400,200}, \textbraceright = {200,400}, +% \textbraceleft = {200, }, \textbraceright = { ,300}, +% \textless = {200,100}, \textgreater = {100,200}, +% \textless = {100, }, \textgreater = { ,100}, +% \textvisiblespace = {100,100}, % not in LY1 +% \dh = { , }, +% \th = { , }, +% \NG = { , }, +% \ng = { , }, +% \textasciicircum = { , }, +% \textbar = { , }, +% \textsterling = { , }, % also in TS1 +% \textsection = { , }, % also in TS1 + } + +%<*cmr> +% \end{macrocode} +% \tV\ is based on \otI; it shares some but not all extra characters of \tI. +% All accented characters are already taken care of by the inheritance list. +% \begin{macrocode} +\SetProtrusion + [ name = cmr-T5, + load = cmr-default ] + { encoding = T5, + family = cmr } + { + \textbackslash = {200,300}, + \textquotedblleft = {200,600}, + \textquotedbl = {300,300}, + \quotesinglbase = {400,400}, \quotedblbase = {400,400}, + \guilsinglleft = {400,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,200}, \guillemotright = {100,400}, + \textbraceleft = {400,200}, \textbraceright = {200,400}, + \textless = {200,100}, \textgreater = {100,200}, + } + +% \end{macrocode} +% The \pkg{lmodern} fonts, on the other hand, restore the original kerning from +% the \otI\ fonts, and so do we. Silly, isn't it? +% \begin{macrocode} +\SetProtrusion + [ name = lmr-T1, + load = cmr-T1 ] + { encoding = {T1,LY1}, + family = lmr } + { + \textquotedblleft = {500,300}, + \quotedblbase = {500,300}, + } + +% +%<*pmn> +\SetProtrusion + [ name = pmnx-OT1, + load = pmnj-default ] + { encoding = OT1, + family = pmnx } + { + 1 = {230,180}, + } + +\SetProtrusion + [ name = pmnx-T1, + load = pmnj-T1 ] + { encoding = {T1,LY1}, + family = pmnx } + { + 1 = {230,180}, + } + +% +% \end{macrocode} +% Times is the default font for \lyI, therefore we provide settings for the +% additional characters in this encoding, too. +%\changes{v1.8}{2005/04/26}{add \lyI\ characters for Times} +% \begin{macrocode} +%<*ptm> + \SetProtrusion + [ name = ptm-LY1, + load = ptm-T1 ] + { encoding = LY1, + family = {ptm,ptmx,ptmj} } + { + \texttrademark = {100,100}, + \textregistered = {100,100}, + \textcopyright = {100,100}, + \textdegree = {300,300}, + \textminus = {200,200}, + \textellipsis = {100,100}, + \texteuro = { , }, % ? + \textcent = {100,100}, + \textquotesingle = {500,500}, + \textflorin = { 50, 70}, + \textdagger = {150,150}, + \textdaggerdbl = {100,100}, + \textperthousand = { , 50}, + \textbullet = {150,150}, + \textonesuperior = {100,100}, + \texttwosuperior = { 50, 50}, + \textthreesuperior = { 50, 50}, + \textperiodcentered = {300,300}, + \textplusminus = { 50, 80}, + \textmultiply = {100,100}, + \textdivide = { 50,150}, +% \textbrokenbar = { , }, +% \textyen = { , }, +% \textfractionsolidus = { , }, +% \textordfeminine = { , }, +% \textordmasculine = { , }, +% \textmu = { , }, +% \textparagraph = { , }, +% \textonequarter = { , }, +% \textonehalf = { , }, +% \textthreequarters = { , }, + } + +% +% \end{macrocode} +% +%\subsubsection{Italics} +% +% To find default settings for italic is difficult, since the character shapes +% and their behaviour at the beginning or end of line may be wildly different +% for different fonts. Therefore, we leave the letters away, and only set up the +% punctuation characters. +%\changes{v1.4b}{2004/11/22}{slanted like italics} +%\changes{v1.6}{2004/12/26}{add italic uppercase Greek letters} +% \begin{macrocode} +\SetProtrusion +% [ name = OT1-it ] +% [ name = bch-it ] +% [ name = cmr-it ] +% [ name = pad-it ] +% [ name = pmnj-it ] +% [ name = ppl-it ] +% [ name = ptm-it ] +% { encoding = OT1, +% { } +% { encoding = {OT1,OT4}, +% family = bch, +% family = {pad,padx,padj}, +% family = pmnj, +% family = {ppl,pplx,pplj}, +% family = {ptm,ptmx,ptmj}, +% shape = {it,sl} } + { +% A = {100,50}, +% A = {50, }, +% A = {50,50}, +% \AE = {100, }, +% \AE = {50, }, +% \AE = { ,-50}, +% B = {50, }, +% B = {20,-50}, +% C = {50, }, +% C = {100, }, +% C = {50,-50}, +% D = {50,50}, +% D = {20, }, +% E = {50, }, +% E = {20,-50}, +% F = {100, }, +% F = {10, }, +% F = {50, }, +% G = {50, }, +% G = {100, }, +% G = {50,-50}, +% H = {50, }, +% I = {50, }, +% I = {20,-50}, +% J = {100, }, +% J = {50, }, +% J = {20, }, +% K = {50, }, +% K = {20, }, +% L = {50, }, +% L = {20,50}, +% M = {50, }, +% M = { ,-30}, +% N = {50, }, +% N = { ,-30}, +% O = {50, }, +% O = {100, }, +% \OE = {50, }, +% \OE = {100, }, +% P = {50, }, +% P = {20,-50}, +% Q = {50, }, +% Q = {100, }, +% R = {50, }, +% R = {20, }, +% S = {50, }, +% S = {20,-30}, +% $ = {50, }, +% $ = {20,-30}, +% T = {70, }, +% T = {100, }, +% U = {50, }, +% U = {50,-50}, +% V = {100, }, +% V = {100,50}, +% W = {100, }, +% W = {50, }, +% W = {100,50}, +% X = {50, }, +% Y = {100, }, +% Y = {50, }, +% Y = {100,50}, +% Z = { ,-50}, +% d = { ,-50}, +% f = { ,-100}, +% i = { ,-30}, +% j = { ,-30}, +% l = { ,-100}, +% o = {50,50}, +% p = { ,50}, +% p = {-50, }, +% q = {50, }, +% r = { ,50}, +% t = { ,50}, +% v = {50, }, +% w = { ,50}, +% w = {50, }, +% y = { ,50}, +% 0 = {100, }, +% 1 = {150,100}, +% 1 = {200,50}, +% 1 = {150, }, +% 1 = {50, }, +% 1 = {100, }, +% 2 = {100,-100}, +% 2 = {50, }, +% 2 = {-50, }, +% 3 = {50, }, +% 3 = {100,-100}, +% 3 = {-100, }, +% 3 = {100,50}, +% 4 = {100, }, +% 4 = {150, }, +% 4 = {50, }, +% 5 = {100, }, +% 5 = {50, }, +% 6 = {50, }, +% 6 = {100, }, +% 7 = {100, }, +% 7 = {200,-150}, +% 7 = {20, }, +% 7 = {50, }, +% 8 = {50,-50}, +% 9 = {100,-100}, +% . = { ,500}, +% . = { ,700}, +% {,}= { ,500}, +% {,}= { ,600}, +% {,}= { ,700}, +% : = { ,300}, +% : = { ,400}, +% : = { ,200}, +% : = { ,500}, +% ; = { ,300}, +% ; = { ,400}, +% ; = { ,200}, +% ; = { ,500}, +% ! = { ,100}, +% ? = { ,200}, +% ? = { ,100}, +% ? = { ,300}, +% " = {400,200}, +% _ = { ,100}, +% _ = {100,200}, +% _ = {100,100}, +% & = {50,50}, +% & = { ,80}, +% & = {100,50}, +% \% = {100, }, +% \% = {50,50}, +% \% = {100,100}, +% * = {200,200}, +% * = {300,200}, +% * = {400,100}, +% * = {500,100}, +% * = {400,200}, +% + = {150,200}, +% + = {250,250}, +% + = {250,200}, +% @ = {50,50}, +% @ = {80,50}, +% @ = {200,50}, +% @ = {150,150}, +% ~ = {150,150}, +% ~ = {200,150}, + ( = {200, }, ) = { ,200}, +% / = {100,200}, +% / = { ,150}, +% / = {100,150}, +% - = {300,300}, +% - = {300,400}, +% - = {200,300}, +% - = {500,300}, +% - = {300,500}, +% - = {500,500}, +% \textendash = {200,200}, \textemdash = {150,150}, +% \textendash = {200,300}, \textemdash = {150,200}, +% \textendash = {500,300}, \textemdash = {400,200}, +% \textendash = {300,300}, \textemdash = {200,200}, +% \textquoteleft = {400,200}, \textquoteright = {400,200}, +% \textquoteleft = {800,200}, \textquoteright = {800,200}, +% \textquoteleft = {700,400}, \textquoteright = {700,400}, +% \textquoteleft = {800,500}, \textquoteright = {800,500}, +% \textquotedblleft = {400,200}, \textquotedblright = {400,200}, +% \textquotedblleft = {700,100}, \textquotedblright = {500,300}, +% \textquotedblleft = {700,200}, \textquotedblright = {700,200}, +% \textquotedblleft = {500,300}, \textquotedblright = {500,300}, +% \textquotedblleft = {700,400}, \textquotedblright = {700,400}, + } + +%<*cmr> +\SetProtrusion + [ name = cmr-it-OT1, + load = cmr-it ] + { encoding = {OT1,OT4}, + family = cmr, + shape = it } + { + \AE = {100, }, + \OE = {100, }, + "00 = {200,150}, % \Gamma + "01 = {150,100}, % \Delta + "02 = {150, 50}, % \Theta + "03 = {150, 50}, % \Lambda + "04 = {100,100}, % \Xi + "05 = {100,100}, % \Pi + "06 = {100, 50}, % \Sigma + "07 = {200,150}, % \Upsilon + "08 = {150, 50}, % \Phi + "09 = {150,100}, % \Psi + "0A = { 50, 50}, % \Omega + } + +% +\SetProtrusion +% [ name = T1-it-default, +% [ name = bch-it-T1, +% [ name = cmr-it-T1, +% [ name = pad-it-T1, +% [ name = pmnj-it-T1, +% [ name = ppl-it-T1, +% [ name = ptm-it-T1, +% load = OT1-it ] +% load = bch-it ] +% load = cmr-it ] +% load = pmnj-it ] +% load = pad-it ] +% load = ppl-it ] +% load = ptm-it ] +% { encoding = {T1,LY1}, +% { encoding = {T1}, +% family = bch, +% family = cmr, +% family = pmnj, +% family = {pad,padx,padj}, +% family = {ppl,pplx,pplj}, +% family = {ptm,ptmx,ptmj}, +% shape = {it,sl} } +% shape = it } + { +% \AE = {100, }, +% \OE = {100, }, +% \textbackslash = {100,200}, +% \textbackslash = {300,300}, +% \textbackslash = {150,150}, +% \textbackslash = {100,150}, +% 031 = { ,-100}, % ffl +% 156 = {100, }, % IJ +% 156 = {50, }, % IJ +% 156 = {20, }, % IJ +% 188 = { ,-30}, % ij +% \v{t} = { ,100}, +% \textquotedblleft = {500,300}, +% \quotesinglbase = {300,700}, \quotedblbase = {400,500}, +% \quotesinglbase = {300,700}, \quotedblbase = {200,600}, +% \quotesinglbase = {200,500}, \quotedblbase = {150,500}, +% \quotesinglbase = {500,500}, \quotedblbase = {400,400}, +% \guilsinglleft = {400,400}, \guilsinglright = {300,500}, +% \guilsinglleft = {300,400}, \guilsinglright = {200,500}, +% \guilsinglleft = {500,300}, \guilsinglright = {400,400}, +% \guilsinglleft = {500,400}, \guilsinglright = {300,500}, +% \guillemotleft = {300,300}, \guillemotright = {300,300}, +% \guillemotleft = {200,300}, \guillemotright = {150,400}, +% \guillemotleft = {400,100}, \guillemotright = {200,300}, +% \guillemotleft = {300,300}, \guillemotright = {200,400}, +% \guillemotleft = {300,400}, \guillemotright = {200,400}, +% \textexclamdown = {100, }, \textquestiondown = {200, }, +% \textexclamdown = {200, }, \textquestiondown = {200, }, +% \textexclamdown = {-50, }, \textquestiondown = {-50, }, +% \textbraceleft = {200,100}, \textbraceright = {200,200}, +% \textbraceleft = {200, }, \textbraceright = { ,200}, +% \textbraceleft = {400,100}, \textbraceright = {200,200}, +% \textless = {100, }, \textgreater = { ,100}, +% \textless = {300,100}, \textgreater = {200,100}, +% \textvisiblespace = {100,100}, + } + +%<*cmr> +\SetProtrusion + [ name = cmr-it-T5, + load = cmr-it ] + { encoding = T5, + family = cmr, + shape = it } + { + \textbackslash = {300,300}, + \quotesinglbase = {300,700}, \quotedblbase = {200,600}, + \guilsinglleft = {500,300}, \guilsinglright = {400,400}, + \guillemotleft = {400,100}, \guillemotright = {200,300}, + \textbraceleft = {400,100}, \textbraceright = {200,200}, + \textless = {300,100}, \textgreater = {200,100}, + } + +% \end{macrocode} +%\changes{v1.8}{2005/06/01}{verified settings for slanted Computer Modern Roman} +% Slanted is very similar to italic. +% \begin{macrocode} +\SetProtrusion + [ name = cmr-sl, + load = cmr-it-OT1 ] + { encoding = {OT1,OT4}, + family = cmr, + shape = sl } + { + L = { ,50}, + f = { ,-50}, + - = {300, }, + \textendash = {400, }, \textemdash = {300, }, + } + +\SetProtrusion + [ name = cmr-sl-T1, + load = cmr-it-T1 ] + { encoding = {T1,LY1}, + family = cmr, + shape = sl } + { + L = { ,50}, + f = { ,-50}, + - = {300, }, + \textendash = {400, }, \textemdash = {300, }, + } + +\SetProtrusion + [ name = cmr-sl-T5, + load = cmr-it-T5 ] + { encoding = T5, + family = cmr, + shape = sl } + { + L = { ,50}, + f = { ,-50}, + - = {300, }, + \textendash = {400, }, \textemdash = {300, }, + } + +\SetProtrusion + [ name = lmr-it-T1, + load = cmr-it-T1 ] + { encoding = {T1,LY1}, + family = lmr, + shape = {it,sl} } + { + \textquotedblleft = {700,100}, + \quotedblbase = {600,300}, + } + +% \end{macrocode} +% Oldstyle numerals are slightly different. +% \begin{macrocode} +\SetProtrusion + [ name = cmr(oldstyle)-it, + load = cmr-it-T1 ] + { encoding = T1, + family = {hfor,cmor}, + shape = {it,sl} } + { + 1 = {250, 50}, + 2 = {150,-100}, + 3 = {100,-50}, + 4 = {150,150}, + 6 = {200, }, + 7 = {200, 50}, + 8 = {150,-50}, + 9 = {100, 50}, + } + +% +%<*pmn> +\SetProtrusion + [ name = pmnx-it, + load = pmnj-it ] + { encoding = OT1, + family = pmnx, + shape = {it,sl} } + { + 1 = {100,150}, + } + +\SetProtrusion + [ name = pmnx-it-T1, + load = pmnj-it-T1 ] + { encoding = {T1,LY1}, + family = pmnx, + shape = {it,sl} } + { + 1 = {100,150}, + } + +% +%<*ptm> +\SetProtrusion + [ name = ptm-it-LY1, + load = ptm-it-T1 ] + { encoding = {LY1}, + family = {ptm,ptmx,ptmj}, + shape = {it,sl} } + { + \texttrademark = {100,100}, + \textregistered = {100,100}, + \textcopyright = {100,100}, + \textdegree = {300,100}, + \textminus = {200,200}, + \textellipsis = {100,150}, + \texteuro = { , }, + \textcent = {100,100}, + \textquotesingle = {500, }, + \textflorin = {100, 70}, + \textdagger = {150,150}, + \textdaggerdbl = {100,100}, + \textbullet = {150,150}, + \textonesuperior = {150,100}, + \texttwosuperior = {150, 50}, + \textthreesuperior = {150, 50}, + \textparagraph = {100, }, + \textperiodcentered = {500,300}, + \textonequarter = { 50, }, + \textonehalf = { 50, }, + \textplusminus = {100,100}, + \textmultiply = {150,150}, + \textdivide = {150,150}, + } + +% +% \end{macrocode} +% +%\subsubsection{Small caps} +% +% Small caps should inherit the values from their big brothers. Since values are +% relative to character width, we don't need to adjust them any further (but +% we have to reset some characters). +% \begin{macrocode} +\SetProtrusion +% [ name = OT1-sc, +% [ name = bch-sc, +% [ name = cmr-sc-OT1, +% [ name = pad-sc, +% [ name = pmnj-sc, +% [ name = ppl-sc, +% [ name = ptm-sc, +% load = default ] +% load = bch-default ] +% load = cmr-OT1 ] +% load = pad-default ] +% load = pmnj-default ] +% load = ppl-default ] +% load = ptm-default ] +% { encoding = OT1, +% { encoding = {OT1,OT4}, +% family = bch, +% family = cmr, +% family = {pad,padx,padj}, +% family = pmnj, +% family = {ppl,pplx,pplj}, +% family = {ptm,ptmx,ptmj}, + shape = sc } + { + a = {50,50}, +% \ae = {50, }, +% c = {50, }, +% d = { ,50}, +% f = { ,50}, +% g = {50, }, +% j = {50, }, +% j = {100, }, +% l = { ,50}, +% l = { ,80}, +% 013 = { ,50}, % fl +% 013 = { ,80}, % fl +% o = {50,50}, +% \oe = {50, }, +% p = { 0, 0}, +% q = {50,70}, +% q = { 0, }, +% r = { , 0}, + t = {50,50}, +% y = {50,50}, +% y = {80,80}, + } + +\SetProtrusion +% [ name = T1-sc, +% [ name = bch-sc-T1, +% [ name = cmr-sc-T1, +% [ name = pad-sc-T1, +% [ name = pmnj-sc-T1, +% [ name = ppl-sc-T1, +% [ name = ptm-sc-T1, +% load = T1-default ] +% load = bch-T1 ] +% load = cmr-T1 ] +% load = pad-T1 ] +% load = pmnj-T1 ] +% load = ppl-T1 ] +% load = ptm-T1 ] + { encoding = {T1,LY1}, +% family = bch, +% family = cmr, +% family = {pad,padx,padj}, +% family = pmnj, +% family = {ppl,pplx,pplj}, +% family = {ptm,ptmx,ptmj}, + shape = sc } + { + a = {50,50}, +% \ae = {50, }, +% c = {50, }, +% d = { ,50}, +% f = { ,50}, +% g = {50, }, +% j = {50, }, +% j = {100, }, +% l = { ,50}, +% l = { ,80}, +% 029 = { ,50}, % fl +% 029 = { ,80}, % fl +% o = {50,50}, +% \oe = {50, }, +% p = { 0, 0}, +% q = {50,70}, +% q = { 0, }, +% r = { , 0}, + t = {50,50}, +% y = {50,50}, +% y = {80,80}, + } + +%<*cmr> +\SetProtrusion + [ name = cmr-sc-T5, + load = cmr-T5 ] + { encoding = T5, + family = cmr, + shape = sc } + { + a = {50,50}, + f = { ,50}, + j = {50, }, + l = { ,50}, + r = { , 0}, + t = {50,50}, + y = {50,50}, + } + +% +%<*pmn> +\SetProtrusion + [ name = pmnx-sc, + load = pmnj-sc ] + { encoding = OT1, + family = pmnx, + shape = sc } + { + 1 = {230,180}, + } + +\SetProtrusion + [ name = pmnx-sc-T1, + load = pmnj-sc-T1 ] + { encoding = {T1,LY1}, + family = pmnx, + shape = sc } + { + 1 = {230,180}, + } + +% \end{macrocode} +% +%\subsubsection{Italic Small Caps} +% Minion provides real small caps in italics. +% The \pkg{slantsc} package calls them |scit|, Philipp Lehman's +% \pkg{fontinstallationguide} suggests |si|. +% \begin{macrocode} +\SetProtrusion + [ name = pmnj-scit, + load = pmnj-it ] + { encoding = OT1, + family = pmnj, + shape = {scit,si} } + { + a = {50, }, + \ae = { ,-50}, + b = {20,-50}, + c = {50,-50}, + d = {20, 0}, + e = {20,-50}, + f = {10, 0}, + 012 = {10,-50}, % fi + 013 = {10,-50}, % fl + 014 = {10,-50}, % ffi + 015 = {10,-50}, % ffl + g = {50,-50}, + i = {20,-50}, + j = {20, 0}, + k = {20, }, + l = {20,50}, + m = { ,-30}, + n = { ,-30}, + o = {50, }, + \oe = {50,-50}, + p = {20,-50}, + q = {50, }, + r = {20, 0}, + s = {20,-30}, + t = {70, }, + u = {50,-50}, + v = {100, }, + w = {100, }, + y = {50, }, + z = { ,-50}, + } + +\SetProtrusion + [ name = pmnj-scit-T1, + load = pmnj-it-T1 ] + { encoding = {T1,LY1}, + family = pmnj, + shape = {scit,si} } + { + a = {50, }, + \ae = { ,-50}, + b = {20,-50}, + c = {50,-50}, + d = {20, 0}, + e = {20,-50}, + f = {10, 0}, + 028 = {10,-50}, % fi + 029 = {10,-50}, % fl + 030 = {10,-50}, % ffi + 031 = {10,-50}, % ffl + g = {50,-50}, + i = {20,-50}, + 188 = {20, 0}, % ij + j = {20, 0}, + k = {20, }, + l = {20,50}, + m = { ,-30}, + n = { ,-30}, + o = {50, }, + \oe = {50,-50}, + p = {20,-50}, + q = {50, }, + r = {20, 0}, + s = {20,-30}, + t = {70, }, + u = {50,-50}, + v = {100, }, + w = {100, }, + y = {50, }, + z = { ,-50}, + } + +\SetProtrusion + [ name = pmnx-scit, + load = pmnj-scit ] + { encoding = OT1, + family = pmnx, + shape = {scit,si} } + { + 1 = {100,150}, + } + +\SetProtrusion + [ name = pmnx-scit-T1, + load = pmnj-scit-T1 ] + { encoding = {T1,LY1}, + family = pmnx, + shape = {scit,si} } + { + 1 = {100,150}, + } + +% +% \end{macrocode} +% +%\subsubsection{\texttt{textcomp}} +% +% Finally the \tsI\ encoding. +% Still quite incomplete for Times and especially Palatino. Anybody? +%\changes{v1.2}{2004/09/28}{add settings for Adobe Garamond and +% Computer Modern Roman in \tsI\ encoding} +% \begin{macrocode} +\SetProtrusion +% [ name = textcomp ] +% [ name = bch-textcomp ] +% [ name = cmr-textcomp ] +% [ name = pad-textcomp ] +% [ name = pmn-textcomp ] +% [ name = ppl-textcomp ] +% [ name = ptm-textcomp ] +% { encoding = TS1 } +% { encoding = TS1, +% family = bch } +% family = cmr } +% family = {pad,padx,padj} } +% family = {pmnx,pmnj} } +% family = {ppl,pplx,pplj} } +% family = {ptm,ptmx,ptmj} } + { +% \textquotestraightbase = {300,300}, +% \textquotestraightbase = {400,400}, +% \textquotestraightdblbase = {300,300}, +% \textquotestraightdblbase = {400,400}, +% \texttwelveudash = {200,200}, +% \textthreequartersemdash = {150,150}, +% \textquotesingle = {300,400}, +% \textquotesingle = {400,500}, +% \textquotesingle = {500,500}, +% \textasteriskcentered = {200,300}, +% \textasteriskcentered = {300,300}, +% \textfractionsolidus = {-200,-200}, +% \textoneoldstyle = {100,100}, +% \textoneoldstyle = { , 50}, +% \textthreeoldstyle = { , 50}, +% \textthreeoldstyle = { 50, }, +% \textfouroldstyle = { 50, 50}, +% \textfouroldstyle = { 50, }, +% \textsevenoldstyle = { 50, 80}, +% \textlangle = {400, }, +% \textrangle = { ,400}, +% \textminus = {200,200}, +% \textminus = {300,300}, +% \textlbrackdbl = {100, }, +% \textrbrackdbl = { ,100}, +% \textasciigrave = {200,500}, +% \texttildelow = {200,250}, +% \textasciibreve = {300,400}, +% \textasciicaron = {300,400}, +% \textacutedbl = {200,300}, +% \textgravedbl = {150,300}, +% \textdagger = { 80, 80}, +% \textdagger = {100,100}, +% \textdagger = {150,150}, +% \textdaggerdbl = { 80, 80}, +% \textdaggerdbl = {100,100}, +% \textbardbl = {100,100}, +% \textbullet = {200,200}, +% \textbullet = { ,100}, +% \textbullet = {150,150}, +% \textcelsius = { 50, }, +% \textcelsius = { 80, }, +% \textflorin = { 50, 50}, +% \textflorin = { ,100}, +% \textflorin = { 50,100}, +% \textflorin = { 50, 70}, +% \textcolonmonetary = { , 50}, +% \textcolonmonetary = { 50, }, +% \textinterrobang = { ,100}, +% \textinterrobangdown = {100, }, +% \texttrademark = {100,100}, +% \texttrademark = {150,150}, +% \texttrademark = {200,200}, +% \texttrademark = { 50, 50}, +% \textcent = { 50, }, +% \textcent = {100,100}, +% \textsterling = { 50, }, +% \textbrokenbar = {200,200}, +% \textasciidieresis = {300,400}, +% \textcopyright = {100,100}, +% \textcopyright = {100,150}, +% \textcopyright = {200,200}, +% \textordfeminine = {100,200}, +% \textordfeminine = {200,200}, +% \textlnot = {200, }, +% \textregistered = {100,100}, +% \textregistered = { 50,150}, +% \textregistered = {200,200}, +% \textasciimacron = {150,200}, +% \textdegree = {300,300}, +% \textdegree = {150,200}, +% \textdegree = {400,400}, +% \textdegree = {150,400}, +% \textpm = {150,200}, +% \textpm = { 50, 80}, +% \texttwosuperior = {100,200}, +% \texttwosuperior = { 50,100}, +% \texttwosuperior = {200,200}, +% \texttwosuperior = { 50, 50}, +% \textthreesuperior = {100,200}, +% \textthreesuperior = { 50,100}, +% \textthreesuperior = {200,200}, +% \textthreesuperior = { 50, 50}, +% \textasciiacute = {300,400}, +% \textmu = { ,100}, +% \textparagraph = { ,100}, +% \textperiodcentered = {300,400}, +% \textperiodcentered = {300,300}, +% \textonesuperior = {200,300}, +% \textonesuperior = {200,200}, +% \textonesuperior = {100,100}, +% \textordmasculine = {200,200}, +% \textordmasculine = {100,200}, +% \texteuro = {100, }, +% \texteuro = { 50,100}, +% \texttimes = {100,100}, +% \texttimes = {150,250}, +% \texttimes = {100,150}, +% \texttimes = { 70,100}, +% \textdiv = {150,200}, +% \textdiv = {150,250}, +% \textdiv = { 50,100}, +% \textperthousand = { ,50}, +% \end{macrocode} +% All remaining characters can be found in the source. +%\iffalse +%^^A ... namely, here: +% \textsection = { , }, +% \textyen = { , }, +% \textonehalf = { , }, +% \textonequarter = { , }, +% \textthreequarters = { , }, +% \texttwooldstyle = { , }, +% \textfiveoldstyle = { , }, +% \textsixoldstyle = { , }, +% \texteightoldstyle = { , }, +% \textnineoldstyle = { , }, +% \textleftarrow = { , }, +% \textrightarrow = { , }, +% \textblank = { , }, +% \textdollar = { , }, +% \textdblhyphen = { , }, +% \textdblhyphenchar = { , }, +% \textohm = { , }, +% \textmho = { , }, +% \textbigcircle = { , }, +% \textuparrow = { , }, +% \textdownarrow = { , }, +% \textborn = { , }, +% \textdied = { , }, +% \textmarried = { , }, +% \textdivorced = { , }, +% \textleaf = { , }, +% \textmusicalnote = { , }, +% \textdollaroldstyle = { , }, +% \textcentoldstyle = { , }, +% \textwon = { , }, +% \textnaira = { , }, +% \textguarani = { , }, +% \textpeso = { , }, +% \textlira = { , }, +% \textrecipe = { , }, +% \textdong = { , }, +% \textpertenthousand = { , }, +% \textpilcrow = { , }, +% \textbaht = { , }, +% \textnumero = { , }, +% \textdiscount = { , }, +% \textestimated = { , }, +% \textopenbullet = { , }, +% \textservicemark = { , }, +% \textlquill = { , }, +% \textrquill = { , }, +% \textcopyleft = { , }, +% \textcircledP = { , }, +% \textreferencemark = { , }, +% \textsurd = { , }, +%\fi +% \begin{macrocode} + } + +%<*cmr|pad|pmn> +\SetProtrusion +% [ name = cmr-textcomp-it ] +% [ name = pad-textcomp-it ] +% [ name = pmn-textcomp-it ] + { encoding = TS1, +% family = cmr, +% family = {pad,padx,padj}, +% family = {pmnx,pmnj}, + shape = {it,sl} } + { +% \textquotestraightbase = {300,600}, +% \textquotestraightbase = {400,400}, +% \textquotestraightdblbase = {300,600}, +% \textquotestraightdblbase = {300,400}, +% \textquotestraightdblbase = {300,300}, + \texttwelveudash = {200,200}, + \textthreequartersemdash = {150,150}, +% \textquotesingle = {600,300}, +% \textquotesingle = {800,100}, +% \textquotesingle = {300,200}, +% \textasteriskcentered = {300,200}, +% \textasteriskcentered = {500,100}, +% \textasteriskcentered = {200,300}, +% \textfractionsolidus = {-200,-200}, +% \textoneoldstyle = {100, 50}, +% \textoneoldstyle = {100, }, +% \textoneoldstyle = { 50, }, +% \texttwooldstyle = { 50, }, +% \texttwooldstyle = {-50, }, +% \textthreeoldstyle = {100, 50}, +% \textthreeoldstyle = {-100, }, +% \textfouroldstyle = { 50, 50}, +% \textfouroldstyle = { 50,100}, +% \textsevenoldstyle = { 50, 80}, +% \textsevenoldstyle = { 50, }, +% \textsevenoldstyle = { 20, }, +% \textlangle = {400, }, +% \textrangle = { ,400}, +% \textminus = {300,300}, +% \textminus = {200,200}, +% \textlbrackdbl = {100, }, +% \textrbrackdbl = { ,100}, +% \textasciigrave = {300,300}, + \texttildelow = {200,250}, +% \textasciibreve = {300,300}, +% \textasciicaron = {300,300}, +% \textacutedbl = {200,300}, +% \textgravedbl = {150,300}, +% \textdagger = {100,100}, +% \textdagger = {200,100}, +% \textdagger = { 80, 50}, +% \textdaggerdbl = { 80, 80}, +% \textdaggerdbl = { 80, 50}, +% \textbullet = {200,100}, +% \textbullet = {300, }, +% \textbullet = { 30, 70}, +% \textcelsius = {100, }, +% \textcelsius = {200, }, +% \textcelsius = { 50,-50}, +% \textflorin = {100, }, +% \textflorin = { 50,100}, +% \textcolonmonetary = {150, }, +% \textcolonmonetary = {100, }, +% \textcolonmonetary = { 50,-50}, +% \texttrademark = {200, }, +% \texttrademark = { 50,100}, +% \textasciidieresis = {300,200}, +% \textcopyright = {100, }, +% \textcopyright = {200,100}, +% \textcopyright = {100,150}, +% \textordfeminine = {100,100}, +% \textordfeminine = {200,200}, +% \textlnot = {300, }, +% \textlnot = {200, }, +% \textregistered = {100, }, +% \textregistered = {200,100}, +% \textregistered = { 50,150}, +% \textasciimacron = {150,200}, +% \textdegree = {500,100}, +% \textdegree = {150,150}, +% \textpm = {150,100}, +% \textpm = {200,150}, +% \textpm = {150,200}, +% \textonesuperior = {400, }, +% \textonesuperior = {300,100}, +% \textonesuperior = {200,100}, +% \texttwosuperior = {400, }, +% \texttwosuperior = {300, }, +% \texttwosuperior = {200,100}, +% \textthreesuperior = {400, }, +% \textthreesuperior = {300, }, +% \textthreesuperior = {200,100}, +% \textasciiacute = {300,200}, +% \textparagraph = {200, }, +% \textparagraph = { ,100}, +% \textperiodcentered = {500,500}, +% \textperiodcentered = {300,400}, +% \textordmasculine = {100,100}, +% \textordmasculine = {200,200}, +% \texteuro = {200, }, +% \texteuro = {100, }, +% \texteuro = {100,-50}, +% \texttimes = {200,200}, +% \texttimes = {200,100}, +% \texttimes = { 70,100}, +% \textdiv = {200,200}, +% \textdiv = {150,200}, + } + +% +% \end{macrocode} +% +%\subsubsection{Math} +% +% Now to the math symbols for Computer Modern Roman. Definitions have been +% extracted from \file{fontmath.ltx}. +%\changes{v1.2}{2004/10/02}{add settings for Computer Modern Roman math symbols} +% I did not spend too much time fiddling with these settings, so they can surely +% be improved. +% +% The math font `|operators|' (also used for the \cmd{\mathrm} and +% \cmd{\mathbf} alphabets) is |OT1/cmr|, which we've already set up above. +% It's declared as: +%\begin{verbatim} +%\DeclareSymbolFont{operators} {OT1}{cmr} {m}{n} +%\SetSymbolFont{operators}{bold}{OT1}{cmr} {bx}{n} +%\end{verbatim} +% +% \cmd{\mathit} (|OT1/cmr/m/it|) is also already set up. +% +% There are (for the moment) no settings for \cmd{\mathsf} and \cmd{\mathtt}. +% +% Math font `|letters|' (also used as \cmd{\mathnormal}) is declared as: +%\begin{verbatim} +%\DeclareSymbolFont{letters} {OML}{cmm} {m}{it} +%\SetSymbolFont{letters} {bold}{OML}{cmm} {b}{it} +%\end{verbatim} +%\changes{v1.6}{2004/12/26}{tune CMR math letters (OML encoding)} +% \begin{macrocode} +%<*cmr> +\SetProtrusion + [ name = cmr-math-letters ] + { encoding = OML, + family = cmm, + series = {m,b}, + shape = it } + { + A = {100, 50}, % \mathnormal + B = { 50, }, + C = { 50, }, + D = { 50, 50}, + E = { 50, }, + F = {100, 50}, + G = { 50, 50}, + H = { 50, 50}, + I = { 50, 50}, + J = {150, 50}, + K = { 50,100}, + L = { 50, 50}, + M = { 50, }, + N = { 50, }, + O = { 50, }, + P = { 50, }, + Q = { 50, 50}, + R = { 50, }, + S = { 50, }, + T = { 50,100}, + U = { 50, 50}, + V = {100,100}, + W = { 50,100}, + X = { 50,100}, + Y = {100,100}, + f = {100,100}, + h = { ,100}, + i = { , 50}, + j = { , 50}, + k = { , 50}, + r = { , 50}, + v = { , 50}, + w = { , 50}, + x = { , 50}, + "0B = { 50,100}, % \alpha + "0C = { 50, 50}, % \beta + "0D = {200,150}, % \gamma + "0E = { 50, 50}, % \delta + "0F = { 50, 50}, % \epsilon + "10 = { 50,150}, % \zeta +% "11 = { , }, % \eta + "12 = { 50, }, % \theta + "13 = { ,100}, % \iota + "14 = { ,100}, % \kappa + "15 = {100, 50}, % \lambda + "16 = { , 50}, % \mu + "17 = { , 50}, % \nu + "18 = { , 50}, % \xi + "19 = { 50,100}, % \pi + "1A = { 50, 50}, % \rho + "1B = { ,150}, % \sigma + "1C = { 50,150}, % \tau + "1D = { 50, 50}, % \upsilon +% "1E = { , }, % \phi + "1F = { 50,100}, % \chi + "20 = { 50, 50}, % \psi + "21 = { , 50}, % \omega + "22 = { , 50}, % \varepsilon + "23 = { , 50}, % \vartheta + "24 = { , 50}, % \varpi + "25 = {100, }, % \varrho + "26 = {100,100}, % \varsigma + "27 = { 50, 50}, % \varphi + "28 = {100,100}, % \leftharpoonup + "29 = {100,100}, % \leftharpoondown + "2A = {100,100}, % \rightharpoonup + "2B = {100,100}, % \rightharpoondown + "2C = {300,200}, % \lhook + "2D = {200,300}, % \rhook + "2E = { ,100}, % \triangleright + "2F = {100, }, % \triangleleft + % 0 - 9 + "3A = { ,500}, % ., \ldotp + "3B = { ,500}, % , + "3C = {200,100}, % < + "3D = {300,400}, % / + "3E = {100,200}, % > + "3F = {200,200}, % \star +% "40 = { , }, % \partial + "5B = { ,100}, % \flat +% "5C = { , }, % \natural +% "5D = { , }, % \sharp + "5E = {200,200}, % \smile + "5F = {200,200}, % \frown +% "60 = { , }, % \ell +% "7B = { , }, % \imath + "7C = {100, }, % \jmath + "7D = { ,100}, % \wp + } + +% \end{macrocode} +% Math font `|symbols|' (also used for the \cmd{\mathcal} alphabet) is declared +% as: +%\begin{verbatim} +%\DeclareSymbolFont{symbols} {OMS}{cmsy}{m}{n} +%\SetSymbolFont{symbols} {bold}{OMS}{cmsy}{b}{n} +%\end{verbatim} +% \begin{macrocode} +\SetProtrusion + [ name = cmr-math-symbols ] + { encoding = OMS, + family = cmsy, + series = {m,b}, + shape = n } + { + A = {150, 50}, % \mathcal + C = { ,100}, + D = { , 50}, + F = { 50,150}, + I = { ,100}, + J = {100,150}, + K = { ,100}, + L = {100, }, + M = { 50, 50}, + N = { 50,100}, + P = { , 50}, + Q = { 50, }, + R = { , 50}, + T = { 50,150}, + V = { 50, 50}, + W = { , 50}, + X = {100,100}, + Y = {100, }, + Z = {100,150}, + "00 = {300,300}, % - + "01 = { ,700}, % \cdot, \cdotp + "02 = {150,250}, % \times + "03 = {150,250}, % *, \ast + "04 = {200,300}, % \div + "05 = {150,250}, % \diamond + "06 = {200,200}, % \pm + "07 = {200,200}, % \mp + "08 = {100,100}, % \oplus + "09 = {100,100}, % \ominus + "0A = {100,100}, % \otimes + "0B = {100,100}, % \oslash + "0C = {100,100}, % \odot + "0D = {100,100}, % \bigcirc + "0E = {100,100}, % \circ + "0F = {100,100}, % \bullet + "10 = {100,100}, % \asymp + "11 = {100,100}, % \equiv + "12 = {200,100}, % \subseteq + "13 = {100,200}, % \supseteq + "14 = {200,100}, % \leq + "15 = {100,200}, % \geq + "16 = {200,100}, % \preceq + "17 = {100,200}, % \succeq + "18 = {200,200}, % \sim + "19 = {150,150}, % \approx + "1A = {200,100}, % \subset + "1B = {100,200}, % \supset + "1C = {200,100}, % \ll + "1D = {100,200}, % \gg + "1E = {300,100}, % \prec + "1F = {100,300}, % \succ + "20 = {100,200}, % \leftarrow + "21 = {200,100}, % \rightarrow + "22 = {100,100}, % \uparrow + "23 = {100,100}, % \downarrow + "24 = {100,100}, % \leftrightarrow + "25 = {100,100}, % \nearrow + "26 = {100,100}, % \searrow + "27 = {100,100}, % \simeq + "28 = {100,100}, % \Leftarrow + "29 = {100,100}, % \Rightarrow + "2A = {100,100}, % \Uparrow + "2B = {100,100}, % \Downarrow + "2C = {100,100}, % \Leftrightarrow + "2D = {100,100}, % \nwarrow + "2E = {100,100}, % \swarrow + "2F = { ,100}, % \propto + "30 = { ,400}, % \prime + "31 = {100,100}, % \infty + "32 = {150,100}, % \in + "33 = {100,150}, % \ni + "34 = {100,100}, % \triangle, \bigtriangleup + "35 = {100,100}, % \bigtriangledown +% "36 = { , }, % \not +% "37 = { , }, % \mapstochar + "38 = { ,100}, % \forall + "39 = {100, }, % \exists + "3A = {200, }, % \neg +% "3B = { , }, % \emptyset +% "3C = { , }, % \Re +% "3D = { , }, % \Im + "3E = {200,200}, % \top + "3F = {200,200}, % \bot, \perp +% "40 = { , }, % \aleph +% "5B = { , }, % \cup +% "5C = { , }, % \cap +% "5D = { , }, % \uplus + "5E = {100,200}, % \wedge + "5F = {100,200}, % \vee + "60 = { ,300}, % \vdash + "61 = {300, }, % \dashv + "62 = {100,100}, % \lfloor + "63 = {100,100}, % \rfloor + "64 = {100,100}, % \lceil + "65 = {100,100}, % \rceil + "66 = {150, }, % \lbrace + "67 = { ,150}, % \rbrace + "68 = {400, }, % \langle + "69 = { ,400}, % \rangle +% "6A = { , }, % \arrowvert, \mid, \vert, | +% "6B = { , }, % \Arrowvert, \parallel, \Vert + "6C = {100,100}, % \updownarrow + "6D = {100,100}, % \Updownarrow + "6E = {100,300}, % \, \backslash, \setminus +% "6F = { , }, % \wr +% "70 = { , }, % \sqrtsign +% "71 = { , }, % \amalg + "72 = {100,100}, % \nabla +% "73 = { , }, % \smallint +% "74 = { , }, % \sqcup +% "75 = { , }, % \sqcap +% "76 = { , }, % \sqsubseteq +% "77 = { , }, % \sqsupseteq +% "78 = { , }, % \mathsection + "79 = {200,200}, % \dagger + "7A = {100,100}, % \ddagger + "7B = {100, }, % \mathparagraph + "7C = {100,100}, % \clubsuit + "7D = {100,100}, % \diamondsuit + "7E = {100,100}, % \heartsuit + "7F = {100,100}, % \spadesuit + } + +% \end{macrocode} +% We don't bother about `|largesymbols|', since it will only be used in display +% math, where protrusion doesn't work anyway. It's declared as: +%\begin{verbatim} +%\DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n} +%\end{verbatim} +% \begin{macrocode} +%\SetProtrusion +% [ name = cmr-math-largesymbols ] +% { encoding = OMX, +% family = {cmex,cmr} } +% { +% "00 % ( +% "01 % ) +% "02 % [ +% "03 % ] +% "04 % \lfloor +% "05 % \rfloor +% "06 % \lceil +% "07 % \rceil +% "08 % \lbrace +% "09 % \rbrace +% "0A % <, \langle +% "0B % >, \rangle +% "0C % \vert, | +% "0D % \Vert +% "0E % / +% "0F % \backslash +% "3A % \lgroup +% "3B % \rgroup +% "3C % \arrowvert +% "3D % \Arrowvert +% "3E % \bracevert +% "3F % \updownarrow +% "40 % \lmoustache +% "41 % \rmoustache +% "46 % \bigsqcup +% "48 % \ointop +% "4A % \bigodot +% "4C % \bigoplus +% "4E % \bigotimes +% "50 % \sum +% "51 % \prod +% "52 % \intop +% "53 % \bigcup +% "54 % \bigcap +% "55 % \biguplus +% "56 % \bigwedge +% "57 % \bigvee +% "60 % \coprod +% "70 % \sqrtsign +% "77 % \Updownarrow +% "78 % \uparrow +% "79 % \downarrow +% "7A % \braceld, \lmoustache +% "7B % \bracerd, \rmoustache +% "7C % \bracelu +% "7D % \braceru +% "7E % \Uparrow +% "7F % \Downarrow +% } +% +% +% \end{macrocode} +% +% \subsubsection{\ams\ fonts} +% +% \begin{macrocode} +%<*cfg-u> +% \end{macrocode} +% Symbol font `a', defined in \pkg{amssymb}. +% +%\begin{verbatim} +%\DeclareSymbolFont{AMSa}{U}{msa}{m}{n} +%\end{verbatim} +% \begin{macrocode} +%<*msa> +\SetProtrusion + [ name = AMSa ] + { encoding = U, + family = msa } + { +% "00 = { , }, % \boxdot +% "01 = { , }, % \boxplus +% "02 = { , }, % \boxtimes +% "03 = { , }, % \square +% "04 = { , }, % \blacksquare + "05 = {150,250}, % \centerdot + "06 = {100,100}, % \lozenge + "07 = { 50, 50}, % \blacklozenge + "08 = { 50, 50}, % \circlearrowright + "09 = { 50, 50}, % \circlearrowleft + "0A = { 50, 50}, % \rightleftharpoons + "0B = { 50, 50}, % \leftrightharpoons +% "0C = { , }, % \boxminus + "0D = {-50,150}, % \Vdash + "0E = {-50,150}, % \Vvdash + "0F = {-70,150}, % \vDash + "10 = {100,100}, % \twoheadrightarrow + "11 = { 50,150}, % \twoheadleftarrow + "12 = { 50,100}, % \leftleftarrows + "13 = { 50, 80}, % \rightrightarrows + "14 = {120,120}, % \upuparrows + "15 = {120,120}, % \downdownarrows + "16 = {200,200}, % \upharpoonright + "17 = {200,200}, % \downharpoonright + "18 = {200,200}, % \upharpoonleft + "19 = {200,200}, % \downharpoonleft + "1A = { 50, 80}, % \rightarrowtail + "1B = { 50, 80}, % \leftarrowtail + "1C = { 50, 50}, % \leftrightarrows + "1D = { 50, 50}, % \rightleftarrows + "1E = {150, }, % \Lsh + "1F = { ,150}, % \Rsh + "20 = { 50,100}, % \rightsquigarrow + "21 = { 50, 50}, % \leftrightsquigarrow + "22 = { 50, 50}, % \looparrowleft + "23 = { 50, 50}, % \looparrowright + "24 = { , 50}, % \circeq + "25 = { ,100}, % \succsim + "26 = { ,100}, % \gtrsim + "27 = { ,100}, % \gtrapprox + "28 = { 50, 50}, % \multimap +% "29 = { , }, % \therefore +% "2A = { , }, % \because + "2B = { 50, 50}, % \doteqdot + "2C = { 50, 50}, % \triangleq + "2D = {100, 50}, % \precsim + "2E = {100, 50}, % \lesssim + "2F = { 50, 50}, % \lessapprox + "30 = {100, 50}, % \eqslantless + "31 = { 50, 50}, % \eqslantgtr + "32 = {100, 50}, % \curlyeqprec + "33 = { 50,100}, % \curlyeqsucc + "34 = {100, 50}, % \preccurlyeq +% "35 = { , }, % \leqq + "36 = { 50, }, % \leqslant +% "37 = { , }, % \lessgtr + "38 = { , 50}, % \backprime + "39 = {200,200}, % \dabar@ : the dash bar in \dash(left,right)arrow +% "3A = { , }, % \risingdotseq +% "3B = { , }, % \fallingdotseq + "3C = { 50,100}, % \succcurlyeq +% "3D = { , }, % \geqq + "3E = { , 50}, % \geqslant +% "3F = { , }, % \gtrless + "40 = { , 50}, % \sqsubset + "41 = { 50, }, % \sqsupset + "42 = { ,150}, % \vartriangleright, \rhd + "43 = {150, }, % \vartriangleleft, \lhd + "44 = { ,100}, % \trianglerighteq, \unrhd + "45 = {100, }, % \trianglelefteq, \unlhd + "46 = {100,100}, % \bigstar +% "47 = { , }, % \between + "48 = { 50, 50}, % \blacktriangledown + "49 = { ,100}, % \blacktriangleright + "4A = {100, }, % \blacktriangleleft + "4B = { ,150}, % \dashrightarrow (the arrow) + "4C = {150, }, % \dashleftarrow + "4D = { 50, 50}, % \vartriangle + "4E = { 50, 50}, % \blacktriangle + "4F = { 50, 50}, % \triangledown + "50 = { 50, 50}, % \eqcirc +% "51 = { , }, % \lesseqgtr +% "52 = { , }, % \gtreqless +% "53 = { , }, % \lesseqqgtr +% "54 = { , }, % \gtreqqless +% "55 = { , }, % \yen + "56 = { ,150}, % \Rrightarrow + "57 = {150, }, % \Lleftarrow + "58 = {100,200}, % \checkmark +% "59 = { , }, % \veebar +% "5A = { , }, % \barwedge +% "5B = { , }, % \doublebarwedge + "5C = { 50, 50}, % \angle + "5D = { 50, 50}, % \measuredangle + "5E = { 50, 50}, % \sphericalangle + "5F = { , 50}, % \varpropto + "60 = {100,100}, % \smallsmile + "61 = {100,100}, % \smallfrown + "62 = { 50, }, % \Subset + "63 = { , 50}, % \Supset +% "64 = { , }, % \Cup +% "65 = { , }, % \Cap + "66 = {100,100}, % \curlywedge + "67 = {100,100}, % \curlyvee + "68 = { 50,100}, % \leftthreetimes + "69 = {100, 50}, % \rightthreetimes +% "6A = { , }, % \subseteqq +% "6B = { , }, % \supseteqq + "6C = { 50, 50}, % \bumpeq + "6D = { 50, 50}, % \Bumpeq + "6E = {100, }, % \lll + "6F = { ,100}, % \ggg + "70 = { 50,100}, % \ulcorner + "71 = {100, 50}, % \urcorner +% "72 = { , }, % \circledR +% "73 = { , }, % \circledS +% "74 = { , }, % \pitchfork + "75 = {100,150}, % \dotplus + "76 = { 50,100}, % \backsim +% "77 = { , }, % \backsimeq + "78 = { 50,100}, % \llcorner + "79 = {100, 50}, % \lrcorner +% "7A = { , }, % \maltese +% "7B = { , }, % \complement + "7C = {100,100}, % \intercal + "7D = { 50, 50}, % \circledcirc + "7E = { 50, 50}, % \circledast + "7F = { 50, 50}, % \circleddash + } + +% +% \end{macrocode} +% Symbol font `b'. +% +%\begin{verbatim} +%\DeclareSymbolFont{AMSb}{U}{msb}{m}{n} +%\DeclareSymbolFontAlphabet{\mathbb}{AMSb} +%\end{verbatim} +% \begin{macrocode} +%<*msb> +\SetProtrusion + [ name = AMSb ] + { encoding = U, + family = msb } + { + A = { 50, 50}, % \mathbb + C = { 50, 50}, + G = { , 50}, + L = { , 50}, + P = { , 50}, + R = { , 50}, + T = { , 50}, + V = { 50, 50}, + X = { 50, 50}, + Y = { 50, 50}, + "00 = { 50, 50}, % \lvertneqq + "01 = { 50, 50}, % \gvertneqq + "02 = { 50, 50}, % \nleq + "03 = { 50, 50}, % \ngeq + "04 = {100, 50}, % \nless + "05 = { 50,150}, % \ngtr + "06 = {100, 50}, % \nprec + "07 = { 50,150}, % \nsucc + "08 = { 50, 50}, % \lneqq + "09 = { 50, 50}, % \gneqq + "0A = {100,100}, % \nleqslant + "0B = {100,100}, % \ngeqslant + "0C = {100, 50}, % \lneq + "0D = { 50,100}, % \gneq + "0E = {100, 50}, % \npreceq + "0F = { 50,100}, % \nsucceq + "10 = { 50, }, % \precnsim + "11 = { 50, 50}, % \succnsim + "12 = { 50, 50}, % \lnsim + "13 = { 50, 50}, % \gnsim + "14 = { 50, 50}, % \nleqq + "15 = { 50, 50}, % \ngeqq + "16 = { 50, 50}, % \precneqq + "17 = { 50, 50}, % \succneqq + "18 = { 50, 50}, % \precnapprox + "19 = { 50, 50}, % \succnapprox + "1A = { 50, 50}, % \lnapprox + "1B = { 50, 50}, % \gnapprox + "1C = {150,200}, % \nsim + "1D = { 50, 50}, % \ncong + "1E = {100,150}, % \diagup + "1F = {100,150}, % \diagdown + "20 = {100, 50}, % \varsubsetneq + "21 = { 50,100}, % \varsupsetneq + "22 = {100, 50}, % \nsubseteqq + "23 = { 50,100}, % \nsupseteqq + "24 = {100, 50}, % \subsetneqq + "25 = { 50,100}, % \supsetneqq + "26 = {100, 50}, % \varsubsetneqq + "27 = { 50,100}, % \varsupsetneqq + "28 = {100, 50}, % \subsetneq + "29 = { 50,100}, % \supsetneq + "2A = {100, 50}, % \nsubseteq + "2B = { 50,100}, % \nsupseteq + "2C = { 50,100}, % \nparallel + "2D = {100,150}, % \nmid + "2E = {150,150}, % \nshortmid + "2F = {100,100}, % \nshortparallel + "30 = { ,150}, % \nvdash + "31 = { ,150}, % \nVdash + "32 = { ,100}, % \nvDash + "33 = { ,100}, % \nVDash + "34 = { ,100}, % \ntrianglerighteq + "35 = {100, }, % \ntrianglelefteq + "36 = {100, }, % \ntriangleleft + "37 = { ,100}, % \ntriangleright + "38 = {100,200}, % \nleftarrow + "39 = {100,200}, % \nrightarrow + "3A = {100,100}, % \nLeftarrow + "3B = { 50,100}, % \nRightarrow + "3C = {100,100}, % \nLeftrightarrow + "3D = {100,200}, % \nleftrightarrow + "3E = { 50, 50}, % \divideontimes + "3F = { 50, 50}, % \varnothing +% "40 = { , }, % \nexists + "60 = {200, }, % \Finv + "61 = { , 50}, % \Game +% "66 = { , }, % \mho +% "67 = { , }, % \eth + "68 = {100,100}, % \eqsim + "69 = { 50, }, % \beth + "6A = { 50, }, % \gimel + "6B = {150, }, % \daleth + "6C = {200, }, % \lessdot + "6D = { ,200}, % \gtrdot + "6E = {100,200}, % \ltimes + "6F = {150,100}, % \rtimes + "70 = { 50,100}, % \shortmid + "71 = { 50, 50}, % \shortparallel + "72 = {200,300}, % \smallsetminus + "73 = {100,200}, % \thicksim + "74 = { 50,100}, % \thickapprox + "75 = { 50, 50}, % \approxeq + "76 = { 50,100}, % \succapprox + "77 = { 50, 50}, % \precapprox + "78 = {100,100}, % \curvearrowleft + "79 = { 50,150}, % \curvearrowright + "7A = { 50,200}, % \digamma + "7B = {100, 50}, % \varkappa +% "7C = { , }, % \Bbbk +% "7D = { , }, % \hslash +% "7E = { , }, % \hbar + "7F = {200, }, % \backepsilon + } + +% +% \end{macrocode} +% Euler Fraktur font (\pkg{eufrak}). +% +%\begin{verbatim} +%\DeclareMathAlphabet{\mathfrak}{U}{euf}{m}{n} +%\SetMathAlphabet{\mathfrak}{bold}{U}{euf}{b}{n} +%\end{verbatim} +% \begin{macrocode} +%<*euf> +\SetProtrusion + [ name = mathfrak ] + { encoding = U, + family = euf } + { + A = { , 50}, + B = { , 50}, + C = { 50, 50}, + D = { , 80}, + E = { 50, }, + G = { , 50}, + L = { , 80}, + O = { , 50}, + T = { , 80}, + X = { 80, 50}, + Z = { 80, 50}, + b = { , 50}, + c = { , 50}, + k = { , 50}, + p = { , 50}, + q = { 50, }, + v = { , 50}, + w = { , 50}, + x = { , 50}, + 1 = {100,100}, + 2 = { 80, 80}, + 3 = { 80, 50}, + 4 = { 80, 50}, + 7 = { 50, 50}, + } + +% +% \end{macrocode} +% Euler script font (\pkg{eucal}). +% +%\begin{verbatim} +%\DeclareMathAlphabet\EuScript{U}{eus}{m}{n} +%\SetMathAlphabet\EuScript{bold}{U}{eus}{b}{n} +%\end{verbatim} +% \begin{macrocode} +%<*eus> +\SetProtrusion + [ name = euscript ] + { encoding = U, + family = eus } + { + A = {100,100}, + B = { 50,100}, + C = { 50, 50}, + D = { 50,100}, + E = { 50,100}, + F = { 50, }, + G = { 50, }, + H = { ,100}, + K = { , 50}, + L = { ,150}, + M = { , 50}, + N = { , 50}, + O = { 50, 50}, + P = { 50, 50}, + T = { ,100}, + U = { , 50}, + V = { 50, 50}, + W = { 50, 50}, + X = { 50, 50}, + Z = { 50,100}, + } + +% +% +%<*beta> +% \end{macrocode} +% +% \subsection{Interword Spacing}\label{sub:conf-spacing} +% +% Default unit is space. +% +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% INTERWORD SPACING SETTINGS + +\SetExtraSpacing + [ name = default ] + { encoding = {OT1,T1,LY1,OT4,T5} } + { +% \end{macrocode} +% These settings are only a first approximation. The following reasoning is from +% a mail from Ulrich Dirr. ^^A private mail, 14/06/2005 +% I do not claim to have coped with the task. +% +%\begin{quote} +% `The idea is -- analog to the tables for expansion and protrusion -- to +% have tables for optical reduction/expansion of spaces in dependence of the +% actual character so that the distance between words is optically equal. +% +% When reducing distances the (weighting) order is: +% +% \begin{itemize} +% \item after commas +% \begin{macrocode} + {,} = { ,-500,500}, +% \end{macrocode} +% \item in front of capitals which have optical more room on their left +% side, \eg, `A', `J', `T', `V', `W', and `Y' +% [this is not yet possible -- RS] +% \item in front of capitals which have circle/oval shapes on their left +% side, \eg, `C', `G', `O', and `Q' +% [ditto -- RS] +% \item after `r' (because of the bigger optical room on the righthand side) +% \begin{macrocode} + r = { ,-300,300}, +% \end{macrocode} +% \item before or after lowercase characters with ascenders +% \begin{macrocode} + b = { ,-200,200}, + d = { ,-200,200}, + f = { ,-200,200}, + h = { ,-200,200}, + k = { ,-200,200}, + l = { ,-200,200}, + t = { ,-200,200}, +% \end{macrocode} +% \item before of after lowercase characters with x-heigth plus descender +% with additional optical space, \eg, `v', or `w' +% \begin{macrocode} + c = { ,-100,100}, + p = { ,-100,100}, + v = { ,-100,100}, + w = { ,-100,100}, + z = { ,-100,100}, + x = { ,-100,100}, + y = { ,-100,100}, % ? +% \end{macrocode} +% \item before of after lowercase characters with x-heigth plus descender +% without additional optical space +% \begin{macrocode} + i = { , 50, -50}, + m = { , 50, -50}, + n = { , 50, -50}, + u = { , 50, -50}, +% \end{macrocode} +% \item after colon and semicolon +% \begin{macrocode} + : = { ,200,-200}, + ; = { ,200,-200}, +% \end{macrocode} +% \item after punctuation which ends a sentence, \eg, period, exclamation +% mark, question mark +% \begin{macrocode} + . = { ,250,-250}, + ! = { ,250,-250}, + ? = { ,250,-250}, +% \end{macrocode} +%\end{itemize} +% The order has to be reversed when enlarging is needed.' +%\end{quote} +% \begin{macrocode} + } + +% \end{macrocode} +% Questions are: +%\begin{itemize} +% \item Is the result really better? +% \item Is it overdone? (Try with a |factor| \textless\ 1000.) +% \item Should the first parameter also be used? (Probably.) +%\end{itemize} +% +% The following settings simulate \cmd{\nonfrenchspacing} (since space factors +% will be ignored when spacing adjustment is in effect). They may be used for +% English contexts. +% +% From the \TeX book: +%\begin{quote} +% `If the space factor \textit{f} is different from 1000, the interword glue is +% computed as follows: Take the normal space glue for the current font, and +% add the extra space if \textit{f}\,\textgeq\,2000. +% [...] +% Then the stretch component is multiplied by \textit{f}\,/\,1000, while the +% shrink component is multiplied by 1000\,/\,\textit{f}.' +%\end{quote} +% The `extra space' (\cmd{\fontdimen}7) for Computer Modern Roman is a third +% of \cmd{\fontdimen}\,2, \ie, 333. +% \begin{macrocode} +\SetExtraSpacing + [ name = nonfrench-cmr, + load = default, + context = nonfrench ] + { encoding = {OT1,T1,LY1,OT4,T5}, + family = cmr } + { +% \end{macrocode} +% \file{latex.ltx} has: +%\begin{verbatim} +%\def\nonfrenchspacing{ +% \sfcode`\. 3000 +%\end{verbatim} +% \begin{macrocode} + . = {333,2000,-667}, +% \end{macrocode} +%\begin{verbatim} +% \sfcode`\? 3000 +%\end{verbatim} +% \begin{macrocode} + ? = {333,2000,-667}, +% \end{macrocode} +%\begin{verbatim} +% \sfcode`\! 3000 +%\end{verbatim} +% \begin{macrocode} + ! = {333,2000,-667}, +% \end{macrocode} +%\begin{verbatim} +% \sfcode`\: 2000 +%\end{verbatim} +% \begin{macrocode} + : = {333,1000,-500}, +% \end{macrocode} +%\begin{verbatim} +% \sfcode`\; 1500 +%\end{verbatim} +% \begin{macrocode} + ; = { , 500,-333}, +% \end{macrocode} +%\begin{verbatim} +% \sfcode`\, 1250 +%\end{verbatim} +% \begin{macrocode} + {,}= { , 250,-200}, +% \end{macrocode} +%\begin{verbatim} +%} +%\end{verbatim} +% \begin{macrocode} + } + +% \end{macrocode} +% \pkg{fontinst}, however, which is also used to create the \pkg{PSNFSS} font +% metrics, sets it to 240 by default. Therefore, the fallback settings use this +% value for the first component. +% \begin{macrocode} +\SetExtraSpacing + [ name = nonfrench-default, + load = default, + context = nonfrench ] + { encoding = {OT1,T1,LY1,OT4,T5} } + { + . = {240,2000,-667}, + ? = {240,2000,-667}, + ! = {240,2000,-667}, + : = {240,1000,-500}, + ; = { , 500,-333}, + {,}= { , 250,-200}, + } + +% \end{macrocode} +% +% \subsection{Additional Kerning} +% +% Default unit is 1em. +% +% \begin{macrocode} +%%% ---------------------------------------------------------------------- +%%% ADDITIONAL KERNING + +% \end{macrocode} +% A dummy list to be loaded when no context is active. +% \begin{macrocode} +\SetExtraKerning + [ name = empty ] + { encoding = {OT1,T1,LY1,OT4,T5,TS1} } + { } + +\SetExtraKerning + [ name = french-default, + context = french, + unit = space ] + { encoding = {OT1,T1,LY1} } + { + : = {1000,}, % = \fontdimen2 + ; = {500, }, % ~ \thinspace + ! = {500, }, + ? = {500, }, + } + +% \end{macrocode} +% This has the disadvantage that the word following a left guillemot will not be +% hyphenated. This might be fixed in \pdftex. +% \begin{macrocode} +\SetExtraKerning + [ name = french-guillemets, + context = french-guillemets, + load = french-default, + unit = space ] + { encoding = {OT1,T1,LY1} } + { + \guillemotleft = { ,800}, % = 0.8\fontdimen2 + \guillemotright = {800, }, + } + +\SetExtraKerning + [ name = turkish, + context = turkish, + unit = space ] + { encoding = {OT1,T1,LY1} } + { + : = {500, }, % ~ \thinspace + ! = {500, }, + {=} = {500, }, + } + +% \end{macrocode} +% The settings with the `|letterspacing|' context will be loaded whenever the +% command \cs{textls} resp. \cs{lsstyle} are used. +% \begin{macrocode} +%%% The settings for the commands \lsstyle and \textls. +\SetExtraKerning + [ name = letterspacing-default, + context = letterspacing, + unit = 1em, + preset = {1000,1000} ] + { encoding = {OT1,OT4} } + { +% \end{macrocode} +% The full stop and quotation marks should be spaced out less. +% Numbers are not spaced out, according to \pkg{soul}. +% \begin{macrocode} + . = {0, }, + 0 = {0,0}, + 1 = {0,0}, + 2 = {0,0}, + 3 = {0,0}, + 4 = {0,0}, + 5 = {0,0}, + 6 = {0,0}, + 7 = {0,0}, + 8 = {0,0}, + 9 = {0,0}, + \textquoteleft = {0,0}, \textquoteright = {0,0}, + \textquotedblleft = {0,0}, \textquotedblright = {0,0}, + } + +\SetExtraKerning + [ name = letterspacing-T1, + load = letterspacing-default, + context = letterspacing, + unit = 1em, + preset = {1000,1000} ] + { encoding = {T1,LY1,T5} } + { + \quotesinglbase = {0,0}, \quotedblbase = {0,0}, + \guilsinglleft = {0,0}, \guilsinglright = {0,0}, + \guillemotleft = {0,0}, \guillemotright = {0,0}, + } + +% +% +% \end{macrocode} +%\GeneralChanges! +% +%\section{Auxiliary File for Micro Fine Tuning} +% +% This file can be used to test protrusion and expansion settings. +% \begin{macrocode} +%<*test> +\documentclass{article} + +%% Here you can set the font you want to test, using +%% the commands \fontfamily, \fontseries, and \fontshape. +%% Make sure to end all lines with a comment character! +\newcommand*{\TestFont}{% + \fontfamily{ppl}% +%% \fontseries{b}% +%% \fontshape{it}% sc, sl +} + +\usepackage{ifthen} +\usepackage[T1]{fontenc} +%%\usepackage[latin1]{inputenc} +\usepackage[verbose,expansion=alltext,stretch=50]{microtype} + +\pagestyle{empty} +\setlength{\parindent}{0pt} +\newcommand*{\crulefill}{\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill} +\newcommand*{\testprotrusion}[2][]{% + \ifthenelse{\equal{#1}{r}}{}{#2}% + lorem ipsum dolor sit amet, + \ifthenelse{\equal{#1}{r}}{\crulefill}{\leftarrowfill} #2 + \ifthenelse{\equal{#1}{l}}{\crulefill}{\rightarrowfill} + you know the rest% + \ifthenelse{\equal{#1}{l}}{}{#2}% + \linebreak + {\fontencoding{\encodingdefault}% + \fontseries{\seriesdefault}% + \fontshape{\shapedefault}% + \selectfont + Here is the beginning of a line, \dotfill and here is its end}\linebreak +} +\newcommand*{\showTestFont}{\expandafter\stripprefix\meaning\TestFont} +\def\stripprefix#1>{} +\newcount\charcount +\begin{document} + +\microtypesetup{expansion=false} + +{\centering The font in this document is called by:\\ + \texttt{\showTestFont}\par}\bigskip + +\TestFont\selectfont + This line intentionally left empty\linebreak +%% A -- Z +\charcount=65 +\loop + \testprotrusion{\char\charcount} + \advance\charcount 1 + \ifnum\charcount < 91 \repeat +%% a -- z +\charcount=97 +\loop + \testprotrusion{\char\charcount} + \advance\charcount 1 + \ifnum\charcount < 123 \repeat +%% 0 -- 9 +\charcount=48 +\loop + \testprotrusion{\char\charcount} + \advance\charcount 1 + \ifnum\charcount < 58 \repeat +%% + \testprotrusion[r]{,} + \testprotrusion[r]{.} + \testprotrusion[r]{;} + \testprotrusion[r]{:} + \testprotrusion[r]{?} + \testprotrusion[r]{!} + \testprotrusion[l]{\textexclamdown} + \testprotrusion[l]{\textquestiondown} + \testprotrusion[r]{)} + \testprotrusion[l]{(} + \testprotrusion{/} + \testprotrusion{\char`\\} + \testprotrusion{-} + \testprotrusion{\textendash} + \testprotrusion{\textemdash} + \testprotrusion{\textquoteleft} + \testprotrusion{\textquoteright} + \testprotrusion{\textquotedblleft} + \testprotrusion{\textquotedblright} + \testprotrusion{\quotesinglbase} + \testprotrusion{\quotedblbase} + \testprotrusion{\guilsinglleft} + \testprotrusion{\guilsinglright} + \testprotrusion{\guillemotleft} + \testprotrusion{\guillemotright} + +\bigskip +The following displays the current font stretched by 5\%, +normal, and shrunk by 5\%: + +\microtypesetup{expansion=true} + +\bigskip +\newlength{\MTln} +\newcommand*{\teststring} + {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789} +\settowidth{\MTln}{\teststring} + +\parbox{1.05\MTln}{\teststring\linebreak\\ + \teststring}\par\bigskip +\parbox{0.95\MTln}{\teststring} +\end{document} +% +% \end{macrocode} +% +% ^^A ------------------------------------------------------------------------- +% Needless to say that things may always be improved. For suggestions, mail to +% \mailtoRS. +% +% ^^A ------------------------------------------------------------------------- +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \CheckSum{7591} +% +% \Finale +% +\endinput +% diff --git a/Master/texmf-dist/source/latex/microtype/microtype.ins b/Master/texmf-dist/source/latex/microtype/microtype.ins new file mode 100644 index 00000000000..0c700a5c05c --- /dev/null +++ b/Master/texmf-dist/source/latex/microtype/microtype.ins @@ -0,0 +1,106 @@ +% -*- TeX:UK -*- +% $Id: microtype.ins,v 1.8 2005-10-28 16:22:21+02 schlicht Exp schlicht $ +% ----------------------------------------------------------------------- +\newif\ifbeta +%\betatrue +\input docstrip +\keepsilent +\askonceonly + +\preamble + +----------------------------------------------------------------------- + The `microtype' package + An interface to the micro-typographic extensions of pdfTeX + Copyright (c) 2004, 2005 R Schlicht + +This work may be distributed and/or modified under the conditions of +the LaTeX Project Public License, either version 1.3 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.3 or later +is part of all distributions of LaTeX version 2003/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 file microtype.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. +----------------------------------------------------------------------- + +\endpreamble +{\catcode`\^^M=13 % + \gdef\declarepreambleX#1#2 +\endpreamble{\endgroup% + \def^^M{^^J\MetaPrefix\space}% + \edef#1{\firstpreamblepart\checkeoln#2\empty +-----------------------------------------------------------------------^^M}}} + +\let\firstpreamblepart\defaultpreamble +\declarepreamble\cfgpreamble + This is the main configuration file for the `microtype' package. + It contains settings for font expansion and character protrusion. + Please consult the documentation for details. + + You may customize these settings here, or in a different file. If + you think you have found improvements to the settings, please tell + me about them. + + When modifying this file, also change the identification line below. +\endpreamble +% --------------------------------------------------------------------- +\declarepreamble\fontpreamble + This is a font-specific configuration file for the `microtype' + package. It contains settings for font expansion and character + protrusion. Please consult the documentation for details. + + If you think you have found improvements to these settings, please + tell me about them. + + When modifying this file, also change the identification line below. +\endpreamble +% --------------------------------------------------------------------- +\declarepreamble\testpreamble + This file might be useful to test protrusion settings for a font. + You can do whatever you want with it. +\endpreamble +% --------------------------------------------------------------------- +\let\firstpreamblepart\fontpreamble +\declarepreamble\haraldpreamble + + These settings have been prepared by, and are copied with the + generous permission of, Harald Harders . + +\endpreamble +% --------------------------------------------------------------------- + +\generate{ + \file{microtype.sty}{\from{microtype.dtx}{package\ifbeta,beta\fi}} + \usepreamble\cfgpreamble + \file{microtype.cfg}{\from{microtype.dtx}{config,m-t\ifbeta,beta\fi}} + \usepreamble\fontpreamble + \file{mt-bch.cfg}{\from{microtype.dtx}{config,bch}} + \file{mt-cmr.cfg}{\from{microtype.dtx}{config,cmr}} + \file{mt-pad.cfg}{\from{microtype.dtx}{config,pad}} + \file{mt-ppl.cfg}{\from{microtype.dtx}{config,ppl}} + \file{mt-ptm.cfg}{\from{microtype.dtx}{config,ptm}} + \file{mt-msa.cfg}{\from{microtype.dtx}{config,cfg-u,msa}} + \file{mt-msb.cfg}{\from{microtype.dtx}{config,cfg-u,msb}} + \file{mt-euf.cfg}{\from{microtype.dtx}{config,cfg-u,euf}} + \file{mt-eus.cfg}{\from{microtype.dtx}{config,cfg-u,eus}} + \usepreamble\haraldpreamble + \file{mt-pmn.cfg}{\from{microtype.dtx}{config,pmn}} + \usepreamble\testpreamble + \file{test-microtype.tex}{\from{microtype.dtx}{test}} +} + +\obeyspaces +\Msg{***********************************************************************} +\Msg{* To finish installation, move all files to their appropriate places. *} +\Msg{* See the documentation for details. *} +\Msg{* You can create the documentation by running latex on microtype.dtx. *} +\Msg{***********************************************************************} + +\endbatchfile -- cgit v1.2.3