summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/microtype/microtype.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/microtype/microtype.dtx')
-rw-r--r--macros/latex/contrib/microtype/microtype.dtx4140
1 files changed, 3095 insertions, 1045 deletions
diff --git a/macros/latex/contrib/microtype/microtype.dtx b/macros/latex/contrib/microtype/microtype.dtx
index 088b55ea1f..942782e93d 100644
--- a/macros/latex/contrib/microtype/microtype.dtx
+++ b/macros/latex/contrib/microtype/microtype.dtx
@@ -1,7 +1,5 @@
%\iffalse meta-comment
-% !Mode:: "TeX:DTX:UK"
-% !smartQuote:: "English"
-% !DTXversion:: "2.8c"
+%
% ------------------------------------------------------------------------
% The `microtype' package
% Subliminal refinements towards typographical perfection
@@ -13,46 +11,49 @@
% http://www.latex-project.org/lppl.txt, and version 1.3c or later is part
% of all distributions of LaTeX version 2005/12/01 or later.
%
-% This work has the LPPL maintenance status `author-maintained'.
+% This work has the LPPL maintenance status `maintained'.
%
-% This work consists of the files microtype.dtx and microtype.ins and the
-% derived files microtype.sty, microtype-pdftex.def, microtype-luatex.def,
-% microtype-xetex.def, microtype.lua and letterspace.sty.
+% This work consists of the files microtype.dtx, microtype-utf.dtx and
+% microtype.ins and the derived files microtype.sty, microtype-pdftex.def,
+% microtype-luatex.def, microtype-xetex.def, microtype.lua, letterspace.sty
+% and microtype-show.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.
% ------------------------------------------------------------------------
%
-%<package|letterspace>\NeedsTeXFormat{LaTeX2e}
+%<package|letterspace|show>\NeedsTeXFormat{LaTeX2e}
%<*driver>
\ProvidesFile{\jobname.dtx}
%</driver>
-%<package|letterspace>\ProvidesPackage
-%<config|pdftex-def|luatex-def|xetex-def>\ProvidesFile
+%<package|letterspace|show>\ProvidesPackage
+%<config|pdf-|lua-|xe->\ProvidesFile
%<package> {microtype}
%<letterspace> {letterspace}
+%<show> {microtype-show}
%<m-t> {microtype.cfg}
-%<pdftex-def> {microtype-pdftex.def}
-%<luatex-def> {microtype-luatex.def}
-%<xetex-def> {microtype-xetex.def}
-%<*package|letterspace|m-t|pdftex-def|luatex-def|xetex-def>
- [2021/03/14 v2.8c
+%<pdf-> {microtype-pdftex.def}
+%<lua-> {microtype-luatex.def}
+%<xe-> {microtype-xetex.def}
+%<*package|letterspace|m-t|pdf-|lua-|xe-|show>
+ [2021/10/31 v3.0
%<package> Micro-typographical refinements
%<letterspace> Robust letterspacing
+%<show> Visual debugging for the microtype package
%<m-t> microtype main configuration file
-%<pdftex-def|luatex-def|xetex-def> Definitions specific to
-%<pdftex-def> pdftex
-%<luatex-def> luatex
-%<xetex-def> xetex
+%<pdf-|lua-|xe-> Definitions specific to
+%<pdf-> pdftex
+%<lua-> luatex
+%<xe-> xetex
(RS)]
-%</package|letterspace|m-t|pdftex-def|luatex-def|xetex-def>
+%</package|letterspace|m-t|pdf-|lua-|xe-|show>
%<luafile>microtype = microtype or {}
%<luafile>local microtype = microtype
%<luafile>microtype.module = {
%<luafile> name = "microtype",
-%<luafile> version = "2.8c",
-%<luafile> date = "2021/03/14",
+%<luafile> version = "3.0",
+%<luafile> date = "2021/10/31",
%<luafile> description = "microtype module.",
%<luafile> author = "E. Roux, R. Schlicht and P. Gesang",
%<luafile> copyright = "E. Roux, R. Schlicht and P. Gesang",
@@ -62,7 +63,7 @@
%<bch> {mt-bch.cfg}[2007/03/03 v1.5 microtype config. file: Bitstream Charter (RS)]
%<blg> {mt-blg.cfg}[2007/07/14 v1.0 microtype config. file: Bitstream Letter Gothic (RS)]
%<cmr> {mt-cmr.cfg}[2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS)]
-%<ebg> {mt-EBGaramond.cfg}[2021/02/22 v1.6 microtype config. file: EB Garamond / Adobe Garamond (RS)]
+%<ebg> {mt-EBGaramond.cfg}[2021/10/25 v2.0 microtype config. file: EB Garamond / Adobe Garamond (RS)]
%<pmn> {mt-pmn.cfg}[2009/11/14 v1.3 microtype config. file: Adobe Minion (HH/KK)]
%<ppl> {mt-ppl.cfg}[2005/11/16 v1.6 microtype config. file: Palatino (RS)]
%<ptm> {mt-ptm.cfg}[2006/04/20 v1.7 microtype config. file: Times (RS)]
@@ -81,17 +82,29 @@
\documentclass[10pt,a4paper]{ltxdoc}
\makeatletter
%</driver>
+% Compiling microtype.dtx with the command line option
+% --jobname=microtype-code
+% will produce the document microtype-code.pdf,
+% containing only the Implementation.
+\expandafter\newif\csname ifcodedoc\endcsname
+\edef\@tempa{\jobname}
+\edef\@tempb{\detokenize{microtype-code}}
+\ifx\@tempa\@tempb
+ \codedoctrue
+\fi
+%<docsty>\codedoctrue
% Let's abolish CM! We use Charter and Letter Gothic
% (for the pre-built documentation on CTAN):
-\usepackage[T1]{fontenc}
+\usepackage[LGR,T1]{fontenc}
\usepackage[charter]{mathdesign}
\def\rmdefault{bch} % not scaled
\def\sfdefault{SourceSansPro-TLF}
\def\SourceSansPro@scale{1.02}
- \def\ttdefault{blg}
+\IfFileExists{t1blg.fd}
+ {\def\ttdefault{blg}}
+ {\def\ttdefault{ulg}}
{\ttfamily\selectfont
- \DeclareFontShape{T1}{blg}{eb}{n}{<-> ssub * blg/b/n}{}}
-\usepackage{textcomp}
+ \DeclareFontShape{T1}{\ttdefault}{eb}{n}{<-> ssub * \ttdefault/b/n}{}}
\usepackage{iftex}
%<*!docsty>
\ifxetex\else
@@ -99,11 +112,11 @@
\fi
%</!docsty>
\GetFileInfo{\jobname.dtx}
-\usepackage[expansion=false,kerning=true]{microtype}[\filedate]
+\usepackage{microtype}[\filedate]
\DeclareMicrotypeSet*[protrusion]
{ doc }
{ encoding = {*, TS1, OMS},
- family = {rm*, tt*},
+ family = {rm*, sf*, tt*},
size = {footnotesize, small, normalsize} }
\SetProtrusion
{ encoding = OMS,
@@ -124,41 +137,23 @@
\DisableLigatures[?,!]{encoding = *, family = rm* }
\fi
% Fraktur sample in section \ref{sec:lettersp}
- \IfFileExists{t1mwr.fd}
- {\def\textfrak##1{{\fontfamily{mwr}\selectfont ##1}}
- \ifpdf
- \SetTracking[no ligatures={f,s,c}]{encoding=T1,family=mwr}{120}
- \fi}
- {\IfFileExists{yfonts.sty}
+\IfFileExists{t1mwr.fd}
+ {\def\textfrak##1{{\fontfamily{mwr}\selectfont ##1}}
+ \SetTracking[no ligatures={f,s,c}]{encoding=T1,family=mwr}{120}}
+ {\IfFileExists{yfonts.sty}
{\usepackage{yfonts}
- \ifpdf
- \SetTracking[no ligatures={f,s,c}]{encoding=LY,family=yfrak}{120}
- \fi}
+ \SetTracking[no ligatures={f,s,c}]{encoding=LY,family=yfrak}{120}}
{\def\textfrak{\rule{.5em}{1.5ex}\@gobble}}}
-\ifpdftex\else
- \microtypesetup{kerning=false}
+\ifpdftex
+ \microtypesetup{kerning=true}
+\fi
+\ifluatex % microtype.dtx finally compiles with 0.35!
+ \usepackage{luatex85}
\fi
-\tolerance=700
\ifpdf
- \ifluatex % microtype.dtx finally compiles with 0.35!
- \def\pdftexversion{200} % in TeX Live 2015, they let this to \luatexversion
- \let\pdfxform \saveboxresource
- \let\pdflastxform \lastsavedboxresourceindex
- \protected\edef\pdfminorversion {\pdfvariable minorversion}
- \protected\def\pdfobj {\pdfextension obj }
- \protected\def\pdfcatalog {\pdfextension catalog }
- \protected\def\pdfannot {\pdfextension annot }
- \protected\def\pdfoutline {\pdfextension outline }
- \protected\def\pdfmapline {\pdfextension mapline }
- \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode }
- \protected\def\pdflastobj {\numexpr\pdffeedback lastobj\relax}
- \fi
- \ifnum\pdftexversion<140 \else % pdftex 1.40, including textmatrix patch,
- \microtypesetup{expansion=alltext,step=1} % hence we can activate expansion ...
- \tolerance=300 % ... and make TeX almost as intolerant as it normally is
- \g@addto@macro\macrocode{\microtypesetup{expansion=false}}
- \pdfminorversion=5 % for the OCGs (default since TeX Live 2010)
- \fi
+ \microtypesetup{expansion=alltext} % with activated expansion ...
+ \tolerance=300 % ... we can make TeX almost as intolerant as it normally is
+ \g@addto@macro\macrocode{\microtypesetup{expansion=false}}
% bonus material
\InputIfFileExists{microtype-logo.dtx}\relax\relax
\InputIfFileExists{microtype-lssample.dtx}\relax\relax
@@ -179,6 +174,7 @@
\definecolor{theframe} {gray}{0.75}
\definecolor{theshade} {gray}{0.94}
\usepackage{graphicx}
+\usepackage{etoolbox}
% general layout
\frenchspacing
\DeclareRobustCommand\textoractual[2]{\ifpdf
@@ -196,7 +192,7 @@
\setlength\textheight{49\baselineskip}
\else
\let\bfdefault\bfdefault@previous % undo mathdesign's \def\bfdefault{b}
- \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\textit{#1}\textoractual{$\rangle$}{>}}}
+ \def\Module#1{{\color{theblue}\textoractual{$\langle$}{<}\texttt{\itshape#1}\textoractual{$\rangle$}{>}}}
\DeclareRobustCommand\TeX{\textoractual{T\kern-.1em\lower.4ex\hbox{E}\kern-.075emX\@}{TeX}}
\DeclareRobustCommand\LaTeX{\textoractual{L\kern-.26em{\sbox\z@ T\vbox to\ht\z@{%
\hbox{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont A}%
@@ -212,32 +208,24 @@
\addtolength\textheight{\topskip}
\setlength\topmargin{5pt}
% sections
-%\def\@seccntformat#1{\setbox0\hbox to0pt{\hss\colorbox{theshade}{\space\color{sectioning}\csname the#1\endcsname\strut\space}\hskip\marginparsep}\ht0=0pt \dp0=0pt \box0}
\def\@seccntformat#1{\llap{\csname the#1\endcsname\hskip\marginparsep}}
-\def\section{\@startsection {section}{1}{\z@}%
- {-3.5ex \@plus -1ex \@minus -.2ex}%
- {2.3ex \@plus.2ex}%
- {\normalfont\Large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
-\def\subsection{\@startsection{subsection}{2}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\large\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
-\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\normalsize\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}}
+\def\MTsectionfont{\ifcmr\fontseries{bx}\else\fontseries{eb}\fi\sffamily\color{sectioning}}
+\patchcmd\section {\bfseries}{\MTsectionfont}\relax\relax
+\patchcmd\subsection {\bfseries}{\MTsectionfont}\relax\relax
+\patchcmd\subsubsection{\bfseries}{\MTsectionfont}\relax\relax
\def\paragraph{\@startsection{paragraph}{4}%
{0pt}{8pt plus 2pt minus 1pt}{-1em}%
{\normalfont\normalsize\itshape}}
% title
\def\@maketitle{%
\newpage\null\vskip 2em
- \begin{center}\let\footnote\thanks\sffamily
- {\huge \@title\par}\vskip 1.5em
- {\large \parbox{.33\textwidth}{\centering\@author}%
- \parbox{.33\textwidth}{\centering\@date}}%
- \vskip2.5em\rule{\textwidth}{.4pt}%
- \end{center}\par\vskip1.5em}
+ \begin{center}\sffamily
+ {\huge \@title\par\vskip 1.5em}%
+ {\large\hspace{4.5em}\parbox{.33\textwidth}{\@author}%
+ \parbox{.33\textwidth}{\@date}\par\vskip 1em
+ \textls*[-20]{\url{\githuburl}}}%
+ \vskip 2.5em\rule{\textwidth}{.4pt}%
+ \end{center}\par\vskip 1.5em}
\def\abstractname{}
% headers
\headheight=15pt
@@ -255,24 +243,17 @@
% toc
\let\l@section@\l@section
\def\l@section{\vskip -1.25ex\l@section@}
-\def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.7em}}
+\def\l@subsection{\vskip.35ex \penalty\@secpenalty \@dottedtocline{2}{1.5em}{2.2em}}
\def\l@subsubsection#1#2{%
- \leftskip 4.2em
+ \leftskip 3.7em
\rightskip 2em plus 2em
\parindent 0pt
{\let\numberline\@gobble{\small #1~[#2]}}}
\def\l@table{\@dottedtocline{1}{0pt}{1.5em}}
\def\@pnumwidth{1.7em}
-\ifpdf
- \let\ORIGpdfoutline\pdfoutline
- \def\special@outlines{attr{/F 01}}
- \def\normaloutline {\protected@write\@outlinefile{}{\let\pdfoutline \ORIGpdfoutline}}
- \def\specialoutline{\protected@write\@outlinefile{}{\def\pdfoutline{\ORIGpdfoutline\special@outlines}}}
- \g@addto@macro\appendix{\specialoutline}
-\fi
\def\defspecial@toc#1#2#3{\long\def#1{%
- \ifpdf\phantomsection\specialoutline\pdfbookmark[1]{#2}{#3}\normaloutline\fi
- \section*{#2}\@mkboth{\textls*[70]{\MakeUppercase{#2}}}{}%
+ \ifpdf\phantomsection\bookmarksetupnext{italic}\pdfbookmark[1]{#2}{#3}\fi
+ \section*{#2}\@mkboth{\textls*[70]{\MakeUppercase{\contentsname}}}{}%
\@starttoc{#3}}}
\defspecial@toc\tableofcontents\contentsname{toc}
\defspecial@toc\listoftables\listtablename{lot}
@@ -280,19 +261,19 @@
\def\@cite#1#2{#1\if@tempswa, #2\fi}
\def\thebibliography#1{%
\section{\refname}%
- \list{}{\leftmargin 0pt}%
- \sloppy
+ \list{}{\leftmargin 0pt}% \sloppy
\clubpenalty 4000
\@clubpenalty \clubpenalty
\widowpenalty 4000}
\def\@biblabel#1{}
% footnotes
+\def\@makefnmark{\raisebox{0.3ex}{\sffamily\footnotesize\,\@thefnmark}}
\long\def\@makefntext#1{%
\leftskip 0pt
\parindent 0pt
\everypar{\parindent 0pt}%
- \leavevmode\llap{\@thefnmark\hskip\marginparsep}#1}
-\renewcommand\footnoterule{%
+ \leavevmode\llap{\sffamily\@thefnmark\hskip\marginparsep}#1}
+\def\footnoterule{%
\kern-3\p@
\hrule\@width \columnwidth
\kern2.6\p@}
@@ -340,8 +321,7 @@
\setlength\fboxsep{3pt}
\setlength\arrayrulewidth{0.4pt}
% tables
-\def\topfraction{1}
-\def\textfraction{0}
+\usepackage{tabularx}
\setlength\tabcolsep{2pt}
\newbox\mt@box
\newdimen\mt@unvdimen
@@ -357,19 +337,27 @@
\vskip-\mt@unvdimen}
% index and change log
\IndexPrologue{\section{Index}%
- Numbers in upright shape refer to the page where the corresponding entry is described
- (bold face) resp. occurs. Numbers in italics refer to the code line
- where the corresponding entry is defined (underlined) resp. used.}
-\GlossaryPrologue{\section{Change history}\label{sec:changes}\vspace*{-\multicolsep}}
+ \ifcodedoc
+ Numbers in upright shape refer to the \textit{page} where the corresponding entry
+ is described (bold face) resp. occurs.
+ Numbers in italics refer to the \textit{code line} where the corresponding entry
+ is defined (underlined) resp. used.
+ Numbers prefixed with `U' refer to the User manual.
+ \fi
+}
+\GlossaryPrologue{\section{Change history}\label{sec:changes}%
+ \ifcodedoc \PrintHistory \par\medskip\noindent
+ Numbers prefixed with `U' refer to the User manual.\fi
+ \vspace*{-\multicolsep}}
%\setcounter{finalcolumnbadness}{100}
%\raggedcolumns
\setcounter{IndexColumns}{2}
\def\IndexMin{12\baselineskip}
\g@addto@macro\IndexParms{%
- \footnotesize
+ \ifcodedoc\footnotesize\else\small\fi
\def\indexspace#1{%
\end{multicols}
- \vspace*{-2\baselineskip}%
+ \vspace{-20pt}%
\begin{multicols}{2}
\ifpdf{\let\bfseries\empty\let\hfil\empty\phantomsection\pdfbookmark[2]{#1}{#1}}\fi
\setbox0\hbox{\sffamily\hss#1}%
@@ -392,11 +380,71 @@
\llap{\mdseries\color{thegrey}\footnotesize
\csname MTversiondate##2\endcsname\hskip\marginparsep}%
Version ##2\else ##2\fi}][6\baselineskip]
+ \label{sub:changes:##2}%
\GlossaryParms \rightskip 15pt plus 5pt
\let\item\@idxitem
\ignorespaces \makeatletter \scan@allowedfalse}%
\def\subitem{\par\hangindent 15pt}%
\def\subsubitem{\subitem\hspace*{7.5pt}}}
+% change history
+% (lots of the following stolen from Tom Bombadil's answer:
+% https://tex.stackexchange.com/a/61251/7674)
+%<*!docsty>
+\ifcodedoc
+\usepackage{tikz,pgfcalendar}
+\usetikzlibrary{calc}
+\newcounter{MThistitem}
+\def\MThistlastnode{n-0}
+\pgfmathsetmacro{\MThistfirstyear}{2004} % v1.0 2004/09/11
+\pgfmathsetmacro{\MThistlastyear}{\year}
+\pgfmathsetmacro{\MThistyears}{\MThistlastyear-\MThistfirstyear}
+\pgfmathsetmacro{\MThistvsep}{1.75}
+\pgfmathsetmacro{\MThisthshift}{3}
+\pgfmathsetmacro{\MThistnodewidth}{3mm}
+\def\MThistprepare{%
+ \pgfmathsetmacro{\MThistnodesep}{(\textwidth+\MThisthshift cm-\MThistnodewidth-1pt)/\theMThistitem}
+ \setcounter{MThistitem}{0}
+ \node[inner sep=0pt] (n-0) at (-\MThisthshift,\MThistvsep) {}; }
+\let\MThistshow\@empty
+\def\MThist@versiondate#1#2{% count items and reverse order
+ \gpreto\MThistshow{\MT@doversion{#1}{#2}}
+ \stepcounter{MThistitem}}
+\def\MT@doversion#1#2{%
+ \stepcounter{MThistitem}
+ \node[right=\MThistnodesep,text width=\MThistnodewidth,inner sep=1pt,outer sep=0pt,fill=theshade,align=center]
+ (n-\theMThistitem) at (\MThistlastnode.west) {\hyperref[sub:changes:#1]{#1\strut}};
+ \draw (n-\theMThistitem.north west) -- (n-\theMThistitem.north east);
+ \draw (n-\theMThistitem.south west) -- (n-\theMThistitem.south east);
+ \MThist@splitdate#2\relax
+ \pgfcalendardatetojulian{\MTYear-\MTMonth-\MTDay}{\@tempcnta}
+ \pgfcalendardatetojulian{\MTYear-1-1}{\@tempcntb}
+ \advance\@tempcnta-\@tempcntb
+ \pgfmathsetmacro{\MTDate}{\MTYear-\MThistfirstyear+\@tempcnta/365}
+ \expandafter\edef\csname MThistnodetime\theMThistitem\endcsname{\MTDate}
+ \edef\MThistlastnode{n-\theMThistitem}}
+\def\MThist@splitdate#1/#2/#3\relax{\def\MTYear{#1}\def\MTMonth{#2}\def\MTDay{#3}}
+\def\MThisttimeline{%
+ \draw[very thick,-latex] (0,0) -- ($(\MThistlastnode.east)-(0,\MThistvsep)+(1,0)$) ;
+ \path (n-\theMThistitem.east); \pgfgetlastxy{\MT@tempdim}{\@tempdima};
+ \pgfmathsetmacro{\MThistxposition}{\MT@tempdim/28.452755}
+ \foreach \x in {1,...,\theMThistitem}{
+ \pgfmathsetmacro{\MThisttimeposition}{\MThistxposition/(\MThistlastyear-\MThistfirstyear)*\csname MThistnodetime\x \endcsname}
+ \draw[rounded corners=2pt] (\MThisttimeposition,0) -- (\MThisttimeposition,0.5) -- ($(n-\x.south)-(0,0.5)$) -- (n-\x.south); }
+ \foreach \x in {0,...,\MThistyears}{
+ \pgfmathsetmacro{\MThistlabelposition}{\MThistxposition/(\MThistlastyear-\MThistfirstyear)*\x}
+ \node[below] (label-\x) at (\MThistlabelposition,-0.2) {\number\numexpr\MThistfirstyear+\x};
+ \draw (label-\x.north) -- ++ (0,0.2); }}
+\def\PrintHistory{%
+ \InputIfFileExists{microtype-hist.tmp}{\let\VersionDate\MThist@versiondate\@firstofone}\@gobble
+ {\hypersetup{linkcolor=thered}%
+ \hspace{-\MThisthshift cm}%
+ \rlap{\begin{tikzpicture}[color=thegrey,font=\fontsize{4.5}{6}\selectfont]
+ \MThistprepare
+ \MThistshow
+ \MThisttimeline
+ \end{tikzpicture}}}}
+\fi
+%</!docsty>
% macro code
\MacroTopsep=0pt
\MacrocodeTopsep=3pt
@@ -404,7 +452,7 @@
\def\theCodelineNo{\reset@font\sffamily\color{thegrey}\scriptsize
\textoractual{\arabic{CodelineNo}\ }{}}% don't copy line numbers
\def\MacroFont{\ttfamily\small}
-\def\AltMacroFont{\ttfamily\footnotesize}
+\setcounter{StandardModuleDepth}{99}
\def\PrintMacroName#1{\strut\MacroFont\string #1\hskip15pt}
\def\ImplementationSettings{%
\linespread{1}%
@@ -423,7 +471,7 @@
\begingroup\MakePrivateLetters\Describe@Package}
\def\Describe@Package#1{\endgroup
\marginpar{\raggedleft\PrintDescribeOption{#1.sty}}%
- \CatIndex{#1}{package}\@esphack\ignorespaces}
+ \CatMainIndex{#1}{package}\@esphack\ignorespaces}
\def\DescribeValues#1#2{%
\let\@tempa\@empty \let\Option@default\@empty
\@for\@tempb:=#2\do{%
@@ -452,18 +500,24 @@
\def\MaybeDefault#1{\textrm{*}\,#1}
\def\OptionSep{{\rmfamily, }} \def\MacroSep{\,} \def\EnvironmentSep{\,}
\def\PrintValues[#1]{{\MacroFont\expandafter\@gobble\@tempa\hfill #1}\\*[.25\baselineskip]}
-\def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar hyperpage}}
-\def\CatIndeX#1#2#3{\index{#2\actualchar#1\ (#3)\encapchar hyperpage}}
+\def\CatIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar \ifcodedoc\else doc\fi hyperpage}}
+\def\CatIndeX#1#2#3{\index{#2\actualchar#1\ (#3)\encapchar \ifcodedoc\else doc\fi hyperpage}}
+\def\CatMainIndex#1#2{\index{#1\actualchar{\protect\ttfamily #1} (#2)\encapchar docmain}}
\def\SpecialOptionIndex#1{\@bsphack
\index{\quotechar/#1% sort options as `Symbols'
- \actualchar{\protect\ttfamily#1}\encapchar usage}%
- \CatIndex{#1}{option}\@esphack}
+ \actualchar{\protect\ttfamily#1}\encapchar docmain}%
+ \CatMainIndex{#1}{option}\@esphack}
\def\SpecialUsageIndex#1{\@bsphack
\index{\quotechar1% sort commands as `Numbers'
\actualchar\string\verb
- \quotechar*\verbatimchar\string#1\verbatimchar\encapchar usage}%
- {\let\special@index\index\SpecialIndex@{#1}{\encapchar usage}}\@esphack}
-\def\SpecialEnvIndex#1{\CatIndex{#1}{environment}}
+ \quotechar*\verbatimchar\string#1\verbatimchar\encapchar docmain}%
+ {\let\special@index\index\SpecialIndex@{#1}{\encapchar docmain}}\@esphack}
+\def\SpecialEnvIndex#1{\CatMainIndex{#1}{environment}}
+\def\cmd#1{\orig@cs{\expandafter\cmd@to@cs\string#1}}
+\DeclareRobustCommand\orig@cs[1]{\texttt{\char`\\#1}}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}%
+ {\let\special@index\index
+ \expandafter\SpecialIndex@\expandafter{\csname#1\endcsname}{\encapchar \ifcodedoc\else doc\fi hyperpage}}}
%</driver|docsty>
% microtype's index style (microtype-gind.ist):
%<docist>actual '='
@@ -500,14 +554,8 @@
\fcolorbox{theframe}{white}{\mdseries\small\strut\color{sectioning}%
\,\expandafter\@gobble\@tempa\,}}}
% ... and whistles
-{\catcode`\"\active
- \gdef\verbatim#1
- {\catcode`\"\active \def"##1"{\colorbox{theshade}{%
- \textrm{Text lost! Please install the \pkg{listings} package.}}}%
- \@beginparpenalty\predisplaypenalty\@verbatim\MacroFont
- \frenchspacing\@vobeyspaces\expandafter\@xverbatim\@gobble}}
\usepackage{listings}
-\lstset{
+\lstdefinestyle{microtype}{
gobble=1,columns=flexible,keepspaces,upquote,escapechar=",
basicstyle=\MacroFont,
keywords=[0]{\microtypesetup,\DeclareMicrotypeSet,\UseMicrotypeSet,
@@ -515,12 +563,12 @@
\SetExtraKerning,\SetExtraSpacing,\DisableLigatures,\DeclareCharacterInheritance,
\DeclareMicrotypeVariants,\DeclareMicrotypeAlias,\DeclareMicrotypeBabelHook,
\LoadMicrotypeFile,\microtypecontext,\textmicrotypecontext,
- \textls,\lsstyle,\lslig,\Microtype@Hook},
+ \textls,\lsstyle,\lslig,\leftprotrusion,\rightprotrusion,\Microtype@Hook},
keywordstyle=[0]\color{thegreen},
- keywords=[1]{protrusion,expansion,activate,DVIoutput,draft,final,verbose,
+ keywords=[1]{protrusion,expansion,activate,DVIoutput,disable,verbose,
config,factor,auto,stretch,shrink,step,selected,unit,tracking,kerning,
- spacing,letterspace,babel,context,
- %defersetup,copyfonts,enable,disable,% undocumented
+ spacing,letterspace,babel,context,patch,nopatch,
+ %defersetup,copyfonts,deactivate,reactivate,% undocumented
no ligatures,outer spacing,outer kerning}, % there are three \nobreakspace in this line
keywordstyle=[1]\color{thered},
comment=[l]\%,
@@ -529,81 +577,92 @@
frame=single,backgroundcolor=\color{theshade},rulecolor=\color{theframe},
framerule=\fboxrule,xleftmargin=3.4pt,xrightmargin=3.4pt,belowskip=\smallskipamount
}
+\lstset{style=microtype}
+\lstdefinestyle{message}{deletekeywords={[1]{expansion,protrusion,auto}},
+ belowskip=-\smallskipamount,frame=none,xleftmargin=0pt,backgroundcolor=,
+ basicstyle=\MacroFont\footnotesize,delim=[is][\itshape\color{thegreen}]{<}{>}}
\let\verbatim\relax
\lstnewenvironment{verbatim}[1][]{\lstset{#1}}{}
-\ifpdf
- \font\dummyspace=dummy-space
- \pdfglyphtounicode{space}{0020}
- \def\lst@outputspace{% copy spaces (from a font that really has a space at x20)
- \setbox0\hbox{ }\@tempdima\wd0
- \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0
- \unhbox0 \kern\@tempdima}
-\fi
\def\todo#1{\changes{zTo Do}{0000/00/00}{#1}%
- \marginpar{\rightskip2\marginparsep plus1em\hangindent1.5em\hangafter-2
- \smash{\rlap{\raisebox{-3.3ex}{\colorbox{thered}{\Large\color{white}!}}}}%
+ \marginpar{\rightskip2\marginparsep plus1em \hangindent1.5em \hangafter-2
+ \smash{\llap{\raisebox{-1.4ex}{\colorbox{thered}{\Large\color{white}!} }}}%
\footnotesize\textcolor{thered}{#1}}}
\let\todo\@gobble
-\newcommand\microtypesample[1]{\begin{quote}#1\end{quote}}
-\let\emptypdfpageresources\relax
% fancy PDF document
\ifpdf
- \ifx\eTeXversion\@undefined \else % errors when not using etex (conflict with multicol)
- \ifnum\pdftexversion < 140 % no longer required with pdftex 1.40
- \usepackage{pdfcolmk}
- \fi\fi
- \usepackage[bookmarks,bookmarksopen,pdfdisplaydoctitle,
+ \usepackage{xr-hyper}
+ \usepackage[bookmarks,pdfdisplaydoctitle,
colorlinks,linkcolor=theblue,citecolor=theblue,urlcolor=thered,
hyperindex=false,hyperfootnotes=false]
{hyperref}
+ \usepackage[atend]{bookmark}
+%<*!docsty>
+ \BookmarkAtEnd{%
+ \bookmark[startatroot,level=0,bold,gotor={microtype\ifcodedoc\else-code\fi.pdf}]
+ {\ifcodedoc User manual\else Implementation\fi}}
+%</!docsty>
+ \externaldocument{microtype\ifcodedoc\else-code\fi}
\PassOptionsToPackage{nodvi}{totpages} % remove annoying log output
- \usepackage{hyperxmp} % (hyperxmp loads totpages)
+ \usepackage{hyperxmp} % (hyperxmp loads totpages)
\usepackage{attachfile}
\usepackage{pdfpages}
\hypersetup{
keeppdfinfo,
- pdftitle={The microtype package},
+ pdftitle={The microtype package\ifcodedoc\space-- Implementation\fi},
pdfauthor={R Schlicht <w.m.l@gmx.net>},
pdfsubject={Subliminal refinements towards typographical perfection},
pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, typography, micro-typography,
character protrusion, margin kerning, optical alignment, font expansion,
font scaling, hz, kerning, spacing, glue, letterspacing, tracking, ligatures},
- pdfcopyright={\textcopyright\ 2004--2021 R Schlicht\012%
+ pdfcopyright={\textcopyright\ 2004--2021 R Schlicht\textLF
This work may be distributed and/or modified under the conditions
of the LaTeX Project Public License, either version 1.3c of this
- license or (at your option) any later version.\012%
- This work has the LPPL maintenance status `author-maintained'.},
- pdflicenseurl={http://www.latex-project.org/lppl/}
+ license or (at your option) any later version.\textLF
+ This work has the LPPL maintenance status `maintained'.},
+ pdflicenseurl={http://www.latex-project.org/lppl/},
+ pdflang={en-GB}
}
- \pdfcatalog{/Lang(en-GB)}
- \ifnum\pdftexversion < 130 \else
- \usepackage{hypdestopt}\fi
- \def\usage#1{\textbf{\hyperpage{#1}}}% for indexing of \DescribeMacro ...
- \def\changes@#1#2#3{% ... the changes ...
+ % we no longer use {hypdestopt}, as it would break the external references
+ \def\changes@#1#2#3{% recording 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}}%
+ :\levelchar #3\encapchar \ifcodedoc\else doc\fi hyperpage}}%
\@tempa\endgroup\@esphack}
- \def\theCodelineNo{% ... and everything else
+ \def\MTrmn#1{\ifrmnum{#1}{\rmntonum{#1}}{#1}}
+ % remove double entries (\dochyperpage followed by \docmain)
+ \def\dochyperpage#1{\def\MT@curr@index{#1}\@ifnextchar,\dochyperpage@{\doc@hyperpage{#1}}}
+ \def\dochyperpage@,{\@ifnextchar\docmain\dochyperpage@@\dochyperpage@x}
+ \def\dochyperpage@@\docmain#1{\MT@ifstreq{#1}{\MT@curr@index}\relax\dochyperpage@x\docmain{#1}}
+ \def\dochyperpage@x{\expandafter\doc@hyperpage\expandafter{\MT@curr@index}, }
+ % indexing user doc ...
+ \ifcodedoc
+ \def\doc@hyperpage#1{\href[page={\MTrmn{#1}}]{microtype.pdf}{U\MTrmn{#1}}}
+ \def\docmain#1{\href[page={\MTrmn{#1}}]{microtype.pdf}{\textbf{U\MTrmn{#1}}}}
+ \def\main#1{\underline{\itshape\hyperlink{L:#1}{#1}}}
+ \def\SpecialIndex#1{\@bsphack\special@index{%
+ \expandafter\@gobble\string#1\actualchar
+ \string\verb\quotechar*\verbatimchar\string#1\verbatimchar
+ \encapchar codeline}\@esphack}
+ \else
+ % write references to the User manual intermediarily in roman numerals
+ % in order to separate them from those in the Implementation part
+ \def\@wrindex#1{\protected@write\@indexfile{\let\@roman\relax}{\string\indexentry{#1}{\@roman\thepage}}\endgroup\@esphack}
+ \def\HyInd@pagelink#1{\begingroup\toks@={}\edef\x{\MTrmn{#1} }\expandafter\HyInd@removespaces\x\@nil\endgroup}
+ \def\docmain#1{\textbf{\hyperpage{#1}}}
+ \let\doc@hyperpage\hyperpage
+ \fi
+ \def\theCodelineNo{% ... and implementation
\reset@font\sffamily\color{thegrey}\scriptsize
\@tempcnta\arabic{CodelineNo}\advance\@tempcnta by\@ne
\hypertarget{L:\number\@tempcnta}
{\textoractual{\arabic{CodelineNo}\ }{}}}% don't copy line numbers
- \def\main#1{\underline{\itshape\hyperlink{L:#1}{#1}}}
\def\codeline#1{{\itshape\link@sanitize#1-\@nil{#1}}}
\def\link@sanitize#1-#2\@nil{\link@@sanitize#1,\@nil}
\def\link@@sanitize#1,#2\@nil{\hyperlink{L:#1}}
- \def\SpecialIndex#1{\@bsphack\special@index{\expandafter\@gobble
- \string#1\actualchar
- \string\verb\quotechar*\verbatimchar\string#1\verbatimchar
- \encapchar codeline}%
- \@esphack}
- \def\ctanurl#1{Available from \acronym{CTAN} at
- \href{http://mirror.ctan.org/#1}{\nolinkurl{/#1}}}
- \def\ctanpkgurl#1{Available from \acronym{CTAN} at
- \href{https://www.ctan.org/pkg/#1}{\nolinkurl{pkg/#1}}}
+ \def\ctanurl#1{Available from \acronym{CTAN} at \href{http://mirror.ctan.org/#1}{\nolinkurl{/#1}}}
+ \def\ctanpkgurl#1{Available from \acronym{CTAN} at \href{https://www.ctan.org/pkg/#1}{\nolinkurl{pkg/#1}}}
\DeclareRobustCommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}}
\def\mailtoRS{\href % some PDF viewers don't like spaces:
{mailto:Robert\%20Schlicht\%3cw.m.l@gmx.net\%3e?subject=[microtype\%20\fileversion]}
@@ -654,7 +713,7 @@
/A << /S/SetOCGState /State[/Toggle \csname mt@#1@true\endcsname
\csname mt@#1@false\endcsname] >>}
#1 \hfill\pdfendlink & \mt@layer{#1true}{\rlap{on}}\mt@layer{#1false}{off}}
- \renewcommand\microtypesample[1]{%
+ \long\def\microtypesample#1{%
\begingroup
\leftskip 15pt \rightskip 15pt
\parskip 4pt \parindent 0pt
@@ -689,20 +748,31 @@
\endgroup
\edef\x{\pdfpageresources{/Properties <<\mt@resources>>}}\x}
\def\emptypdfpageresources{\pdfpageresources{}}
+ \font\dummyspace=dummy-space
+ \pdfglyphtounicode{space}{0020}
+ \def\lst@outputspace{% copy spaces (from a font that really has a space at x20)
+ \setbox0\hbox{ }\@tempdima\wd0
+ \setbox0\hbox{\dummyspace\char"20}\advance\@tempdima-\wd0
+ \unhbox0 \kern\@tempdima}
\fi
\else
- \usepackage{url}
+ \usepackage{url,xr}
+ \externaldocument{microtype\ifcodedoc\else-code\fi}
\newcommand\hyperref[2][]{#2}
\let\hyperpage\@firstofone
+ \let\dochyperpage\@firstofone
+ \let\docmain\main
\let\texorpdfstring\@firstoftwo
\def\ctanurl{Available from \acronym{CTAN} at \url}
\let\ctanpkgurl\ctanurl
\let\nolinkurl\url
\let\mailto\texttt
\def\mailtoRS{\mailto{w.m.l@gmx.net}}
- \let\href\texttt
+ \let\href\@gobble
\newcommand\textattachfile[3][]{#3 \textit{[File \file{#2} not attached,
because \file{microtype.dtx} hasn't been compiled with \pdftex.]}}
+ \long\def\microtypesample#1{\begin{quote}#1\end{quote}}
+ \let\emptypdfpageresources\relax
\fi
\ifx\l@ukenglish\@undefined
\hyphenation{let-ter-spac-ing let-ter-spaced let-ter-space}
@@ -731,6 +801,7 @@
\DeclareRobustCommand\xetex{\xe\kern-.1em\TeX\CatIndeX{\xe\TeX}{xetex}{engine}}
\DeclareRobustCommand\texlive{\TeX~Live\CatIndeX{\TeX~Live}{TeXLive}{distribution}}
\DeclareRobustCommand\miktex{MiK\TeX\CatIndeX{MiK\TeX}{MiKTeX}{distribution}}
+\def\githuburl{https://github.com/schlcht/microtype}
\def\microtype{{\PackageFont microtype}}
\def\letterspace{\pkg{letterspace}}
\def\fontdim{\cmd\fontdimen\,}
@@ -747,19 +818,31 @@
\AtBeginDocument{\catcode`\<=\active
\def<#1>{\acronym{#1}}
\def\contributor#1 <#2\at#3>{\@contributor{#1}{#2@#3}}}}
-\DeclareRobustCommand\@contributor[2]{\textit{#1}}
+%\DeclareRobustCommand\@contributor[2]{\textit{#1}}
%\DeclareRobustCommand\@contributor[2]{\href{mailto:#2}{\textit{#1}}}
-%\DeclareRobustCommand\@contributor[2]{\textit{#1}%
-% \expandafter\index\expandafter{\@getlastname#1 \@nil\actualchar %\href{mailto:#2}{#1}
-% #1 (contributor)\encapchar hyperpage}}
-%\def\@getlastname#1 #2\@nil{\ifx\@nil#2\@nil#1\else\@getlastname#2\@nil\fi}
+\ifcodedoc \else
+ \newwrite\@contributorsfile
+ \immediate\openout\@contributorsfile=microtype.cdx
+\fi
+\DeclareRobustCommand\@contributor[2]{\textit{#1}%
+ {\ifcodedoc\else\let\@indexfile\@contributorsfile\fi
+ \expandafter\index\expandafter{\@getlastname#1 \@nil\actualchar %\href{mailto:#2}{#1}
+ \textit{#1} (contributor)\encapchar \ifcodedoc\else doc\fi hyperpage}}}
+\def\@getlastname#1 #2\@nil{\ifx\@nil#2\@nil#1\else\@getlastname#2\@nil\fi}
%<*driver>
\CodelineIndex
\EnableCrossrefs
\RecordChanges
-%\OnlyDescription
+\ifcodedoc
+ \let\printlogo\undefined
+ \InputIfFileExists{microtype-hist.tmp}
+ {\def\VersionDate##1##2{\global\expandafter\def\csname MTversiondate##1\endcsname{##2}}}
+ \relax
+\else
+ \OnlyDescription
+\fi
\begin{document}
- \DocInput{\jobname.dtx}
+ \DocInput{microtype.dtx}
\end{document}
%</driver>
%</driver|docsty>
@@ -767,18 +850,24 @@
%
% ^^A -------------------------------------------------------------------------
%\GeneralChanges*
+%\ifcodedoc\else
%\changes{v1.0}{2004/09/11}{Initial version}
%\changes{v2.0}{2006/12/29}{new package \letterspace: a stripped-down version,
% containing the letterspacing commands only}
+%\changes{v3.0}{2021/10/31}{move development to \href{\githuburl}{GitHub}}
%\GeneralChanges{Documentation}
%\changes{v1.9b}{2006/01/13}{activate expansion in the distributed <PDF>}
%\changes{v2.2}{2007/04/01}{logo transparency and amusement}
-% ^^A Adobe Reader 8.0 had serious bugs with transparency. Fixed in 8.1.
+%\changes{v3.0}{2021/06/01}{\relax split up in User manual (\file{microtype.pdf})
+% and Implementation doc (\file{microtype-code.pdf})}
+%\fi
%
-% \GetFileInfo{microtype.dtx}
+% \GetFileInfo{\jobname.dtx}
% \title{\ifx\printlogo\undefined\else\printlogo\fi
-% \textls[40]{The \microtype\ package}\\[.3\baselineskip]\large
-% Subliminal refinements towards typographical perfection}
+% \textls[40]{The \microtype\ package}%
+% \\[6pt]\large
+% Subliminal refinements towards typographical perfection
+% \ifcodedoc\\[9pt]{\Large--- \textls[60]{IMPLEMENTATION} ---}\fi}%
% \author{R Schlicht\\\mailtoRS}
% \date{\fileversion\\\filedate}
%
@@ -808,7 +897,7 @@
%
% The alternative package \letterspace, which also works with plain \TeX,
% provides the user commands for letterspacing only, omitting support for all
-% other extensions (see section~\ref{sec:lettersp}).
+% other extensions (see section~\ref{sec:lettersp}\ifcodedoc\space of the User manual\fi).
%
%\bigskip\noindent
% This package is copyright \textcopyright\ 2004\kern.09em--2021 R Schlicht.
@@ -816,18 +905,32 @@
% \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{http://www.latex-project.org/lppl/}}
% {\LaTeX\ Project Public License},
% either version~1.3c of this license or (at your option) any later version.
-% This work has the <LPPL> maintenance status `author-maintained'.
+% This work has the <LPPL> maintenance status `maintained'.
%\end{abstract}
%
%
%\newpage
%\emptypdfpageresources ^^A layers of the logo
+%
%{\sffamily\def\familydefault{\sfdefault}\ifcmr\else\DeclareFontSeriesDefault[sf]{bf}{sb}\fi
% \tableofcontents
% \listoftables
+% \vskip2\baselineskip
+% \Large\MTsectionfont
+% \noindent
+% \ifpdf
+% \ifcodedoc
+% \href{file:microtype.pdf}{User manual}
+% \else
+% \href{file:microtype-code.pdf}{Implementation}
+% \fi
+% \normalfont\normalsize (external document)
+% \fi
%}
%
%
+%\ifcodedoc\else
+%
%\newpage
%\section{Micro-typography with \TeX}\label{sec:micro-type}
%
@@ -912,7 +1015,7 @@
% influence the interword space. Also, the settings shipped with \microtype\
% are but a first approximation, and I~would highly welcome corrections and
% improvements. I suggest reading the reasoning behind the settings in
-% section~\ref{sub:conf-spacing}.
+% the Implementation part, section~\ref{sub:conf-spacing}.
%
% The possibility, finally, to \emph{disable all or selected ligatures} is
% particularly useful for typewriter fonts.
@@ -948,7 +1051,7 @@
% \item Enable the desired micro-typographic features, either via the
% respective package option or with the \cs{microtypesetup} command
% (section~\ref{sec:options}).
-% \item Select the fonts to which this feature should be applied by declaring
+% \item Select the fonts to which the features should be applied by declaring
% and activating `sets of fonts'. A number of sets are predefined, which may be
% activated directly in the package options
% (section~\ref{sec:font-sets}).
@@ -960,6 +1063,8 @@
% \item You are even countenanced to leave the path of typographic virtue and
% steal some sheep (section~\ref{sec:lettersp}) or trespass in other ways
% (section~\ref{sec:disable-ligatures}).
+% \item For the pedantic or the perfectionist, sections \ref{sec:pedantic}
+% and \ref{sec:contrib} are warmly recommended.
% \item Should you encounter any obstacles, follow the hints and caveats
% (section~\ref{sec:caveats}).
%\end{itemize}
@@ -1080,7 +1185,7 @@
% \luatex ^^A we will have to re-model kerning and spacing with \luatex
% & $\geq$ 0.30 & <DVI> & ! & ? & _ & _ & _ & _\\
% & & <PDF> & ! & ? & ! & _ & _ & _\\
-% & $\geq$ 0.62 & <DVI> & ! & _ & \hskip1em\llap{(}\textcolor{theblue}{$\boxtimes$})\textsuperscript{\itshape a} & ? & _ & _\\
+% & $\geq$ 0.62 & <DVI> & ! & _ & \hskip1em\llap{(}\textcolor{theblue}{$\boxtimes$})\raisebox{0.4ex}{\sffamily\itshape\footnotesize a} & ? & _ & _\\
% & & <PDF> & ! & _ & ! & ? & _ & _\\
%\cmidrule(r){1-3}
% \let\textoractual\@firstoftwo ^^A why?
@@ -1095,7 +1200,7 @@
% ? = not enabled\quad
% _ = not available
%\hfill
-% \textit{a}\quad by means of variable tracking
+% {\sffamily\itshape a}\quad by means of variable tracking
%\vskip4pt
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
@@ -1129,8 +1234,16 @@
% more modest protrusion).
%
%\medskip
+%\Describe{Option}{patch}{!all,none,:list of patches}
+%\DescribeOption{nopatch}
+% These options provide control over various patches meant to fix protrusion
+% at margins other than the text block margins.
+% They are described in detail in section~\ref{sec:pedantic}.
+%
+%\pagebreak ^^A layout
+%\medskip
%\Describe{Option}{unit}{!character,:dimension}
-% This option is described in section~\ref{sub:protrusion}, apropos the command
+% This option is described in section~\ref{sub:protrusion}, apropos of the command
% \cs{SetProtrusion}. Use with care.
%
%
@@ -1194,18 +1307,20 @@
% in case you are using a pre-1.40 \pdftex\ version, \opt{step} is by default
% set to one fifth of the smaller value of \opt{stretch} and \opt{shrink}.
%
+%\enlargethispage{\baselineskip} ^^A layout
%\medskip
%\Describe{Option}{selected}{true,!false}
% When applying font expansion, it is possible to restrict the expansion of some
% characters that are more sensitive to deformation than others (\eg, the `O',
% in contrast to the `I'). This is called \emph{selected expansion}, and its
-% usage allows increasing the stretch and shrink limits (to, say, 30 instead
+% use allows increasing the stretch and shrink limits (to, say, 30 instead
% of 20); however, the gain is limited since at the same time the average
% stretch variance will be decreased. Therefore, this option is by default
% set to |false|, so that all characters will be expanded by the same amount.
% See section~\ref{sub:expansion} for a more detailed discussion.
%
%
+%\pagebreak ^^A layout
%\subsection[Tracking]
% {Tracking \requires{\pdftex~1.40,\luatex~0.62}}
% \label{sub:options-tracking}
@@ -1219,18 +1334,20 @@
%
%\subsection{Miscellaneous options}\label{sub:options-misc}
%
-%\changes{v2.0}{2006/11/28}{add remark about `\opt{draft}' option disabling \microtype\
+%\changes{v2.0}{2006/11/28}{add remark about `\opt{disable}' (previously |draft|) option disabling \microtype\
% (noted by \contributor Michalis Miatidis <miatidis\at informatik.rwth-aachen.de>)}
% ^^A private mail, 2006/11/26
-%\Describe{Option}{draft}{true,!false}
-%\DescribeOption{final}
-% If the \opt{draft} option is passed to the package, \emph{all
-% micro-typographic extensions will be disabled}, which may lead to different
-% line, and hence page, breaks. The \opt{draft} and \opt{final} options may
-% also be inherited from the class options; of course, you can override them in
-% the package options. E.g., if you are using the class option |draft| to
-% show any overfull boxes, you should load \microtype\ with the |final|
-% option.
+%\changes{v3.0}{2021/09/28}{rename option |draft| option to \opt{disable}
+% (insistently requested by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)}
+% ^^A private mail, 2018/07/04
+%\Describe{Option}{disable}{true,!false,ifdraft}
+% If the \opt{disable} option is passed to the package, all
+% micro-typographic extensions will be disabled, which may lead to different
+% line, and hence even page, breaks. This option replaces the |draft| option
+% from previous versions, which could be inherited from the class options;
+% to restore the previous behaviour, you may pass the value |ifdraft|:
+% in this case, the \opt{disable} option will be set to |true| if and only if
+% the document class has been loaded with the |draft| option.
%
%\medskip
%\Describe{Option}{verbose}{true,!false,errors,silent}
@@ -1266,7 +1383,7 @@
% instead, it is recommended to just call the respective program (|latex| resp.
% |dvilualatex|).
%\changes{v2.8}{2020/04/02}{declare \opt{DVIoutput} option deprecated}
-% For \xetex, this option is not applicable.
+% For \xetex, this option is not applicable.\looseness=-1 ^^A layout
%
%\iffalse
%\changes{v1.5}{2004/12/15}{add note about \opt{DVIoutput} option}
@@ -1322,6 +1439,8 @@
% |compatibility| or |nocompatibility|, and \key{tracking}, \key{kerning} and
% \key{spacing} with the admissible values |true| or |false|.
% Passing the name of a font set is not allowed.
+% Additionally, it accepts the options \key{patch} and \key{nopatch}
+% (see section~\ref{sec:pedantic}).
% Using this command, you could for instance temporarily disable font expansion
% by saying:
%\begin{verbatim}
@@ -1430,7 +1549,7 @@
%\fcolorbox{theframe}{white}{^^A
%\begin{minipage}{\textwidth}
%\def\arraystretch{1.2}
-%\begin{tabular}{@{}L{65pt}L{80pt}*2{L{40pt}}L{43pt}L{67pt}@{}}
+%\begin{tabular}{@{}L{65pt}L{82pt}*2{L{41pt}}L{43pt}L{62pt}@{}}
% \footnotesize Set name
% & \multicolumn{5}{l}{\footnotesize Font attributes}\\
%\cmidrule{2-6}
@@ -1519,7 +1638,6 @@
%\usepackage[protrusion=allmath,tracking=smallcaps]{microtype}
%\end{verbatim}
%
-%\ifcmr\else\pagebreak\fi ^^A layout
%\medskip
%\Describe{Macro}{\UseMicrotypeSet}{?features,set name}
% This command activates a font set previously declared by \cs{DeclareMicrotypeSet}.
@@ -1635,7 +1753,7 @@
% (since the value that comes last will take precedence). Font settings
% will be loaded recursively.
% The following options will affect all loaded lists, in other words,
-% any options from the loaded lists will be ignored:\looseness=-1 ^^A layout
+% any options from the loaded lists will be ignored:
%\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
@@ -1748,7 +1866,7 @@
% This method of employing contexts to temporarily apply different
% expansion parameters only works with \pdftex\ version 1.40.4 or later,^^A
% \footnote{For older versions, a dirty trick is laid out in
-% section~\ref{sub:font-setup} on page~\pageref{exp-hack}.}
+% the Implementation part, section~\ref{sub:font-setup}, page~\pageref{exp-hack}.}
% or with \luatex.
% Also note that both \pdftex\ and \luatex\ prohibit the use of fonts with different expansion
% limits or steps (even of different fonts) within one paragraph, hence
@@ -1866,7 +1984,7 @@
% As an
%\else
%\changes{v2.3}{2007/11/03}{add letterspacing illustration}
-%\medskip\noindent
+%\noindent
% Since a picture is worth a thousand words, probably even more if, in our
% case, it depicts a couple of letterspaced words, let's bring one to sum up
% these somewhat confusing options. Suppose you had the following settings
@@ -2097,10 +2215,11 @@
% list. Additionally, it accepts the \key{inputenc} key to set the input encoding
% for this list. The font set can be declared in the usual way. The inheritance
% lists are declared as pairs of \meta{base character}\,|=|\,\meta{list of
-% inheriting characters}. Unless you are using a different encoding or a very
-% peculiarly shaped font, there should be no need to change the default
-% character inheritance settings.
+% inheriting characters}.
%
+% With \pdftex, there should be no need to change the default
+% character inheritance settings, unless you are using a different encoding or
+% a very peculiarly shaped font.
% The situation is different with \luatex\ and \xetex, however: the default
% inheritance settings only contain those glyhps that can safely be assumed to
% exist in any font; but since OpenType fonts may contain many more glyphs for
@@ -2108,6 +2227,34 @@
% settings are necessary, which should be specified in the font's configuration
% file (see next section).
%
+%\medskip\noindent
+% Additionally, this command provides the possibility to have the desired
+% protrusion amount calculated automatically based on the difference of character widths.
+% If the base character is preceded with either `|(l)|', `|(r)|' or `|(lr)|',
+% the characters in the list will not only inherit the protrusion of the base character,
+% but will be additionally protruded by the result of
+% |charwidth(|\meta{inheriting character}|)|$-$|charwidth|\allowbreak|(|\meta{base character}|)|:
+% for `|(l)|' and `|(r)|', this amount will be added to the given protrusion on
+% the respective side, for `|(lr)|' half of the amount will be added to both sides.
+% So that, \eg, with
+%\begin{verbatim}
+%\DeclareCharacterInheritance
+% { encoding = TU, family = {GFS Porson} }
+% { (l)"\rlap{\sffamily H}" = {"\fontencoding{LGR}\sffamily\~>\textEta"},
+% (lr)I = {T} }
+%\end{verbatim}
+% the accent before the `H' would be fully protruded into the left margin,
+% while the stem of the `T' would be aligned with that of the `I' if at either margin.
+% This feature is especially useful for Greek typography, where capital letters
+% at the beginning of a line should be placed as if they had no accent (the `H' in
+% the example above).
+% Base characters may have both unprefixed and prefixed inheritance lists;
+% characters in the latter will be implicitly added to the corresponding unprefixed one.
+% Inheriting characters may appear in both `|(l)|' and `|(r)|'-prefixed lists at the
+% same time, whereas lists prefixed with `|(l)|' or `|(r)|' and those prefixed with
+% `|(lr)|' are mutually exclusive.
+% For all other features except protrusion, these prefixed lists will be ignored.
+%\looseness=-1 ^^A layout
%
%
%\subsection{Configuration files}\label{sub:config-file}
@@ -2125,11 +2272,13 @@
% described in the current section~\ref{sec:fine-tuning}. These files will be
% loaded automatically if you are actually using the respective fonts.
% This package ships with configuration files for a number of font families.
-% Table~\ref{tab:fonts} lists them all.
+% They are listed in tables~\ref{tab:type1-fonts} (Type\,1 fonts) and
+% \ref{tab:ot-fonts} (OpenType fonts).
%
%\begin{table}[t]\small
%\changes{v1.6a}{2005/02/02}{add table of fonts with tailored protrusion settings}
-%\caption{Fonts with tailored protrusion settings}\label{tab:fonts}
+%\caption[Type\,1 fonts with tailored protrusion settings]
+% {Type\,1 fonts with\\tailored protrusion settings}\label{tab:type1-fonts}
%\setlength\fboxsep{4pt}
%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
%\fcolorbox{theframe}{white}{^^A
@@ -2140,20 +2289,20 @@
% \leftskip 1.2em
% \parindent -1.2em
% \everypar{\parindent -1.2em}%
-% \leavevmode\hbox to 1.2em{\@thefnmark\hss}#1}
+% \leavevmode\hbox to 1.2em{\sffamily\@thefnmark\hss}#1}
%\let\footnoterule\relax
-%\def\fnref#1{\textsuperscript{\itshape\ifpdf\ref*{#1}\else\ref{#1}\fi}}
-%\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*3l@{}}
+%\def\thempfootnote{{\itshape\ifnum\c@mpfootnote=10 \global\advance\c@mpfootnote 1 \fi\@alph\c@mpfootnote}}
+%\def\fnref#1{\raisebox{0.3ex}{\sffamily\itshape\footnotesize\,\ifpdf\ref*{#1}\else\ref{#1}\fi}}
+%\begin{tabularx}{\textwidth}{@{\extracolsep{\fill}}>{\leftprotrusion}Xll@{}}
% \footnotesize Font family (<NFSS> code)
% & \multicolumn{2}{l}{\footnotesize Features}\\
-%\cmidrule{1-1}\cmidrule{2-3}
-%\itshape\footnotesize Type 1 fonts
+%\cmidrule(r){2-3}
% & \footnotesize Encodings
% & \footnotesize Shapes\\
-%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}
+%\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3}
% Generic
-% & <OT1>, <T1>, <T2A>, <LY1>, <QX>, (<TS1>)\footnote{Incomplete\label{fn:incmpl}}
-% & n, (it, sl, sc)\fnref{fn:incmpl} \\
+% & <OT1>, <T1>, <T2A>, <LY1>, <QX>, (<TS1>)\fnref{fn:t1-incmpl}
+% & n, (it, sl, sc)\fnref{fn:t1-incmpl} \\
% Computer Modern Roman (|cmr|)\footnote{Aliases: Latin Modern Roman (|lmr|),
% \pkg{ae} (|aer|), \pkg{zefonts} (|zer|),
% \pkg{eco} (|cmor|), \pkg{hfoldsty} (|hfor|), \pkg{mlmodern}~(|mlmr|)}
@@ -2162,10 +2311,10 @@
% Bitstream Charter (|bch|)\footnote{Aliases: \pkg{mathdesign}/Charter (|mdbch|),
% MicroPress's \pkg{chmath} (|chr|), \pkg{XCharter}}
% & <OT1>, <T1>, <T5>, <LY1>, <TS1>
-% & n, it, (sl)\footnote{Settings inherited from italic shape\label{fn:it-sl}}, sc \\
+% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\
% <EB> Garamond\footnote{Alias: Adobe Garamond (|pad|, |padx|, |padj|)}
% & <OT1>, <T1>, <LY1>, <TS1>
-% & n, it, (sl)\fnref{fn:it-sl}, sc \\
+% & n, it, sc, si \\
% <URW> Garamond (|ugm|)\footnote{Aliases: \pkg{mathdesign}/<URW> Garamond (|mdugm|), \pkg{garamondx} (|zgmx|, |zgmj|)}
% & <OT1>, <T1>, <TS1>
% & n, it\\
@@ -2174,17 +2323,17 @@
% & n, it \\
% Adobe Minion (|pmnx|, |pmnj|)
% & <OT1>, <T1>, <T2A>, <LY1>, <TS1>
-% & n, it, (sl)\fnref{fn:it-sl}, sc, si\\
+% & n, it, (sl)\fnref{fn:t1-itsl}, sc, si\\
% Palatino (|ppl|, |pplx|, |pplj|)\footnote{Aliases: \pkg{pxfonts} (|pxr|),
% \pkg{qfonts}/QuasiPalatino, \TeX\ Gyre Pagella (|qpl|),
% \pkg{newpx}, <FPL> Neu (|fp9x|, |fp9j|), \pkg{domitian}}
-% & <OT1>, <OT4>, <T1>, <LY1>, (<TS1>)\fnref{fn:incmpl}
-% & n, it, (sl)\fnref{fn:it-sl}, sc \\
+% & <OT1>, <OT4>, <T1>, <LY1>, (<TS1>)\fnref{fn:t1-incmpl}
+% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\
% Times (|ptm|, |ptmx|, |ptmj|)\footnote{Aliases: \pkg{txfonts} (|txr|),
% \pkg{qfonts}/QuasiTimes, \TeX\ Gyre Termes (|qtm|),
% \pkg{newtx}, \pkg{tempora}, \pkg{step}, \pkg{stix}/\pkg{stix2}}
-% & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:incmpl}
-% & n, it, (sl)\fnref{fn:it-sl}, sc \\
+% & <OT1>, <OT4>, <T1>, <LY1>, <QX>, (<TS1>)\fnref{fn:t1-incmpl}
+% & n, it, (sl)\fnref{fn:t1-itsl}, sc \\
% Computer Modern math (|cmsy|, |cmm|)\footnote{Aliases: Latin Modern (|lmsy|, |lmm|), \pkg{mlmodern} (|mlmsy|, |mlmm|)}
% & <OML>/<OMS>
% & n/it \\
@@ -2196,31 +2345,60 @@
% & n\\
% Euro symbols (Adobe, <ITC>, \pkg{marvosym})
% & <U>/<OT1>
-% & n, it \\
-%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}
-%\itshape\footnotesize OpenType fonts
-% & \footnotesize Scripts
-% & \footnotesize Shapes\\
-%\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}
+% & n, it\phantom{^^A
+% \footnote{Incomplete\label{fn:t1-incmpl}}
+% \footnote{Settings inherited from italic shape\label{fn:t1-itsl}}} \\
+%\bottomrule
+%\end{tabularx}^^A
+%\end{minipage}^^A
+%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
+%\end{table}
+%
+%\begin{table}[t]\small
+%\changes{v3.0}{2021/06/16}{split up table of fonts with tailored protrusion settings}
+%\caption{OpenType fonts with tailored protrusion settings}\label{tab:ot-fonts}
+%\setlength\fboxsep{4pt}
+%\leavevmode\kern-\dimexpr\fboxsep+\fboxrule\relax
+%\fcolorbox{theframe}{white}{^^A
+%\begin{minipage}{\textwidth}
+%\def\arraystretch{1.2}
+%\long\def\@makefntext#1{%
+% \raggedright
+% \leftskip 1.2em
+% \parindent -1.2em
+% \everypar{\parindent -1.2em}%
+% \leavevmode\hbox to 1.2em{\sffamily\@thefnmark\hss}#1}
+%\let\footnoterule\relax
+%\def\fnref#1{\raisebox{0.3ex}{\sffamily\itshape\footnotesize\,\ifpdf\ref*{#1}\else\ref{#1}\fi}}
+%\begin{tabularx}{\textwidth}{@{\extracolsep{\fill}}>{\leftprotrusion}Xll@{}}
+% \footnotesize Font family
+% & \multicolumn{2}{l}{\footnotesize Features}\\
+%\cmidrule(r){2-3}
+% & \rlap{\footnotesize Scripts}\hphantom{<OT1>, <OT4>, <T1>, <T2A>, <T5>, <LY1>, <TS1>}
+% & \rlap{\footnotesize Shapes}\hphantom{n, it, (sl)\fnref{fn:t1-itsl}, sc, si}\\
+%\cmidrule(r){1-1}\cmidrule(r){2-2}\cmidrule(r){3-3}
% Generic
% & Latin
-% & n, (it, sl, sc)\fnref{fn:incmpl} \\
-% Latin Modern Roman\footnote{Alias: New Computer Modern}
+% & n, (it, sl, sc)\fnref{fn:ot-incmpl} \\
+% Latin Modern Roman
+% & Latin
+% & n, it, (sl)\fnref{fn:ot-itsl}\\
+% New Computer Modern
% & Latin, Greek
-% & n, it, (sl)\fnref{fn:it-sl}\\
+% & n, it, (sl)\fnref{fn:ot-itsl}\\
% Charis <SIL>
-% & Latin, Cyrillic, Greek
+% & Latin, Cyrillic
% & n, it, sc\\
-%\iffalse ^^A provided with the EB Garamond package
% <EB> Garamond
% & Latin, Cyrillic, Greek
% & n, it, sc, si\\
-%\fi
% Palatino\footnote{Aliases: Palatino Linotype, Palatino <LT> Std, \TeX\ Gyre Pagella, Domitian}
% & Latin
-% & n, it, sc\\
+% & n, it, sc\phantom{^^A
+% \footnote{Incomplete\label{fn:ot-incmpl}}
+% \footnote{Settings inherited from italic shape\label{fn:ot-itsl}}} \\
%\bottomrule
-%\end{tabular*}^^A
+%\end{tabularx}^^A
%\end{minipage}^^A
%}\kern-\dimexpr\fboxsep+\fboxrule\relax ^^A end \fcolorbox
%\end{table}
@@ -2252,7 +2430,7 @@
%\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
+% not find settings for it, also try the font name |cmr|. In fact, you will find
% this very line, along with some others, in the default configuration file.
%
%\medskip
@@ -2262,7 +2440,7 @@
% 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,
+% \cs{Microtype@Hook}, described in the Implementation part,
% section~\ref{sub:hook}.}
% This command will load the file `|mt-|\meta{font name}|.cfg|'.
%
@@ -2369,7 +2547,7 @@
%
%\section[Letterspacing revisited]
% {Letterspacing revisited \requires{\pdftex~1.40,\luatex~0.62}}
-% \label{sec:lettersp}
+% \label{sec:lettersp} ^^A [also referenced in microtype.ins]
%
%\Describe{Macro}{\textls}{?amount,general text}
% While the \opt{tracking} feature, described in section~\ref{sub:tracking},
@@ -2399,11 +2577,11 @@
%\medskip
%\Describe{Macro}{\lslig}{ligature}
% Since the commands \cs{textls} and \cs{lsstyle} will also evaluate the
-% `\texttt{no ligatures}' key for the respective font, you need not worry
+% `\texttt{no ligatures}' key for the respective font, you usually need not worry
% about protecting or breaking ligatures with most fonts. However, in certain
% situations, there may be a conflict of ligatures beginning with the same
-% letter, where some of them should be inhibited, while others should not. When
-% letterspacing text typeset in Fraktur fonts, for example, the ligatures `ch',
+% letter, where some of them should be inhibited, while others should not. For
+% example, when letterspacing text typeset in Fraktur fonts, the ligatures `ch',
% `ck', `tz' and `sz'~(`\textfrak{sz}') should never be broken up; you also usually
% see the `st'~(`\textfrak{st}') ligature in letterspaced text. Furthermore, at
% least the \pkg{yfonts} package realises the short~s~(`\textfrak{s:}') as the
@@ -2417,7 +2595,7 @@
% (namely, `\textls{\def\!#1{\textcolor{thegreen}{\lslig{#1}}}^^A
% \def\?#1{\textcolor{thered}{#1}}^^A
% \textfrak{Au\!{s:}\?{si}\!{ch}t\!{s:}lo\?{si}gkeit}}',
-% with ligatures shown in green, inhibited ligatures in red).
+% with ligatures here shown in green, inhibited ligatures in red).
%
%\begin{verbatim}[morekeywords={[0]{\kern}}]
%\SetTracking[no ligatures={f}]{encoding = LY, family = yfrak}{120}
@@ -2436,7 +2614,7 @@
% \microtype, omitting support for all the other extensions (and also omitting
% the possibilities of the \cs{SetTracking} command -- all `|f|' ligatures will
% be disabled, inner and outer spacing and outer kerning will be set to the
-% default values described in section~\ref{sub:tracking}). If you prefer to
+% default values described in section~\ref{sub:tracking}). If you would rather
% forgo \microtype's specialties, you may load the \letterspace\ package
% instead. Both packages should not be used at the same time.
%
@@ -2476,7 +2654,151 @@
% ^^A Otherwise, it won't work at all
%
%
-%\section{Hints and caveats}\label{sec:caveats}
+%\section{Being pedantic about protrusion}\label{sec:pedantic}
+%
+% Protrusion works well in running paragraphs, but may also be desirable
+% in situations where \TeX, in contrast to human eyes, would not see a margin,^^A
+% \footnote{Possibly because \TeX\ tends to look through its gastro-intestinal tract.}
+% \eg, in |itemize| or |tabular| environments.
+% The \microtype\ package offers two commands that may be inserted at
+% such an effective inner margin to make the first respectively last glyph
+% protrude as if it were located at a normal outer margin:
+%
+%\medskip
+%\Describe{Macro}{\leftprotrusion}{general text}
+% This command will add left protrusion for the following text.
+% You may also just say \cs{leftprotrusion} (without an argument), and
+% \microtype\ will gather the next glyph (possibly a ligature) before
+% adding protrusion on its left hand side.
+% For instance, you could add this command to tabular cell definitions
+% (using the \pkg{array} package):
+%\begin{verbatim}
+%\begin{tabular}{l>{\leftprotrusion}p{9cm}r}
+%\end{verbatim}
+% in order to get protrusion at the beginning of the |p| cell.
+%
+%\medskip
+%\Describe{Macro}{\rightprotrusion}{general text}
+% will typeset \meta{general text} and then add protrusion on the right side.
+% (Unfortunately, \TeX\ cannot look backwards at what it has already typeset,
+% so this command requires that the text be given in the argument.)
+%
+%\medskip\noindent
+%\DescribeMacro{\noprotrusion}
+% is a command from \LaTeX\ proper, so it's just mentioned apropos.
+% When added to the beginning or end of a line, protrusion at the respective
+% margin will be prevented.
+%
+%\medskip\noindent
+% The \microtype\ package defines a number of patches in order to get protrusion
+% right (with dedicated patches for the classes and packages indicated in
+% parentheses; they may still work with other classes or packages):
+%\begingroup
+%\list{}{\labelwidth=3em \itemindent\z@ \leftmargin=\labelwidth
+% \def\makelabel#1{\hskip\labelsep\texttt{#1}\hss}}
+%\def\MTsupp#1{\unskip\nobreak\hfil\penalty50 \hskip2em\hbox{}\nobreak\hfil
+% {\smaller(#1)}\parfillskip=0pt \finalhyphendemerits=0
+%}
+%^^A \microtypesetup{nopatch=item}
+% \item[item] Affects the first line of \cmd\item\kern.6pts in various environments, so that,
+% \eg, the two\break A's here -- the one in the current line and the one in the
+% line above -- are neatly aligned; without the patch, the first A would be
+% slightly shifted to the right.
+% This patch also affects environments such as |quote| or |flushleft|, which are
+% implemented in \LaTeX\ as lists with an implicit empty item.
+% \MTsupp{standard classes, \pkg{beamer}, \pkg{simplecv}}
+% \item[toc] Adds protrusion at the left margin of sectioning titles in the Table of Contents
+% and similar Lists of \meta{Things}.
+% \MTsupp{standard classes, \pkg{memoir}}
+% \item[footnote] Protrusion for the first line of footnote text (only visible when
+% the footnote text is set in block paragraphs, like in this document).
+% \MTsupp{standard classes, \pkg{memoir}, <KOMA> classes}
+% \item[eqnum] Protrusion for equation numbers on either side.
+% \MTsupp{standard classes, \pkg{amsmath}}
+%\endlist\endgroup
+%
+%\medskip\noindent
+% By default, all of the above patches will be applied. Should this not be desired,
+% or in case you are running into problems, you may prevent or undo the patches through
+% the \textcolor{thered}{\opt{patch}} and \textcolor{thered}{\opt{nopatch}} options,
+% either when loading the package:
+%\begin{verbatim}
+%\usepackage[nopatch=toc]{microtype}
+%\end{verbatim}
+% or, possibly temporarily, within the document:
+%\begin{verbatim}
+%\microtypesetup{nopatch=item}
+%\end{verbatim}
+%
+%\medskip\noindent
+%\leavevmode\llap{\itshape\color{thegrey}Help wanted!\hskip\marginparsep}^^A
+%\leftprotrusion These pedantic protrusion patches are work-in-progress. I suspect many use cases
+% where they either do not work as advertised, or worse, where they may even lead to errors.
+% Also, I am aware that there are myriads of classes and packages out there that
+% modify internal commands in their own ways, possibly rendering the patches useless.
+% Finally, there will certainly be many more situations where protrusion would be appropriate.
+% I would be happy to include more patches, or enhance the existing ones,
+% so I welcome any suggestions and problem reports you may have.
+%
+%
+%\section{Creating configurations and contributing}\label{sec:contrib} ^^A [also referencd in microtype.ins]
+%
+% I would also 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, \microtype\ includes the companion package
+%\DescribePackage{microtype-show}
+% \pkg{microtype-show}, which offers some tools to visually debug protrusion
+% settings. It should not be used in production contexts.
+%
+%\medskip\noindent
+%^^A don't index the commands from microtype-show as "Commands"
+%{\def\SpecialUsageIndex#1{\let\special@index\index\SpecialIndex@{#1}{\encapchar dochyperpage}}^^A
+%\DescribeMacro{\ShowCharacterInheritance}
+% These commands show all defined inheritance resp. protrusion settings
+% (the latter relative to character width, to \EM{1}, and as the effective kerning amount)
+%\DescribeMacro{\ShowProtrusion}
+% for the current font. They are most useful for consistency checks.
+%
+%\DescribeMacro{\ShowMissingGlyphstrue}
+% If the boolean \cs{ifShowMissingGlyphs} is set to true, the glyphs \textit{not}
+% included in the configuration will also be shown. Setting the switch
+%\DescribeMacro{\ShowGlyphIndextrue}
+% \cs{ifShowGlyphIndex} to true will additionally display the glyph (\pdftex)
+%\DescribeMacro{\GlyphScaleFactor}
+% respectively Unicode (\luatex) index number. Furthermore, you may alter the glyphs'
+% display size by redefining \cs{GlyphScaleFactor} (default:~|2|).
+%
+%\medskip\noindent
+%\DescribeMacro{\ShowProtrusionAll}
+% When preparing the actual protrusion settings, these commands may prove helpful.
+% Conveniently placing the glyphs at the margins, they show, respectively:
+%\DescribeMacro{\ShowProtrusionDefined}
+% all glyphs in the current font; only those with defined protrusion settings;
+%\DescribeMacro{\ShowProtrusionMissing}
+% or those without any protrusion settings.
+% (Note that here, the protrusion amounts are given in 1000ths of \EM{1}, not in
+% 1000ths of character widths).
+%^^A
+% The package also includes a test file that shows all of these commands in action
+% (\file{test-microtype.tex}).
+%}
+%
+%\medskip\noindent
+% If you have created a configuration file for another font, or if you have any
+% suggestions for enhancements in the default configuration files, I~would
+% gratefully accept them: \mailtoRS.
+%\iffalse\footnote{^^A ... OK, so nobody has any ...
+% Should you have lots of \pkg{pdfcprot} configuration files lying around,
+% I can also provide you with a \TeX\ conversion script. Just ask me.}
+%\fi
+%
+%\medskip\noindent
+% Development of the package takes place on GitHub, which also provides an
+% issue tracker for submitting bug reports and feature requests:
+% \url{\githuburl/issues}.
+%
+%
+%\section{Hints and caveats}\label{sec:caveats} ^^A [also referenced in: \MT@warn@unknown@once]
%
%\paragraph{Use settings that match your font.}
% Although the default settings should give reasonable results for most fonts,
@@ -2484,8 +2806,8 @@
% shapes that necessitate more or less protrusion. 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.
+% See the previous section for some tools for the preparation
+% of protrusion settings.
%
%\paragraph{Don't use too large a value for expansion.}
% Font expansion is a feature that is supposed to enhance the typographic
@@ -2498,6 +2820,8 @@
% Multiple Master font, you may set expansion limits to up to 4\%.
%
%\changes{v2.0}{2006/12/13}{qualify hint about web documents with regard to older \pdftex\ versions}
+%\changes{v3.0}{2021/05/25}{remove hint about web documents with pre-1.40 \pdftex\ (it's been 14 years~\dots)}
+%\iffalse ^^A pdftex 1.40 was released in 2007 ...
%\paragraph{Don't use font expansion for web documents (with older \pdftex\ versions).}
% With \pdftex\ versions older than 1.40, each expanded instance of the font
% will be embedded in the <PDF> file, hence the file size may increase by quite
@@ -2506,10 +2830,14 @@
% creating files to be distributed electronically. With \pdftex\ 1.40 and \luatex, which
% use a different technique of expansion, the increase of file size can be
% neglected.
+%\fi
%
%\changes{v2.2}{2007/07/06}{add hint about extra <TOC> leader dot
% (first discovered by \contributor Morten H\o gholm <morten.hoegholm\at latex-project.org>)}
% ^^A private mail, 2006/08/26
+%\changes{v3.0}{2021/05/15}{remove hint about extra <TOC> leader dot
+% (fixed in \LaTeX)}
+%\iffalse
%\paragraph{You might want to disable protrusion in the Table of Contents.}
% In unfortunate situations, enabled protrusion might internally alter the line
% length in the <TOC> and similar lists in such a way that an excess leader dot
@@ -2519,6 +2847,7 @@
%\tableofcontents
%\microtypesetup{protrusion=true}
%\end{verbatim}
+%\fi
%
%\changes{v1.9}{2005/07/10}{add hint about \texttt{verbatim} environment}
%\todo{option to patch \texttt{verbatim}?} ^^A for Karl
@@ -2587,11 +2916,11 @@
%\changes{v2.7b}{2018/09/18}{update hint about non-7-bit characters
% (notified by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)}
% ^^A private mail, 2018/08/14
-% \item Even though all configuration files are still provided in legacy (7-bit)
-% format, using multi-byte (Unicode) characters in the settings should run
+% \item Even though most configuration files are still provided in legacy (7-bit)
+% format, using multi-byte (Unicode) characters in the settings will run
% smoothly with an up-to-date \LaTeX\ system.
-% For older systems or documents in legacy encodings, in contrast, this requires
-% loading the \pkg{inputenc} package first.
+% For older systems or documents in legacy encodings, in contrast,
+% the \pkg{inputenc} package must be loaded first.
% Furthermore, when using multiple input encodings in a document, 8-bit characters in
% the settings will only work reliably if you specify the |inputenc| key.
%\changes{v2.3a}{2008/02/25}{add hint about \pkg{babel} having to be loaded first}
@@ -2628,27 +2957,27 @@
%\end{itemize}
%
%\changes{v1.8}{2005/06/23}{add hint about error messages}
-%\paragraph{Possible error messages and how to get rid of them (\textcolor{thegreen}{specs} may differ):}
+%\paragraph{Possible warning and error messages and how to get rid of them
+% (\textcolor{thegreen}{specs} may differ):}
%\begin{itemize}
-%\lstset{deletekeywords={[1]{expansion,auto}},belowskip=-\smallskipamount,frame=none,
-% xleftmargin=0pt,backgroundcolor=,basicstyle=\MacroFont\footnotesize,
-% delim=[is][\itshape\color{thegreen}]{<}{>}}
-%\changes{v1.9a}{2005/11/15}{add explanation for error message in <DVI> mode}
+%\lstset{style=message}
% \item
%\begin{verbatim}
%! Font csnameendcsname=<cmr10+20 at 10.0pt> not loadable: Metric (TFM) file not found.
%\end{verbatim}
+%\changes{v1.9a}{2005/11/15}{add explanation for error message in <DVI> mode}
% This error message will occur if you are trying to employ font expansion
% while creating <DVI> output. Remember that \emph{automatic} font expansion
% only works when running \pdftex\ or \luatex\ in <PDF> mode. Although expansion is also
% possible in <DVI> mode with \pdftex, it requires that all instances of the expanded fonts
% exist on your \TeX\ system.
%
-%\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40}
+%\pagebreak ^^A layout
% \item
%\begin{verbatim}
%! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts.
%\end{verbatim}
+%\changes{v2.2}{2007/06/13}{add hint about error message with \pdftex\ 1.40}
% Automatic font expansion has been improved in \pdftex\ 1.40, in that it now
% not only works with Type\,1 fonts but also with TrueType, OpenType and even
% non-embedded fonts. The above error message indicates either that you are
@@ -2656,12 +2985,35 @@
% possible, or that the font isn't found at all, \eg, because of missing map
% entries.
%
-%\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with
-% regard to older \pdftex\ versions}
+% \item
+%\begin{verbatim}
+%Package microtype Warning: Unknown slot number of character
+%(microtype) `<\k A>'
+%(microtype) in font encoding `TU' in inheritance list
+%(microtype) `microtype.cfg/406(protrusion)'.
+%\end{verbatim}
+%\changes{v3.0}{2021/06/26}{add hint about unknown slot numbers}
+% If you receive lots of warnings like the above, and you are running \luatex\
+% or \xetex, this probably means that the font you are using contains less
+% glyphs than are defined in the default protrusion and/or inheritance settings.
+% For such fonts, the \microtype\ package defines basic inheritance settings
+% to which you may alias your font (the generic protrusion settings will
+% still be loaded). Try adding the line:
+%\begin{verbatim}[style=microtype,belowskip=0pt]
+%\DeclareMicrotypeAlias{"\rmfamily\meta{your font}"}{TU-basic}
+%\end{verbatim}
+% to the preamble. For symbol fonts, you may even use the alias |TU-empty|,
+% which is, well, empty, meaning that no protrusion will be applied at all
+% to this font. Note that these aliases are just meant to provide an easy way
+% of getting rid of the warnings, while the proper solution would be to create
+% inheritance and protrusion settings specific to the font in question.
+%
% \item
%\begin{verbatim}
%Warning: pdflatex: font <ptmr8r> cannot be expanded (not an included Type1 font)
%\end{verbatim}
+%\changes{v2.0}{2006/12/13}{qualify hints about expansion error messages with
+% regard to older \pdftex\ versions}
% and the <PDF> viewer complains about a missing font, \eg, Adobe Reader thusly:
%\begin{verbatim}[aboveskip=\smallskipamount]
%Could not find a font in the Resources dictionary - using Helvetica instead.
@@ -2673,23 +3025,23 @@
% distributions, this can be changed in the file \file{updmap.cfg} by setting
% |pdftexDownloadBase14| to |true|.
%
-%\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts}
% \item
%\begin{verbatim}
%Warning: pdflatex (file <ecrm1000+20>): Font <ecrm1000+20 at 1200> not found
%\end{verbatim}
+%\changes{v1.9a}{2005/11/15}{add explanation for error message with non-Type\,1 fonts}
% Furthermore, \pdftex\ versions older than 1.40 require Type\,1 fonts for
% automatic font expansion. When you receive a message like the above, you are
% probably trying to apply font expansion to a bitmap or TrueType font. With
% older \pdftex\ versions, this is only possible if you manually create
% expanded instances of the fonts.
%
-%\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max}
-% and \texttt{font\textunderscore mem\textunderscore size}}
% \item
%\begin{verbatim}
%! Font <T1/cmr/m/n/10>=<ecrm1000 at 10.0pt> not loaded: Not enough room left.
%\end{verbatim}
+%\changes{v2.0}{2006/11/05}{add hint about how to increase \texttt{font\textunderscore max}
+% and \texttt{font\textunderscore mem\textunderscore size}}
% Memory parameter `|font_mem_size|' too small.
% \item
%\begin{verbatim}
@@ -2709,12 +3061,13 @@
% for \miktex, in the file \file{miktex.ini} (2.4 or older) resp.
% \file{pdflatex.ini} (2.5 or newer).
%
-%\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and}
-% expansion is applied to a font}
% \item
-%\begin{verbatim}[deletekeywords={[1]{expansion}}]
+%\pagebreak ^^A layout
+%\begin{verbatim}
%pdfTeX warning (font expansion): font should be expanded before its first use
%\end{verbatim}
+%\changes{v2.0}{2007/01/05}{add hint about warning when tracking \emph{and}
+% expansion is applied to a font}
% This warning will occur with \pdftex\ versions older than 1.40.4, if tracking
% \emph{and} expansion is applied to a font. It is harmless and can be ignored.
%\end{itemize}
@@ -2727,29 +3080,13 @@
% \href{http://mirror.ctan.org/macros/latex/contrib/microtype/}
% {\acronym{CTAN}}.
% For the source code of the logo on the title page and of the letterspacing
-% sample from section~\ref{sub:tracking}, see the appendices~\ref{sec:title-logo}
-% and \ref{sec:letterspace-ill}.
+% sample from section~\ref{sub:tracking}, see the Implementation part,
+% appendices~\ref{sec:title-logo} and \ref{sec:letterspace-ill}.
%\changes{v2.5a}{2013/05/23}{add notes on typesetting the documentation}
% If you want to re-typeset the documentation, read the comments at the end of
% \file{microtype.dtx}.
%
%
-%\section{Contributions}
-%
-% I would be glad to include configuration files for more fonts. Preparing such
-% configurations is quite a time-consuming task and requires a lot of patience.
-% To alleviate this process, this package also includes a test file that can be
-% used to check at least the protrusion settings (\file{test-microtype.tex}).
-%^^A
-% If you have created a configuration file for another font, or if you have any
-% suggestions for enhancements in the default configuration files, I~would
-% gratefully accept them: \mailtoRS.
-%\iffalse\footnote{^^A ... OK, so nobody has any ...
-% Should you have lots of \pkg{pdfcprot} configuration files lying around,
-% I can also provide you with a \TeX\ conversion script. Just ask me.}
-%\fi
-%
-%
%\section{Acknowledgments}
%
% This package would be pointless if
@@ -2774,8 +3111,7 @@
% interword spacing adjustment and additional character kerning.
% \contributor Georg Duffner <g.duffner\at gmail.com> has patiently tested
% \microtype\ under \xetex\ and \luatex\ with his beautiful OpenType font
-% <EB>~Garamond\footnote{\ctanpkgurl{ebgaramond}, including configuration
-% files for \microtype.}.
+% <EB>~Garamond.
% My thanks also go to
% \contributor Maciej Eder <maciej_eder\at poczta.onet.pl>
% for contributing settings for the <QX> encoding, as well as to
@@ -2785,7 +3121,12 @@
% who made substantial improvements to the Computer Modern Roman italic settings.
% I thank
% \contributor Loren~B. Davis <davislo\at eecs.oregonstate.edu>
-% for providing protrusion settings for OpenType versions of Palatino Linotype.
+% for providing protrusion settings for OpenType versions of Palatino Linotype,
+% as well as
+% \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>
+% for settings for his New Computer Modern font. The latter also showcase the
+% new feature of automatically calculated protrusion, which was an original idea by
+% \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>. ^^A also https://tex.stackexchange.com/users/176404/d909
% I am also very much indebted to
% \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>,
% who not only contributed the |lua| module in the first place, but also,
@@ -2894,14 +3235,19 @@
% \contributor Paolo Polesana <@\at @>, ^^A https://tex.stackexchange.com/users/95083/paolo-polesana
% \contributor Oliver Kopp <koppdev\at gmail.com>,
% \contributor Hironori Kitagawa <h_kitagawa2001\at yahoo.co.jp>,
-% \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>, ^^A also https://tex.stackexchange.com/users/176404/d909
+% \contributor Aman Mehra <reportaman\at gmail.com>, ^^A also https://tex.stackexchange.com/users/192717/reportaman
% \contributor Md Ayquassar <mdayq0\at lenta.ru>,
+% \contributor Holger Gerhardt <holger.gerhardt\at uni-bonn.de>,
% \contributor Marcel Kr\"uger <tex\at 2krueger.de>,
% \contributor Ekkehart Schlicht <ekkehart.schlicht\at gmail.com>,
% `\contributor Canageek <@\at @>', ^^A https://tex.stackexchange.com/users/7880/canageek
-% `\contributor dsedivec <@\at @>' ^^A https://tex.stackexchange.com/users/1680/dsedivec
+% `\contributor dsedivec <@\at @>', ^^A https://tex.stackexchange.com/users/1680/dsedivec
+% `\contributor DORpapst <@\at @>', ^^A https://tex.stackexchange.com/users/104965/dorpapst
+% `\contributor chsk <@\at @>', ^^A https://tex.stackexchange.com/users/158639/chsk
+% `\contributor tnull <@\at @>', ^^A https://tex.stackexchange.com/users/91987/tnull
+% `\contributor azur <@\at @>' ^^A https://tex.stackexchange.com/users/216369/azur
% and
-% `\contributor DORpapst <@\at @>'. ^^A https://tex.stackexchange.com/users/104965/dorpapst
+% `\contributor Safron <@\at @>'. ^^A https://tex.stackexchange.com/users/149123/safron
%
%
%\iffalse
@@ -2975,7 +3321,7 @@
% \bibitem[\pdftex\ manual]{pdftexman}
% \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, Karl Berry,
% \emph{The \pdftex\ user manual},
-% \newblock 2~March 2020.
+% \newblock 18~February 2021.
% \newblock (\ctanurl{systems/doc/pdftex/manual/pdftex-a.pdf})
% ^^A latest version at \url{http://sarovar.org/projects/pdftex/}
% ^^A or even \url{http://foundry.supelec.fr/scm/?group_id=23}
@@ -2986,8 +3332,8 @@
% \newblock (\ctanurl{info/fontname/fontname.pdf})
%
% \bibitem[\LaTeXe\ font selection]{fntguide}
-% \LaTeX3 Project Team, \emph{\LaTeXe\ font selection},
-% \newblock November 2020.
+% \LaTeX\ Project Team, \emph{\LaTeXe\ font selection},
+% \newblock March 2021.
% \newblock (\ctanurl{macros/latex/base/fntguide.pdf})
%
% \bibitem[\pkg{fontspec}]{fontspec}
@@ -2997,9 +3343,9 @@
% \newblock (\ctanpkgurl{fontspec})
%
% \bibitem[\pkg{luaotfload}]{luaotfload}
-% \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger,
+% \LaTeX3 Project, \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger,
% \emph{The \pkg{luaotfload} package},
-% \newblock 8~January 2021.
+% \newblock 21~May 2021.
% \newblock (\ctanpkgurl{luaotfload})
%
% \bibitem[\pkg{pdfcprot}]{pdfcprot}
@@ -3019,14 +3365,11 @@
%\end{thebibliography}
%
%
-%\section{Short history}
+%\section{Changes}
%\changes{v1.5}{2004/12/11}{add `Short history'}
%
-% The comprehensive list of changes can be
-% \expandafter\ifx\csname r@sec:changes\endcsname\relax
-% obtained by running `\texttt{makeindex \mbox{-s gglo.ist}
-% \mbox{-o microtype.gls} microtype.glo}'\else
-% found in appendix~\ref{sec:changes}\fi.
+% The comprehensive list of changes can be found in the Implementation part,
+% appendix~\ref{sec:changes}.
% The following is a list of all changes relevant in the user land; bug and
% compatibility fixes are swept under the rug. Numbers in brackets indicate
% the relevant section in this manual.
@@ -3046,11 +3389,29 @@
% \vskip\topsep
% \nopagebreak}
%\newcommand\VersionDate[2]{^^A needed in the Change history
-% \global\expandafter\def\csname MTversiondate#1\endcsname{#2}}
+% \global\expandafter\def\csname MTversiondate#1\endcsname{#2}^^A
+% \immediate\write\histtmp{\string\VersionDate{#1}{#2}}}
+%
+%\newwrite \histtmp
+%\immediate\openout \histtmp=microtype-hist.tmp
%
%\begin{History}
%
-%\VersionDate{\expandafter\@gobble\fileversion}{\filedate}
+%\Version{\expandafter\@gobble\fileversion}{\filedate}
+% \item Possibility of automatical protrusion based on difference of character widths
+% \refsection{\ref{sub:inheritance}}
+% \item New commands \cs{leftprotrusion} and \cs{rightprotrusion};
+% various patches to get protrusion right \refsection{\ref{sec:pedantic}}
+% \item New option \opt{disable}, replacing the |draft| option; deprecate option |final|
+% \refsection{\ref{sub:options-misc}}
+% \item New package \pkg{microtype-show} for visual debugging of protrusion settings
+% \refsection{\ref{sec:contrib}}
+% \item Protrusion settings for New Computer Modern (OpenType)
+% \item Protrusion settings for <EB> Garamond (OpenType)
+% \item New generic protrusion settings for \luatex/\xetex\ \refsection{\ref{sec:caveats}}
+% \item Move development to \href{\githuburl}{GitHub}
+%
+%\VersionDate{2.8c}{2021/03/14}
%
%\VersionDate{2.8b}{2021/02/25}
%
@@ -3072,7 +3433,7 @@
% \item Allow automatic expansion and letterspacing with \luatex\ in <DVI> mode
% (aka. \texttt{dvilualatex})
% \refsection{\ref{sub:options-microtype}, \ref{sub:options-expansion}, table~\ref{tab:available-features}}
-% \item Compatibility with \LaTeX\ 2017/01/01 (fix warnings)
+%^^A \item Compatibility with \LaTeX\ 2017/01/01 (fix warnings)
%
%\VersionDate{2.6a}{2016/05/14}
%
@@ -3091,7 +3452,7 @@
% \item Support for protrusion with \xetex\ $\geq$ 0.9997
% \item Support for tracking/letterspacing with \luatex\ $\geq$ 0.62
% \item Allow context-sensitive setup with \luatex
-% \item Info if protrusion settings are generic
+% \item Info instead of warning if protrusion settings are generic
% \item Protrusion settings for Latin Modern Roman (OpenType)
% \item Protrusion settings for Charis SIL (OpenType)
% \item Protrusion settings for Palatino Linotype (OpenType)
@@ -3221,7 +3582,7 @@
% \item New option `\opt{unit}' to measure protrusion factors relative to a
% dimension instead of the character width
% \refsection{\ref{sub:protrusion}}
-% \item Renamed commands from \cs{..MicroType..} to \cs{..Microtype..}
+% \item Renamed commands from \cmd{\..MicroType..} to \cmd{\..Microtype..}
% \item Protrusion settings for <AMS> math fonts
% \item Protrusion settings for Times in <LY1> encoding completed
% \item The `|allmath|' font set also includes <U> encoding
@@ -3238,10 +3599,10 @@
% \item New command \cs{LoadMicrotypeFile} to load a configuration file manually
% \refsection{\ref{sub:config-file}}
% \item New command \cs{Microtype@Hook} for font package authors
-% \refsection{\ref{sub:hook}}
+% \refsection{Implementation, \ref{sub:hook}}
% \item New option `\opt{verbose}|=errors|' to turn all warnings into errors
%^^A \item Disable expansion inside \cmd\showhyphens
-% \item Warning when running in draft mode
+% \item Warning when running in disable mode
%
%\VersionDate{1.6a}{2005/02/02}
%
@@ -3305,14 +3666,24 @@
% \item First <CTAN> release
%\end{History}
%
+%\immediate\closeout\histtmp
+%
+%\fi ^^A ifcodedoc
+%
%
%\def\AppendixSettings{
-% \addtolength\textwidth{50pt}
-% \addtolength{\oddsidemargin}{-50pt}
-% \setlength{\columnwidth}{\textwidth}
-% \setlength{\hsize}{\textwidth}
-% \setlength{\linewidth}{\textwidth}
-% \footnotesize
+% \ifcodedoc
+% \addtocontents{toc}{\protect\pagebreak} ^^A layout
+% \addtolength\textwidth{50pt}
+% \addtolength{\oddsidemargin}{-50pt}
+% \setlength{\columnwidth}{\textwidth}
+% \setlength{\hsize}{\textwidth}
+% \setlength{\linewidth}{\textwidth}
+% \newpage
+% \footnotesize
+% \else
+% \small
+% \fi
%}
%
%\def\LPPLSettings{
@@ -3334,12 +3705,9 @@
%\StopEventually{
% \GeneralChanges{Documentation}
% \ifx\Finale\relax
-% \newpage
-% \appendix
% \AppendixSettings
% \fi
% \PrintIndex
-% \InputIfFileExists{lppl.tex}\LPPLSettings\relax
%}
%
% \GeneralChanges*
@@ -3374,75 +3742,92 @@
% \advance,\afterassignment,\aftergroup,\begingroup,\bgroup,\catcode,\char,
% \chardef,\csname,\def,\divide,\edef,\egroup,\else,\endcsname,\endgroup,
% \endinput,\escapechar,\everypar,\expandafter,\fi,\futurelet,\gdef,\global,
-% \hbadness,\hbox,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox,
-% \ifhmode,\ifmmode,\ifnum,\iftrue,\ifx,\immediate,\input,\inputlineno,\jobname,
-% \kern,\lastkern,\lastskip,\let,\lowercase,\maxdimen,\meaning,\multiply,
-% \newlinechar,\noexpand,\number,\or,\parfillskip,\pretolerance,\relax,\setbox,
-% \showboxdepth,\string,\the,\tolerance,\unkern,\unskip,\uppercase,\vbox,\wd,
-% \write,\xdef}
-%^^A\DoNotIndex{\font,\fontdimen,\nullfont,\sfcode,\spacefactor,\spaceskip,
-%^^A \xspaceskip} ^^A tex
+% \hbadness,\hbox,\hfill,\hrule,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox,
+% \ifhmode,\ifmmode,\ifnum,\iftrue,\ifx,\ignorespaces,\immediate,\input,
+% \inputlineno,\jobname,\kern,\lastbox,\lastkern,\lastskip,\leaders,\let,\lowercase,
+% \maxdimen,\meaning,\multiply,\newlinechar,\noexpand,\noindent,\number,
+% \or,\parfillskip,\pretolerance,\relax,\setbox,\showboxdepth,\splittopskip,
+% \string,\the,\tolerance,\unkern,\unskip,\unvbox,\uppercase,\vbadness,\vbox,
+% \vrule,\vsplit,\wd,\write,\xdef}
+%^^A\DoNotIndex{\font,\fontdimen,\fontname,\nullfont,\sfcode,\spacefactor,
+%^^A \spaceskip,\xspaceskip} ^^A tex
%\DoNotIndex{\currentgrouplevel,\currentgrouptype,\currentiflevel,\detokenize,
-% \dimexpr,\eTeXversion,\ifcsname,\ifdefined,\numexpr}
+% \dimexpr,\eTeXversion,\ifcsname,\ifdefined,\lastnodetype,\numexpr}
%^^A\DoNotIndex{\fontcharwd,\iffontchar} ^^A e-tex
-%\DoNotIndex{\pdfannot,\pdfescapestring,\pdfmatch,\pdfoutput,\pdfstrcmp,
+%\DoNotIndex{\pdfannot,\pdfmatch,\pdfoutput,\pdfstrcmp,
% \pdftexrevision,\pdftexversion}
%^^A\DoNotIndex{\(ef,lp,rp,kn(ac,bc),(kn,sh,st)bs)code,\(left,right)marginkern,
%^^A \tagcode,\letterspacefont,\pdfcopyfont,\pdffontexpand,\pdfnoligatures,
%^^A \pdfprotrudechars,\pdfadjust(interwordglue,spacing),\pdf(ap,pre)pendkern,
%^^A \pdftracingfonts} ^^A pdftex
-%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp} ^^A xetex
+%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp}
%^^A\DoNotIndex{\XeTeXcharglyph,\XeTeXfonttype,\XeTeXglyph,\XeTeXglyphindex,
-%^^A \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars}
-%\DoNotIndex{\directlua,\glet,\luatexversion} ^^A luatex
+%^^A \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars} ^^A xetex
+%\DoNotIndex{\directlua,\glet,\luatexversion}
%^^A\DoNotIndex{\adjustspacing,\copyfont,\expandglyphsinfont,
-%^^A \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts}
+%^^A \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts} ^^A luatex
%\DoNotIndex{\eplain,\usepkg@pkg} ^^A eplain
-%\DoNotIndex{\@backslashchar,\@cclv,\@cclvi,\@classoptionslist,\@currext,
-% \@currname,\@defaultunits,\@empty,\@expandtwoargs,\@firstofone,\@firstoftwo,
-% \@gobble,\@gobbletwo,\@ifclassloaded,\@ifl@t@r,\@ifl@aded,\@ifpackagelater,
-% \@ifpackageloaded,\@ifstar,\@ifundefined,\@let@token,\@m,\@makeother,
-% \@minus,\@nameuse,\@ne,\@nil,\@nnil,\@onelevel@sanitize,\@onlypreamble,
-% \@percentchar,\@pkgextension,\@plus,\@ptionlist,\@removeelement,\@secondoftwo,
-% \@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,
-% \@typeset@protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist,
-% \@xobeysp,\check@icr,\color@begingroup,\color@endgroup,\g@addto@macro,
-% \hmode@bgroup,\m@ne,\maybe@ic,\maybe@ic@,\nfss@text,\not@math@alphabet,
-% \on@line,\p@,\set@display@protect,\strip@prefix,\strip@pt,\tw@,\z@,\z@skip,
-% \zap@space,\active,\documentclass,\fmtversion,\leavevmode,\makeatletter,
-% \mbox,\newcommand,\newcount,\newdimen,\newif,\newskip,\newtoks,\nobreak,
-% \nonfrenchspacing,\normalsize,\renewcommand,\space,\AddToHook,\AtBeginDocument,
-% \AtEndOfPackage,\CheckCommand,\CurrentOption,\DeclareRobustCommand,\IfFileExists,
-% \InputIfFileExists,\MessageBreak,\PackageError,\PackageInfo,\PackageWarning,
-% \RequirePackage,\@@enc@update,\cf@encoding,\f@encoding}
-%^^A\DoNotIndex{\add@accent,\curr@fontshape,\define@newfont,\do@subst@correction,
-%^^A \every@math@size,\f@size,\font@name,\glb@currsize,\glb@settings,\normalfont,
-%^^A \pickup@font,\remove@tlig,\selectfont,\set@fontsize,\showhyphens} ^^A latex
+%\DoNotIndex{\@backslashchar,\@car,\@cclvi,\@classoptionslist,\@currext,
+% \@currname,\@defaultunits,\@empty,\@eqnnum,\@expandtwoargs,\@firstofone,
+% \@firstoftwo,\@footnotetext,\@gobble,\@gobbletwo,\@ifclassloaded,\@ifl@t@r,
+% \@ifl@aded,\@ifpackagelater,\@ifpackageloaded,\@ifstar,\@ifundefined,\@item,
+% \@let@token,\@m,\@M,\@makeother,\@minus,\@nameuse,\@ne,\@newlistfalse,\@nil,\@nnil,
+% \@onelevel@sanitize,\@onlypreamble,\@pkgextension,\@plus,\@ptionlist,\@removeelement,
+% \@secondoftwo,\@spaces,\@sptoken,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,
+% \@typeset@protect,\@undefined,\@unprocessedoptions,\@unusedoptionlist,\@xobeysp,
+% \check@icr,\color@begingroup,\color@endgroup,\g@addto@macro,\hmode@bgroup,\m@ne,
+% \maybe@ic,\maybe@ic@,\nfss@text,\not@math@alphabet,\on@line,\p@,\set@display@protect,
+% \strip@prefix,\strip@pt,\@text@composite,\tw@,\z@,\z@skip,\zap@space,
+% \active,\documentclass,\dotfill,\fbox,\fboxrule,\fboxsep,\fmtversion,\footnotesize,
+% \leavevmode,\llap,\makeatletter,\makebox,\mathrm,\mbox,\medskip,\newbox,\newcommand,
+% \newcount,\newdimen,\newif,\newline,\newskip,\newtoks,\nobreak,\nonfrenchspacing,
+% \normalbaselineskip,\normalsize,\numberline,\par,\parbox,\quad,\raggedright,
+% \renewcommand,\scalebox,\space,\strut,\textwidth,\texttt,\tiny,\usefont,
+% \AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,\CurrentOption,
+% \DeclareOption,\DeclareRobustCommand,\IfFileExists,\IfFormatAtLeastTF,\InputIfFileExists,
+% \MessageBreak,\PackageError,\PackageInfo,\PackageWarning,\PassOptionsToPackage,
+% \ProcessOptions,\RequirePackage,\@@enc@update,\UnicodeEncodingName}
+%^^A\DoNotIndex{\add@accent,\cf@encoding,\curr@fontshape,\define@newfont,
+%^^A \do@subst@correction,\f@encoding,\f@family,\f@size,\font@name,\fontencoding,
+%^^A \fontseries,\fontshape,\glb@currsize,\glb@settings,\normalfont,\pickup@font,
+%^^A \remove@tlig,\selectfont,\seriesdefault,\shapedefault,\set@fontsize,\showhyphens} ^^A latex
%\DoNotIndex{\normalpdfoutput,\normalpdftexversion,\normalpdftexrevision} ^^A tex live 2004
%\DoNotIndex{\foreign@language,\languagename,\select@language,\shorthandoff} ^^A babel
%\DoNotIndex{\percentsign} ^^A babel/spanish,galician,mexican
%\DoNotIndex{\CJK@ifundefined,\CJK@plane,\CJK@temp,\CJK@addcmap} ^^A CJK,CJKutf8
+%\DoNotIndex{\color} ^^A color
%\DoNotIndex{\@disablequotes} ^^A csquotes
%\DoNotIndex{\pdfstringdefDisableCommands,\pdfstringdefWarn} ^^A hyperref
-%\DoNotIndex{\ifpdf} ^^A ifpdf
+%\DoNotIndex{\ifpdf,\ifetex,\ifluatex,\ifxetex} ^^A ifpdf/iftex
%\DoNotIndex{\@inpenc@undefined@,\IeC,\inputencoding,\inputencodingname} ^^A inputenc
-%\DoNotIndex{\UTFviii@defined} ^^A inputenc/utf8
+%^^A\DoNotIndex{\UTFviii@defined,\UTF@four@octets@noexpand, ^^A inputenc/utf8
+%^^A \UTF@three@octets@noexpand,\UTF@two@octets@noexpand,
+%^^A \UTFviii@four@octets,\UTFviii@three@octets,\UTFviii@two@octets}
%\DoNotIndex{\PrerenderUnicode,\unicode@charfilter} ^^A inputenc/utf8x
%\DoNotIndex{\define@key,\KV@@sp@def,\setkeys} ^^A keyval
%\DoNotIndex{\l@dunhbox@line} ^^A ((r)e)ledmac,((r)e)ledpar
%\DoNotIndex{\lst@ProcessLetter} ^^A listings
-%\DoNotIndex{\RequireLuaModule} ^^A luatexbase
+%\DoNotIndex{\newluafunction} ^^A luatexbase
%\DoNotIndex{\pdf@escapestring} ^^A pdftexcmds
%\DoNotIndex{\py@macron} ^^A pinyin
%\DoNotIndex{\SOUL@,\SOUL@doword,\soulregister} ^^A soul
%\DoNotIndex{\tikz@expandcount} ^^A tikz
%\DoNotIndex{\conditionally@traceoff} ^^A trace
%\DoNotIndex{\@xspace,\@xspace@firsttrue} ^^A xspace
+%\DoNotIndex{\apptocmd,\patchcmd} ^^A etoolbox
+%\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem} ^^A beamer
+%\DoNotIndex{\eqref,\tagform@} ^^A amsmath
+%\DoNotIndex{\@topic@item} ^^A simplecv
+%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline,
+% \cftbookafterpnum,\cftchapterafterpnum,\cftfigureafterpnum,\cftparagraphafterpnum,
+% \cftpartafterpnum,\cftsectionafterpnum,\cftsubparagraphafterpnum,\cftsubsectionafterpnum,
+% \cftsubsubsectionafterpnum,\cfttableafterpnum} ^^A memoir
+%\DoNotIndex{\setuptoc,\unsettoc,\scr@saved@footnotetext} ^^A koma (tocbasic)
%\DoNotIndex{\x,\MT@dinfo,\MT@dinfo@nl,\tracingmicrotype,\tracingmicrotypeinpdf,
% \ifMT@inannot,\MT@inannottrue,\MT@inannotfalse,\MT@addto@annot,\MT@pdf@annot,
% \MT@show@pdfannot,\iftracingmicrotypeinpdfall,\tracingmicrotypeinpdfalltrue,
-% \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeSet,\DeclareMicroTypeAlias,
-% \UseMicroTypeSet,\LoadMicroTypeFile,\MicroType@Hook} ^^A microtype
+% \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeAlias,\DeclareMicroTypeSet,
+% \LoadMicroTypeFile,\UseMicroTypeSet,\MicroType@Hook} ^^A microtype
%
% ^^A -------------------------------------------------------------------------
%
@@ -3456,9 +3841,10 @@
% \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}).
-% \item[|pdftex-def|] Definitions specific to \pdftex\ (\file{microtype-pdftex.def}).
-% \item[|xetex-def|] Definitions specific to \xetex\ (\file{microtype-xetex.def}).
-% \item[|luatex-def|] Definitions specific to \luatex\ (\file{microtype-luatex.def}).
+% \item[|show|] The code for the \pkg{microtype-show} package (\file{microtype-show.sty}).
+% \item[|pdf-|] Definitions specific to \pdftex\ (\file{microtype-pdftex.def}).
+% \item[|lua-|] Definitions specific to \luatex\ (\file{microtype-luatex.def}).
+% \item[|xe-|] Definitions specific to \xetex\ (\file{microtype-xetex.def}).
% \item[|letterspace|] The code for the \letterspace\ package (\file{letterspace.sty}).
% \begin{description}
% \item[|plain|] Code for \pkg{eplain}, \pkg{miniltx} (\letterspace\ only).
@@ -3608,13 +3994,15 @@
\expandafter\let\csname ver@letterspace.sty\endcsname\@empty
% \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..}}
+% The old command names had one more hunch (|\..MicroType..|).
+% Before finally letting them sink into oblivion, raise an error.
+%\changes{v1.8}{2005/04/28}{renamed commands from \cmd{\..MicroType..} to \cmd{\..Microtype..}}
+%\changes{v3.0}{2020/04/10}{old command names will raise an error}
% \begin{macrocode}
\def\MT@old@cmd#1#2{%
- \newcommand*#1{\MT@warning{%
+ \newcommand*#1{\MT@error{%
\string#1 is deprecated. Please use\MessageBreak
- \string#2 instead}%
+ \string#2 instead}{As I said}%
\let #1#2#2}}
% \end{macrocode}
%\end{macro}
@@ -3764,6 +4152,7 @@
}
%</debug>
%</package>
+%</package|letterspace>
% \end{macrocode}
%\end{macro}
%\ifpdf\ifx\tracingmicrotypeinpdf\undefined\else
@@ -3771,8 +4160,384 @@
% \tracingmicrotype0
%\fi\fi
%
+%\subsubsection{Visual debugging}
+%
+%\changes{v3.0}{2021/06/02}{new package: \pkg{microtype-show} for visual debugging}
+% The \pkg{microtype-show} package offers some tools for preparing
+% protrusion settings. We make use of the \microtype\ infrastructure,
+% redefining some of its internal commands (done later,
+% in sections \ref{ssub:setup-prot} and \ref{ssub:setup-config}).
+% First, some preparation:
+% \begin{macrocode}
+%<*show>
+\RequirePackage{iftex}
+\ifetex\else
+ \PackageError{microtype-show}
+ {This package only works with e-TeX}{Use e-TeX}
+\fi
+\ifxetex
+ \PackageError{microtype-show}
+ {This package only works with pdfTeX or luaTeX}{Don't use XeTeX}
+\fi
+\PackageWarning{microtype-show}{DO NOT USE THIS PACKAGE FOR REAL DOCUMENTS\@gobble}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{microtype}}
+\ProcessOptions\relax
+\PassOptionsToPackage{verbose}{microtype}
+\RequirePackage{microtype,graphicx,xcolor}
+% \end{macrocode}
+%\begin{macro}{\ifShowGlyphIndex}
+%\begin{macro}{\ifShowMissingGlyphs}
+%\begin{macro}{\GlyphScaleFactor}
+%\begin{macro}{\Showbaselinecolor}
+%\begin{macro}{\Showposcolor}
+%\begin{macro}{\Shownegcolor}
+% The following commands are configurable:
+% \begin{macrocode}
+\newif\ifShowGlyphIndex
+\newif\ifShowMissingGlyphs
+\newcommand*\GlyphScaleFactor{2}
+\newcommand*\Showbaselinecolor{\color{black!40}}
+\newcommand*\Showposcolor{\color{green!50}}
+\newcommand*\Shownegcolor{\color{red!50}}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MTS@printtext}
+%\begin{macro}{\MTS@show@index}
+%\begin{macro}{\MTS@crulefill}
+% Make sure to have a readable font.
+% \begin{macrocode}
+\ifluatex
+ \def\MTS@printtext#1{{\usefont{TU}{lmr}{m}{n}#1}}
+\else
+ \def\MTS@printtext#1{{\usefont{T1}{cmr}{m}{n}#1}}
+\fi
+\def\MTS@show@index#1{\ifShowGlyphIndex{\tiny$_{#1}%
+ % \ifluatex^{\mathrm{%
+ % \MT@lua{tex.print(luaotfload.aux.name_of_slot(tonumber([[#1]])))}}}\fi
+ $}\fi\space}
+\def\MTS@crulefill{\leaders\hrule height \dimexpr1ex/2+.4pt depth -\dimexpr1ex/2\hfill}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MTS@Prot}
+%\begin{macro}{\MTS@Char}
+% Add the |show| commands to \microtype's setup.
+% \begin{macrocode}
+\g@addto@macro\MT@setupfont{\MTS@Prot\MTS@Char}
+\let\MTS@Prot\relax
+\let\MTS@Char\relax
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MTS@setup}
+%\begin{macro}{\MTS@glyphlist}
+% Common setup. \cs{MTS@glyphlist} stores all glyphs we've seen.
+% \begin{macrocode}
+\def\MTS@setup{%
+ \fboxsep=0pt
+ \fboxrule=.1pt
+ \raggedright
+ \let\MTS@glyphlist\@gobble
+ \def\MT@feat{pr}%
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\ShowProtrusion}
+% Activate the sleeper command, then trigger the setup.
+% \begin{macrocode}
+\newcommand*\ShowProtrusion{%
+ \begingroup
+ \MTS@setup
+ \let\MTS@Prot\MTS@Prot@do
+ \def\MT@cat{c}%
+ \selectfont
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@Prot@do}
+% But in all other cases of a font being picked up, there should
+% be no special treatment. After we're done, select the previous
+% font again.
+% \begin{macrocode}
+\def\MTS@Prot@do{%
+ \MT@ltx@pickupfont
+ \let\MT@pr@split@val\MTS@pr@split@val
+ \let\MT@load@list\MTS@load@list
+ \let\MT@set@pr@prefixes@\MTS@set@pr@prefixes@
+ \MTS@show@pr
+ \endgroup
+ \aftergroup\selectfont
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowCharacterInheritance}
+% \begin{macrocode}
+\newcommand*\ShowCharacterInheritance{%
+ \begingroup
+ \MTS@setup
+ \let\MTS@Char\MTS@Char@do
+ \def\MT@cat{inh}%
+ \selectfont
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@Char@do}
+% \begin{macrocode}
+\def\MTS@Char@do{%
+ \MT@ltx@pickupfont
+ \let\MT@set@pr@prefixes@\MTS@set@pr@prefixes@
+ \MTS@show@inheritance
+ \endgroup
+ \aftergroup\selectfont
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowProtrusionLineGlyph}
+% By glyph.
+% \begin{macrocode}
+\newcommand*\ShowProtrusionLineGlyph[1]{%
+ {\MTS@setup
+ \MTS@showprotrusionline{`#1}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowProtrusionLineIndex}
+% By glyph number.
+% \begin{macrocode}
+\newcommand*\ShowProtrusionLineIndex[1]{%
+ {\MTS@setup
+ \MTS@showprotrusionline{#1}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@showprotrusionline}
+%\begin{macro}{\MTS@lpcode}
+%\begin{macro}{\MTS@rpcode}
+% \begin{macrocode}
+\def\MTS@showprotrusionline#1{%
+ \edef\MTS@lpcode{\number\lpcode\font#1}%
+ \edef\MTS@rpcode{\number\rpcode\font#1}%
+ \char#1%
+ lorem ipsum dolor sit amet, \MTS@crulefill\ %
+ \MTS@printtext{\ifnum\MTS@lpcode=\z@\Showbaselinecolor\fi[\MTS@lpcode]}
+ \fbox{\char#1}\MTS@show@index{\number#1}
+ \MTS@printtext{\ifnum\MTS@rpcode=\z@\Showbaselinecolor\fi[\MTS@rpcode]}
+ \MTS@crulefill\ you know the rest%
+ \char#1\par
+ \ShowDummyLine
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\ShowDummyLine}
+% The first and last glyphs in this line should have a straight (non-protruded) shape.
+% We also reset to default shape and series, because that's what, say, italic shapes
+% should be matched with.
+% \begin{macrocode}
+\newcommand*\ShowDummyLine{%
+ {\fontencoding{\encodingdefault}\fontseries{\seriesdefault}\fontshape{\shapedefault}%
+ \selectfont\noindent
+ here is the beginning of a line, \dotfill and here is its end}\par
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowProtrusionAll}
+% \begin{macrocode}
+\newcommand*\ShowProtrusionAll{%
+ {\MTS@setup
+ \MTS@lede{}%
+ \MT@do@font{\iffontchar\font\@tempcnta\MTS@showprotrusionline{\@tempcnta}\fi}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowProtrusionDefined}
+% \begin{macrocode}
+\newcommand*\ShowProtrusionDefined{%
+ {\MTS@setup
+ \MTS@lede{defined}%
+ \let\MTS@first\@gobble
+ \let\MTS@second\@firstofone
+ \MT@do@font{%
+ \MTS@firstorsecond
+ \MTS@temp{%
+ \iffontchar\font\@tempcnta\MTS@showprotrusionline{\@tempcnta}\else
+ \MT@warning@nl{Glyph \the\@tempcnta\space is missing in font
+ \MessageBreak\font@name}%
+ \fi}}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\ShowProtrusionMissing}
+% \begin{macrocode}
+\newcommand*\ShowProtrusionMissing{%
+ {\MTS@setup
+ \MTS@lede{missing}%
+ \let\MTS@first\@firstofone
+ \let\MTS@second\@gobble
+ \MT@do@font{%
+ \MTS@firstorsecond
+ \iffontchar\font\@tempcnta\MTS@temp{\MTS@showprotrusionline{\@tempcnta}}\fi}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@lede}
+% \begin{macrocode}
+\def\MTS@lede#1{%
+ \selectfont
+ \edef\MTS@font{\expandafter\string\font@name}%
+ \MTS@printtext{All glyphs \MT@ifempty{#1}{in}{#1 in protrusion list for}
+ font \texttt{\MTS@font}:}\par
+ \ShowDummyLine
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@firstorsecond}
+% \begin{macrocode}
+\def\MTS@firstorsecond{%
+ \let\MTS@temp\MTS@first
+ \ifnum\lpcode\font\@tempcnta=\z@ \else
+ \let\MTS@temp\MTS@second
+ \fi
+ \ifnum\rpcode\font\@tempcnta=\z@ \else
+ \let\MTS@temp\MTS@second
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@charwd}
+%\begin{macro}{\MTS@lp@}
+%\begin{macro}{\MTS@rp@}
+%\begin{macro}{\MTS@show@char@pr}
+% Display the glyph with protrusion.
+% \begin{macrocode}
+\newdimen\MTS@charwd
+\newdimen\MTS@lp@
+\newdimen\MTS@rp@
+\def\MTS@show@char@pr#1{%
+ \xdef\MTS@glyphlist{\MTS@glyphlist,#1}%
+ \scalebox{\GlyphScaleFactor}{\strut\escapechar`\\
+ \MTS@charwd=\fontcharwd\MT@font#1\relax
+% \end{macrocode}
+% The baseline rule.
+% \begin{macrocode}
+ {\Showbaselinecolor\vrule width \dimexpr\MTS@charwd+.3em\relax height 1sp depth 0pt}%
+ \hskip-\dimexpr\MTS@charwd+.15em\relax
+% \end{macrocode}
+% Left protrusion.
+% \begin{macrocode}
+ {\ifdim\MTS@lp@<\z@\Shownegcolor\else\Showposcolor\fi
+ \vrule width \ifdim\MTS@lp@<\z@ -\fi\MTS@lp@ height 1em depth .2em}%
+ \hskip\dimexpr\MTS@charwd\ifdim\MTS@lp@>\z@-\MTS@lp@\fi
+ \ifdim\MTS@rp@>\z@-\MTS@rp@\fi\relax
+% \end{macrocode}
+% Right protrusion.
+% \begin{macrocode}
+ {\ifdim\MTS@rp@<\z@\Shownegcolor\else\Showposcolor\fi
+ \vrule width \ifdim\MTS@rp@<\z@ -\fi\MTS@rp@ height 1em depth .2em}%
+ \hskip-\dimexpr\MTS@charwd+\fboxrule\ifdim\MTS@rp@<\z@-\MTS@rp@\fi\relax
+% \end{macrocode}
+% Finally the glyph, so that it's on top.
+% \begin{macrocode}
+ \fbox{\char#1}}\,%
+ \MTS@show@index{#1}%
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MTS@show@char}
+%\begin{macro}{\MTS@show@char@x}
+% Just show the glyph; the second command also remembers it.
+% \begin{macrocode}
+\def\MTS@show@char#1{\scalebox{\GlyphScaleFactor}{%
+ \strut\fbox{\char#1}}\MTS@show@index{#1}}
+\def\MTS@show@char@x#1{\xdef\MTS@glyphlist{\MTS@glyphlist,#1}\MTS@show@char{#1}}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MTS@show@missing}
+% \begin{macrocode}
+\def\MTS@show@missing{%
+ \MT@ifdefined@c@T\MT@pr@inh@name{%
+ \MTS@lp@=\z@ \MTS@rp@=\z@
+ \par \MTS@printtext{Glyphs not included in configuration (with defined heirs):}%
+ \MT@do@font{%
+ \edef\MT@temp{\the\@tempcnta}%
+ \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@temp @}{%
+ \MT@exp@one@n\MT@in@clist\MT@temp\MTS@glyphlist
+ \ifMT@inlist@\else \newline
+ \llap{\MTS@show@char@pr{\MT@temp} \MTS@printtext{=} }%
+ \MT@exp@cs\MT@map@tlist@c
+ {MT@inh@\MT@pr@inh@name @\the\@tempcnta @}%
+ \MTS@show@char@x
+ \fi
+ }%
+ }%
+ }%
+ \MTS@show@missing@
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@show@missing@}
+% \begin{macrocode}
+\def\MTS@show@missing@{%
+ \par \MTS@printtext{Other glyphs not in configuration:}\newline
+ \MT@do@font{%
+ \edef\MT@temp{\the\@tempcnta}%
+ \MT@exp@one@n\MT@in@clist\MT@temp\MTS@glyphlist
+ \ifMT@inlist@\else
+ \MTS@show@char\MT@temp
+ \fi
+ }%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MTS@show@inheritance}
+% \begin{macrocode}
+\def\MTS@show@inheritance{%
+ \MT@get@inh@list
+ \MTS@printtext{Character inheritance for font `\texttt{\MT@@font}':}\\
+ \MT@ifdefined@c@TF\MT@listname{%
+ \MTS@printtext{First matching list is for `\texttt{\@tempa}':\\
+ \texttt{\MT@listname}:}\par\leavevmode
+ \MT@do@font{%
+ \MT@ifdefined@n@T{MT@inh@\MT@listname @\the\@tempcnta @}{%
+ \newline
+ \xdef\MTS@glyphlist{\MTS@glyphlist,\the\@tempcnta}%
+ \llap{\MTS@show@char{\the\@tempcnta}\MTS@printtext{= }}%
+ \MT@exp@cs\MT@map@tlist@c
+ {MT@inh@\MT@listname @\the\@tempcnta @}%
+ \MTS@show@char@x
+ }%
+ }%
+ \MT@ifdefined@n@T{MT@inh@\MT@listname @prefixes}{%
+ \par \MTS@printtext{(with prefixes:)}%
+ \@tempcntb=\z@
+ \let\MTS@show@char@pr\MTS@show@char@x
+ \MT@set@pr@prefixheirs}%
+ \ifShowMissingGlyphs\MTS@show@missing@\fi
+ }{%
+ \MTS@printtext{NOT DEFINED}%
+ }%
+ \par
+}
+%</show>
+% \end{macrocode}
+%\end{macro}
+%
%\subsubsection{Requirements}
%
+% Back to the user packages.
+%
%\begin{macro}{\MT@plain}
% The \letterspace\ package works with:
%\begin{enum}
@@ -3783,6 +4548,7 @@
%\end{enum}
% For plain usage, we have to copy some commands from \file{latex.ltx}.
% \begin{macrocode}
+%<*package|letterspace>
%<*plain>
\def\MT@plain{2}
\ifx\documentclass\@undefined
@@ -3919,8 +4685,7 @@
% 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, we have to distinguish seven cases for \pdftex:
+% Currently, we have to distinguish the following cases for \pdftex:
%\begin{enum}
% \item not running \pdftex
% \item \pdftex\ ($\less$~0.14f)
@@ -3930,13 +4695,13 @@
% protrusion no longer has to be set up first;
% scale factor fixed to 1000;
% default \cmd\efcode\,=\,1000 ($\geq$~1.20)
-%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30}
% \item + \cmd{\(left,right)marginkern};
+%\changes{v1.8}{2005/04/15}{case 5: \pdftex\ 1.30}
% \cmd\pdfnoligatures;
% \cmd\pdfstrcmp;
% \cmd\pdfescapestring\ ($\geq$~1.30)
-%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.40} ^^A (beta:1)
% \item + adjustment of interword spacing;
+%\changes{v2.0}{2005/08/20}{case 6: \pdftex\ 1.40} ^^A (beta:1)
% extra kerning;
% \cmd\letterspacefont;
% \cmd\pdfmatch\footnote{This command was actually introduced
@@ -3944,21 +4709,28 @@
% \cmd\pdftracingfonts;
% always \etex\
% ($\geq$~1.40)
-%\changes{v2.2}{2007/02/23}{case 7: \pdftex\ 1.40.4}
% \item + \cmd\letterspacefont\ doesn't disable ligatures and kerns;
+%\changes{v2.2}{2007/02/23}{case 7: \pdftex\ 1.40.4}
% \cmd\pdfcopyfont\
% ($\geq$~1.40.4)
+% \item + \cmd\letterspacefont\ uses explicit \fontdim6 if specified
+%\changes{v3.0}{2021/07/01}{case 8: \pdftex\ 1.40.23}
+% ^^A https://git.texlive.info/texlive/commit/?id=1c7ff5528e10e989ba7ea7b72182d5f34d4d4e29
+% ($\geq$~1.40.23)
%\end{enum}
%\changes{v1.1}{2004/09/13}{fix: version check
% (reported by \contributor Harald Harders <h.harders\at tu-bs.de>)}
% ^^A private mail, 2004/09/13
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
%<debug>\MT@dinfo@nl{0}{this is pdftex \the\pdftexversion(\pdftexrevision)}
-\def\MT@pdftex@no{7}
+\def\MT@pdftex@no{8}
\ifnum\pdftexversion = 140
- \ifnum\pdftexrevision < 4
- \def\MT@pdftex@no{6}
+ \ifnum\pdftexrevision < 23
+ \def\MT@pdftex@no{7}
+ \ifnum\pdftexrevision < 4
+ \def\MT@pdftex@no{6}
+ \fi
\fi
\else
\ifnum\pdftexversion < 140
@@ -3984,14 +4756,14 @@
\fi
\fi
%<debug>\MT@dinfo@nl{0}{pdftex no.: \MT@pdftex@no}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
%\changes{v2.5}{2010/05/05}{protrusion with \xetex}
%\begin{macro}{\MT@xetex@no}
% \xetex\ supports character protrusion since version 0.9997.
% \begin{macrocode}
-%<*xetex-def>
+%<*xe->
%<debug>\MT@dinfo@nl{0}{this is xetex (\the\XeTeXversion\XeTeXrevision)}
\ifdim 0\XeTeXrevision pt < 0.9997pt
\def\MT@xetex@no{1}
@@ -3999,7 +4771,7 @@
\def\MT@xetex@no{2}
\fi
%<debug>\MT@dinfo@nl{0}{xetex no.: \MT@xetex@no}
-%</xetex-def>
+%</xe->
% \end{macrocode}
%\end{macro}
%\changes{v2.3c}{2008/09/09}{\luatex\ supported by default}
@@ -4017,7 +4789,7 @@
% ($\geq$~0.62)
% \item + almost all of the \pdftex\ primitives have been renamed ($\geq$~0.85)
% \item + default \cmd\efcode\,=\,1000;
-% \cmd\protrusionboundary\ [not yet supported] ($\geq$~0.90)
+% \cmd\protrusionboundary\ [doesn't seem to work] ($\geq$~0.90)
%\todo{interface for \cmd\protrusionboundary}
% \item + \cmd\glet ($\geq$~1.10)
%\end{enum}
@@ -4025,7 +4797,7 @@
% Also, sometime between 1.0.4 and 1.0.7, the function |font.setexpansion|
% has been introduced (but we're not using it for now).
% \begin{macrocode}
-%<*luatex-def>
+%<*lua->
%<debug>\MT@dinfo@nl0{this is luatex (\the\luatexversion)}
% \end{macrocode}
%\begin{macro}{\MT@lua}
@@ -4057,13 +4829,13 @@
%\end{macro}
% \begin{macrocode}
%<debug>\MT@dinfo@nl{0}{luatex no.: \MT@luatex@no}
-%</luatex-def>
+%</lua->
% \end{macrocode}
%\end{macro}
% \begin{macrocode}
-%<*pdftex-def|xetex-def|letterspace>
+%<*pdf-|xe-|letterspace>
\ifnum
-%<pdftex-def|xetex-def> \csname MT@\MT@engine tex@no\endcsname < 2
+%<pdf-|xe-> \csname MT@\MT@engine tex@no\endcsname < 2
%<letterspace> \MT@engine@tooold=\z@
\MT@warning@nl{You
%<*letterspace>
@@ -4074,8 +4846,8 @@
\else
%</letterspace>
are using a \MT@engine tex version older than
-%<pdftex-def> 0.14f%
-%<xetex-def> 0.9997%
+%<pdf-> 0.14f%
+%<xe-> 0.9997%
%<letterspace> \MT@pdf@or@lua{1.40}{0.62}%
.\MessageBreak
`\MT@MT' does not work with this version.\MessageBreak
@@ -4084,16 +4856,19 @@
.\MessageBreak I will quit now}
\MT@clear@options
\endinput\fi
-%</pdftex-def|xetex-def|letterspace>
+%</pdf-|xe-|letterspace>
% \end{macrocode}
% Still there? Then we can begin:
% We need the \pkg{keyval} package, including the `new' \cmd\KV@@sp@def\
% implementation.
%\changes{v2.1}{2007/01/15}{fix: \letterspace\ package forgot to load \pkg{keyval}}
+% For the \opt{patch} option, we use \pkg{etoolbox}, which requires \etex.
+%\changes{v3.0}{2021/05/17}{require package \pkg{etoolbox} (for \opt{patch} option)}
% \begin{macrocode}
%<*package|letterspace>
\RequirePackage{keyval}[1997/11/10]
%<*package>
+^^X\RequirePackage{etoolbox}
% \end{macrocode}
%\begin{macro}{\MT@toks}
% We need a token register.
@@ -4117,6 +4892,7 @@
%\begin{macro}{\ifMT@selected}
%\begin{macro}{\ifMT@noligatures}
%\begin{macro}{\ifMT@draft}
+%\begin{macro}{\ifMT@disable}
%\begin{macro}{\ifMT@spacing}
%\begin{macro}{\ifMT@kerning}
%\begin{macro}{\ifMT@tracking}
@@ -4129,6 +4905,7 @@
\newif\ifMT@selected
\newif\ifMT@noligatures
\newif\ifMT@draft
+\newif\ifMT@disable
\newif\ifMT@spacing
\newif\ifMT@kerning
\newif\ifMT@tracking
@@ -4144,6 +4921,7 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
% [This line intentionally left blank.]
%\begin{macro}{\MT@pr@level}
%\begin{macro}{\MT@ex@level}
@@ -4267,19 +5045,19 @@
%\begin{macro}{\MT@requires@luatex}
% For definitions that depend on a particular \pdftex\ resp. \luatex\ version.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def
-%<pdftex-def> \MT@requires@pdftex%
-%<luatex-def> \MT@requires@luatex%
+%<pdf-> \MT@requires@pdftex%
+%<lua-> \MT@requires@luatex%
#1{\ifnum
-%<pdftex-def> \MT@pdftex@no
-%<luatex-def> \MT@luatex@no
+%<pdf-> \MT@pdftex@no
+%<lua-> \MT@luatex@no
<#1 \expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}
-%<luatex-def&debug>\MT@requires@luatex4{\MT@lua{tex.enableprimitives('pdf',{'tracingfonts'})}}\relax
-%<pdftex-def&debug>\MT@requires@pdftex6{
+%<lua-&debug>\MT@requires@luatex4{\MT@lua{tex.enableprimitives('pdf',{'tracingfonts'})}}\relax
+%<pdf-&debug>\MT@requires@pdftex6{
%<debug>\pdftracingfonts=1
-%<pdftex-def&debug>}\relax
-%</pdftex-def|luatex-def>
+%<pdf-&debug>}\relax
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -4292,19 +5070,21 @@
%\changes{v2.7}{2017/02/08}{drop \pkg{luatexbase} with recent \LaTeX}
% we load the \pkg{luatexbase} package.
% \begin{macrocode}
-%<*luatex-def>
-\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
+%<lua->\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
% \end{macrocode}
% We load \pkg{luaotfload}, because some of its functions are
% required in \file{microtype.lua}. This eliminates the need for the user to
% load \pkg{fontspec} before \microtype.
% There will hardly be any \luatex\ documents that don't load this package, anyway.
%\changes{v2.6}{2013/06/19}{load \pkg{luaotfload} with \luatex}
+%\changes{v3.0}{2021/03/21}{\letterspace\ loads \file{microtype.lua}}
% Since 2017/01/01, it is already loaded in the format.
% \begin{macrocode}
-\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}}
-\MT@lua{require("microtype")}
-%</luatex-def>
+%<lua->\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}}
+%<letterspace>\MT@pdf@or@lua\relax{
+%<letterspace>\ifx\newluafunction\@undefined \input ltluatex \fi
+%<lua-|letterspace>\MT@lua{require("microtype")}
+%<letterspace>}
% \end{macrocode}
% Here it begins. The module was contributed by \'Elie Roux.
%\changes{v2.4}{2009/11/12}{new file \file{microtype.lua} containing the \texttt{lua} functions
@@ -4345,7 +5125,7 @@ end
%\changes{v2.8a}{2020/02/01}{use \luatex's \cmd\glet, if available}
% (finally implemented in \luatex).
% \begin{macrocode}
-%<luatex-def>\MT@requires@luatex6{\let\MT@glet\glet}\relax
+%<lua->\MT@requires@luatex6{\let\MT@glet\glet}\relax
%<*package|letterspace>
\def\MT@glet{\global\let}
% \end{macrocode}
@@ -4442,15 +5222,15 @@ end
% \end{macrocode}
%\end{macro}
% You do not wonder why |\MT@exp@one@c| doesn't exist, do you?
-%\changes{v1.6}{2005/01/19}{use \etex's \cs{ifcsname} and \cs{ifdefined} if defined}
+%\changes{v1.6}{2005/01/19}{use \etex's \orig@cs{ifcsname} and \orig@cs{ifdefined} if defined}
%\begin{macro}{\MT@ifdefined@c@T}
%\changes{v1.9a}{2005/11/08}{new macros: true case only}
%\begin{macro}{\MT@ifdefined@c@TF}
%\begin{macro}{\MT@ifdefined@n@T}
%\begin{macro}{\MT@ifdefined@n@TF}
% Wrapper for testing whether command resp. \cmd\csname\ sequence is defined.
-% If we are running \etex, we will use its primitives \cs{ifdefined} and
-% \cs{ifcsname}, which decreases memory use substantially.
+% If we are running \etex, we will use its primitives \orig@cs{ifdefined} and
+% \orig@cs{ifcsname}, which decreases memory use substantially.
% \begin{macrocode}
\def\MT@ifdefined@c@T#1{%
^^X \ifdefined#1\expandafter\@firstofone\else\expandafter\@gobble\fi
@@ -4537,9 +5317,9 @@ end
% \begin{macrocode}
%</package>
%</package|letterspace>
-%<pdftex-def>\MT@requires@pdftex6{
+%<pdf->\MT@requires@pdftex6{
%<letterspace>\MT@pdf@or@lua{
-%<*pdftex-def|letterspace>
+%<*pdf-|letterspace>
\def\MT@ifint#1{%
\ifcase\pdfmatch{^-*[0-9]+ *$}{#1}\relax
\expandafter\@secondoftwo
@@ -4548,8 +5328,8 @@ end
\fi
}
}{
-%</pdftex-def|letterspace>
-%<*pdftex-def|xetex-def|letterspace>
+%</pdf-|letterspace>
+%<*pdf-|xe-|letterspace>
\def\MT@ifint#1{%
\if!\ifnum9<1#1!\else?\fi
\expandafter\@firstoftwo
@@ -4557,9 +5337,9 @@ end
\expandafter\@secondoftwo
\fi
}
-%</pdftex-def|xetex-def|letterspace>
-%<pdftex-def|letterspace>}
-%<luatex-def>\def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname}
+%</pdf-|xe-|letterspace>
+%<pdf-|letterspace>}
+%<lua->\def\MT@ifint#1{\csname\MT@lua{microtype.if_int([[#1]])}\endcsname}
%<*luafile>
local function if_int(s)
if find(s,"^-*[0-9]+ *$") then
@@ -4584,7 +5364,7 @@ microtype.if_int = if_int
%\changes{v2.2}{2007/05/10}{employ \luatex\ features if available}
%\todo{fix \texttt{lua} expression}
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@requires@pdftex6{
\def\MT@ifdimen#1{%
\ifcase\pdfmatch{^([0-9]+([.,][0-9]+)?|[.,][0-9]+)%
@@ -4595,8 +5375,8 @@ microtype.if_int = if_int
\fi
}
}{
-%</pdftex-def>
-%<*pdftex-def|xetex-def>
+%</pdf->
+%<*pdf-|xe->
\def\MT@ifdimen#1{%
\setbox\z@=\hbox{%
\MT@count=1#1\relax
@@ -4607,9 +5387,9 @@ microtype.if_int = if_int
\fi
}%
}
-%</pdftex-def|xetex-def>
-%<pdftex-def>}
-%<luatex-def>\def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname}
+%</pdf-|xe->
+%<pdf->}
+%<lua->\def\MT@ifdimen#1{\csname\MT@lua{microtype.if_dimen([[#1]])}\endcsname}
%<*luafile>
local function if_dimen(s)
if (find(s, "^-*[0-9]+(%a*) *$") or
@@ -4647,18 +5427,18 @@ microtype.if_dimen = if_dimen
%\changes{v2.2}{2007/05/10}{employ \luatex\ features if available}
%\changes{v2.8}{2020/06/18}{use \xetex's \cmd\stringcmp}
% \begin{macrocode}
-%<*pdftex-def|xetex-def>
-%<pdftex-def>\MT@requires@pdftex5{
+%<*pdf-|xe->
+%<pdf->\MT@requires@pdftex5{
\def\MT@ifstreq#1#2{%
-%<pdftex-def> \ifnum\pdfstrcmp{#1}{#2}=\z@
-%<xetex-def> \ifnum\strcmp{#1}{#2}=\z@
+%<pdf-> \ifnum\pdfstrcmp{#1}{#2}=\z@
+%<xe-> \ifnum\strcmp{#1}{#2}=\z@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
-%</pdftex-def|xetex-def>
-%<*pdftex-def>
+%</pdf-|xe->
+%<*pdf->
}{
\def\MT@ifstreq#1#2{%
\edef\MT@res@a{#1}%
@@ -4670,8 +5450,8 @@ microtype.if_dimen = if_dimen
\fi
}
}
-%</pdftex-def>
-%<luatex-def>\def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname}
+%</pdf->
+%<lua->\def\MT@ifstreq#1#2{\csname\MT@lua{microtype.if_str_eq([[#1]],[[#2]])}\endcsname}
%<*luafile>
local function if_str_eq(s1, s2)
if s1 == s2 then
@@ -4730,7 +5510,7 @@ microtype.if_str_eq = if_str_eq
\fi
}
% \end{macrocode}
-%\todo{think \cs{@nil} should be defined as itself}
+%\todo{think \cmd\@nil\ should be defined as itself}
% \begin{macrocode}
\def\MT@map@clist@c#1{\MT@exp@one@n\MT@map@clist@n#1}
\def\MT@map@clist@#1,{%
@@ -4905,28 +5685,30 @@ microtype.if_str_eq = if_str_eq
% For fonts loaded by \pkg{luaotfload} we query the font's table.
% \begin{macrocode}
%<letterspace>\MT@pdf@or@lua{\let\MT@if@luaotf@font\@secondoftwo}{
-%<luatex-def|letterspace>\def\MT@if@luaotf@font{\csname\MT@lua{%
-%<luatex-def> microtype.if_luaotf_font()
-%<*luafile|letterspace>
-%<luafile>local function if_luaotf_font()
+%<*lua-|letterspace>
+\def\MT@if@luaotf@font{\csname\MT@lua{%
+ microtype.if_luaotf_font()
+ }\endcsname
+}
+%</lua-|letterspace>
+%<letterspace>}
+%<*luafile>
+local function if_luaotf_font()
local thefont = font.getfont(font.current())
if thefont and ( thefont.format == "opentype" or thefont.format == "truetype" )
then tex.write("@firstoftwo")
else tex.write("@secondoftwo")
end
-%<luafile>end
-%<luafile>microtype.if_luaotf_font = if_luaotf_font
-%<luafile>
-%</luafile|letterspace>
-%<luatex-def|letterspace> }\endcsname
-%<luatex-def|letterspace>}
-%<letterspace>}
+end
+microtype.if_luaotf_font = if_luaotf_font
+
+%</luafile>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@do@font}
% Execute \meta{\#1} 256 times,
% \begin{macrocode}
-%<pdftex-def|letterspace>\def\MT@do@font{\MT@while@num\z@\@cclvi}
+%<pdf-|letterspace>\def\MT@do@font{\MT@while@num\z@\@cclvi}
% \end{macrocode}
% resp. for the whole font for \luatex, if it's a Unicode font.
%\changes{v2.5}{2010/08/14}{adapt for \luatex}
@@ -4936,24 +5718,28 @@ microtype.if_str_eq = if_str_eq
% ^^A private mail, 2016/05/10
%\changes{v2.8}{2020/06/20}{simplify \texttt{lua} function}
% \begin{macrocode}
-%<*luatex-def>
+%<*lua->
\def\MT@do@font#1{%
\MT@if@luaotf@font{%
\def\MT@dofont@function{#1}%
\MT@lua{microtype.do_font()}%
}{\MT@while@num\z@\@cclvi{#1}}%
}
-%</luatex-def>
+%</lua->
% \end{macrocode}
% This is the |lua| function, which is much faster than looping through all glyphs
-% in \TeX. Legacy fonts (which this function should never work on) don't contain a |v.index| field.
+% in \TeX. Legacy fonts (which this function should never work on) don't contain a
+% |v.index| field.
+%\changes{v3.0}{2021/10/26}{guard against return values outside Unicode range (for HarfBuzz)}
+% Our test whether |i| is larger than 1114111 may seem strange, but with the
+% HarfBuzz renderer, we are not guaranteed to get a number within the Unicode range.
% \begin{macrocode}
%<*luafile>
local function do_font()
local thefont = font.getfont(font.current())
if thefont then
for i,v in next,thefont.characters do
- if v.index == nil or v.index > 0 then
+ if v.index == nil or ( v.index > 0 and i < 1114112 ) then
microtype.sprint([[\@tempcnta=]]..i..[[\relax\MT@dofont@function]])
end
end
@@ -4967,7 +5753,7 @@ microtype.do_font = do_font
%\changes{v2.5}{2010/05/18}{adapt for \xetex}
%\changes{v2.8}{2020/02/06}{fix for \xetex}
% \begin{macrocode}
-%<*xetex-def>
+%<*xe->
\def\MT@do@font#1{%
\@tempcnta=\z@
\MT@loop
@@ -4975,7 +5761,7 @@ microtype.do_font = do_font
\advance\@tempcnta\@ne
\ifnum\@tempcnta < \XeTeXlastfontchar\MT@font \MT@repeat
}
-%</xetex-def>
+%</xe->
%<*package>
% \end{macrocode}
%\end{macro}
@@ -4997,7 +5783,7 @@ microtype.do_font = do_font
%\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.7}{2005/02/12}{new macro: use \etex's \cmd\numexpr\ if available}
%\changes{v1.8}{2005/03/30}{fix: remove spaces in \nonetex\ variant
% (reported by \contributor Mark Rossi <mark.rossi\at de.bosch.com>)}
% ^^A MID: <d6uhag$qoi$1@ns2.fe.internet.bosch.com>
@@ -5230,8 +6016,8 @@ microtype.do_font = do_font
% The successor packages \pkg{eledmac} and \pkg{reledmac} are also supported.
% \begin{macrocode}
%</package>
-%<pdftex-def>\MT@requires@pdftex5{
-%<*pdftex-def|luatex-def|xetex-def>
+%<pdf->\MT@requires@pdftex5{
+%<*pdf-|lua-|xe->
\def\MT@ledmac@setup{%
\ifMT@protrusion
\MT@ifdefined@c@TF\l@dunhbox@line{%
@@ -5260,8 +6046,8 @@ microtype.do_font = do_font
}%
\fi
}
-%</pdftex-def|luatex-def|xetex-def>
-%<*pdftex-def>
+%</pdf-|lua-|xe->
+%<*pdf->
}{
\def\MT@ledmac@setup{%
\ifMT@protrusion
@@ -5273,7 +6059,7 @@ microtype.do_font = do_font
\fi
}
}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
% The \pkg{shapepar} package (v2.2) fixes this in a similar manner by itself,
@@ -5300,12 +6086,18 @@ microtype.do_font = do_font
% \end{macrocode}
%\end{macro}
%\changes{v2.8c}{2021/03/12}{add to hook for \pkg{fontspec}}
+%\changes{v3.0}{2021/09/27}{fix for changed hook name order
+% (reported by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>
+% and \contributor Karl Berry <karl\at freefriends.org>)}
+% ^^A private mails, 2021/09/06 and 2021/09/26
%\end{macro}
% We need the correct value of the former for configuration commands
% inside the preamble (to get the default families right).
% \begin{macrocode}
\@ifl@t@r\fmtversion{2020/10/01}
- {\AddToHook{package/after/fontspec}{\MT@fontspectrue}}\relax
+ {\IfFormatAtLeastTF{2021/11/15}
+ {\AddToHook{package/fontspec/after}{\MT@fontspectrue}}
+ {\AddToHook{package/after/fontspec}{\MT@fontspectrue}}}\relax
% \end{macrocode}
%\begin{macro}{\MT@maybe@gobble@with@tikz}
%\begin{macro}{\MT@tikz@setup}
@@ -5431,6 +6223,12 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A https://tex.stackexchange.com/questions/165846/
% \begin{macrocode}
\MT@glet\MT@setupfont@hook\@empty
+% \end{macrocode}
+% \microtype\ is so so loquacious~\dots\
+% Sometimes you just want to silence it when debugging a document.
+% \begin{macrocode}
+ %\gdef\MT@setupfont@hook{\tracingnone
+ % \MT@info{Silently doing my `magic' (Mittelbach) for font\MessageBreak\MT@@font}}%
\MT@if@false
\MT@with@babel@and@T{spanish} \MT@if@true
\MT@with@babel@and@T{galician}\MT@if@true
@@ -5566,8 +6364,249 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@MT@pickupfont}%
}%
}%
+% \end{macrocode}
+%\changes{v3.0}{2021/04/16}{compatibility fix for \pkg{unicode-math} with \pkg{luainputenc}
+% (reported by \contributor tnull <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/592946/microtype-unknown-slot-number-of-character-for-palatino-in-classicthesis-w-l
+% The \pkg{luainputenc} package makes all characters active, which can lead into
+% problems when the \pkg{unicode-math} package is loaded, as the latter doesn't
+% always define characters in <LICR>-conforming ways. By disabling the following command,
+% we prevent errors; warnings about unknown slots, however, may still occur --
+% but that's one of the unavoidable downsides of using \pkg{luainputenc}.
+% \begin{macrocode}
+ \MT@with@package@T{unicode-math}{%
+ \MT@let@nc{__um_sub_or_super:n}\relax
+ }%
%</package>
}
+%<*package>
+% \end{macrocode}
+%
+%\subsubsection{Protrusion patches}
+%
+%\begin{macro}{\ifMT@patch@ok}
+%\begin{macro}{\MT@patch@info}
+%\begin{macro}{\MT@patch@warn}
+%\begin{macro}{\MT@patch@undef}
+% We have to patch some macros to get protrusion right.
+% \begin{macrocode}
+\newif\ifMT@patch@ok
+\def\MT@patch@info#1{\MT@info{Applying patch `#1'}}
+\def\MT@patch@warn#1{\MT@warning{Unable to apply patch `#1'}}
+\def\MT@patch@undef#1{\MT@warning{Patch `#1' undefined. Cannot apply it}}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@patches@def}
+%\begin{macro}{\MT@define@patch}
+% Define a patch and it add to the list of patches.
+% The third argument may contain more revert commands, but will
+% mostly be empty.
+% \begin{macrocode}
+\let\MT@patches@def\@gobble
+\def\MT@define@patch#1#2#3{%
+ \g@addto@macro\MT@patches@def{,#1}%
+ \MT@def@n{MT@patch@@#1}{#2}%
+ \MT@def@n{MT@patch@undo@@#1}{#3}%
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@append@patch}
+%\begin{macro}{\MT@patch@patch}
+% Wrappers around \pkg{etoolbox} commands.
+% We also remember the original command to allow unpatching.
+% \begin{macrocode}
+\def\MT@append@patch#1#2{%
+ \MT@remember@patch{#1}%
+ \apptocmd#1{#2}\relax\MT@patch@okfalse
+}
+\def\MT@patch@patch#1#2#3{%
+ \MT@remember@patch{#1}%
+ \patchcmd#1{#2}{#3}\relax\MT@patch@okfalse
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@remember@patch}
+% Remember the original definition and add to undo command.
+% \begin{macrocode}
+\def\MT@remember@patch#1{%
+ \MT@ifdefined@n@TF{MT@patch@saved@\string#1}\relax
+ {\MT@let@nc{MT@patch@saved@\string#1}#1%
+ \MT@exp@cs\g@addto@macro{MT@patch@undo@@\MT@patch@name}%
+ {\MT@let@cn#1{MT@patch@saved@\string#1}}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@patches@applied}
+%\begin{macro}{\MT@apply@patch}
+% Apply a previously defined patch.
+% \begin{macrocode}
+\let\MT@patches@applied\@gobble
+\def\MT@apply@patch#1{%
+ \MT@patch@oktrue
+ \MT@ifdefined@n@TF{MT@patch@@#1}
+ {\MT@in@clist{#1}\MT@patches@applied
+ \ifMT@inlist@
+ \MT@warning{Patch `#1' has already been applied,\MessageBreak
+ cannot reapply it}%
+ \else
+ \def\MT@patch@name{#1}%
+ \g@addto@macro\MT@patches@applied{,#1}%
+ \@nameuse{MT@patch@@#1}%
+ \@nameuse{MT@patch@\ifMT@patch@ok info\else warn\fi}{#1}%
+ \fi}
+ {\MT@patch@undef{#1}}%
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@undo@patch}
+% Undo a patch (if indeed previously applied).
+% \begin{macrocode}
+\def\MT@undo@patch#1{%
+ \MT@in@clist{#1}\MT@patches@applied
+ \ifMT@inlist@
+ \MT@rem@from@clist{#1}\MT@patches@applied
+ \@nameuse{MT@patch@undo@@#1}%
+ \else
+ \MT@warning{Patch `#1' hasn't been applied,\MessageBreak cannot revert it}%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+% Unfortunately, \pkg{etoolbox} is a bit bitchy with hashes in arguments
+% (but who would blame it), so I currently see no other solution than to
+% temporarily reset the catcode of the \# character.
+% \begin{macrocode}
+{\catcode`\#=12
+\MT@addto@setup{%
+% \end{macrocode}
+% Now for the actual patches:
+%\begin{description}
+% \item [|item|] \cmd\@item, which is a kind of catch-all, as it's internally
+% used for most basic environments (\eg, |itemize|, |enumerate|, but also
+% |quote|, |flushleft| etc.). For |verse| (and probably other environments), ^^A found by \contributor Antonis Tsolomitis <antonis.tsolomitis\at gmail.com>, private mail, 2021/08/01
+% we also have to patch \cmd\everypar~\dots
+% \begin{itemize}
+% \item \pkg{beamer} patches it too
+%\changes{v3.0}{2021/05/20}{protrusion patch for \cmd\item}
+% \begin{macrocode}
+ \@ifclassloaded{beamer}
+ {\MT@define@patch{item}
+ {\MT@append@patch\@item\leftprotrusion
+ \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}%
+ \MT@append@patch\beamer@@callorigitem\leftprotrusion
+ \MT@patch@patch\beamer@callorigitem{\ignorespaces}{\ignorespaces\leftprotrusion}}
+ {}}
+% \end{macrocode}
+% \item the \pkg{simplecv} class
+% \begin{macrocode}
+ {\@ifclassloaded{simplecv}
+ {\MT@define@patch{item}
+ {\MT@append@patch\@item\leftprotrusion
+ \MT@append@patch\@topic@item\leftprotrusion
+ \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}}
+ {}}%
+% \end{macrocode}
+% \item standard \LaTeX\ classes
+% \begin{macrocode}
+ {\MT@define@patch{item}
+ {\MT@append@patch\@item\leftprotrusion
+ \MT@patch@patch\@item{\everypar{}}{\everypar{\leftprotrusion}}}
+ {}}}%
+% \end{macrocode}
+% \end{itemize}
+% \item [|toc|] <TOC> and friends
+% \begin{itemize}
+% \item for the \pkg{memoir} class we also fix the extra leader problem~\dots
+%\changes{v3.0}{2021/05/20}{protrusion patch for <TOC>}
+% \begin{macrocode}
+ \@ifclassloaded{memoir}
+ {\MT@define@patch{toc}
+ {\MT@append@patch\numberline\leftprotrusion
+ \MT@append@patch\booknumberline\leftprotrusion
+ \MT@append@patch\partnumberline\leftprotrusion
+ \MT@append@patch\chapternumberline\leftprotrusion
+ \MT@append@patch\cftbookafterpnum\noprotrusion
+ \MT@append@patch\cftpartafterpnum\noprotrusion
+ \MT@append@patch\cftchapterafterpnum\noprotrusion
+ \MT@append@patch\cftsectionafterpnum\noprotrusion
+ \MT@append@patch\cftsubsectionafterpnum\noprotrusion
+ \MT@append@patch\cftsubsubsectionafterpnum\noprotrusion
+ \MT@append@patch\cftparagraphafterpnum\noprotrusion
+ \MT@append@patch\cftsubparagraphafterpnum\noprotrusion
+ \MT@append@patch\cftfigureafterpnum\noprotrusion
+ \MT@append@patch\cfttableafterpnum\noprotrusion}
+ {}}
+% \end{macrocode}
+% \item for the <KOMA> classes (which load the \pkg{tocbasic} package)
+% we additionally have to switch protrusion back on; this will
+% re-introduce the risk of getting an extra leader dot, but I
+% currently don't see how to easily add \cmd\noprotrusion.
+% Therefore, I'll skip this patch for now, saving the joy of wading
+% through |scr| files for later, all the while waiting for somebody
+% who would understand <KOMA> better than me.
+%\todo{fix KOMA patch (add \cmd\noprotrusion)}
+% \begin{macrocode}
+% {\@ifpackageloaded{tocbasic}
+% {\MT@define@patch{toc}
+% {\MT@append@patch\numberline\leftprotrusion
+% \setuptoc{toc}{noprotrusion}%
+% \setuptoc{lof}{noprotrusion}%
+% \setuptoc{lot}{noprotrusion}}
+% {\unsettoc{toc}{noprotrusion}%
+% \unsettoc{lof}{noprotrusion}%
+% \unsettoc{lot}{noprotrusion}}}
+% \end{macrocode}
+% \item \dots, and for the rest:
+% \begin{macrocode}
+ {\MT@define@patch{toc}
+ {\MT@append@patch\numberline\leftprotrusion}
+ {}}%
+% \end{macrocode}
+% \item (a patch for \pkg{titletoc} would also be worthwhile~\dots)
+%\todo{patch for \pkg{titletoc}}
+% \end{itemize}
+% \item [|eqnum|] equation numbers (with or without \pkg{amsmath}). \cmd\eqref\ relies
+% on \cmd\tagform@, so we have to make it use the original definition.
+%\changes{v3.0}{2021/05/21}{protrusion patch for equation numbers
+% (provided by \contributor Holger Gerhardt <holger.gerhardt\at uni-bonn.de>)}
+% \begin{macrocode}
+ \@ifpackageloaded{amsmath}
+ {\MT@define@patch{eqnum}
+ {\MT@patch@patch\tagform@{(}{\leftprotrusion{(}}%
+ \MT@patch@patch\tagform@{)}{\rightprotrusion{)}}%
+ \MT@patch@patch\eqref{\tagform@}{\@nameuse{MT@patch@saved@\string\tagform@}}}%
+ {}}
+ {\MT@define@patch{eqnum}
+ {\MT@patch@patch\@eqnnum{(}{\leftprotrusion{(}}%
+ \MT@patch@patch\@eqnnum{)}{\rightprotrusion{)}}}%
+ {}}%
+% \end{macrocode}
+% \item [|footnote|] footnote text (only visible with block paragraphs).
+%\changes{v3.0}{2021/05/25}{protrusion patch for footnote text}
+% \begin{macrocode}
+ \@ifclassloaded{memoir}
+ {\MT@define@patch{footnote}
+ {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}}
+ {}}
+ {\@ifpackageloaded{scrbase}
+ {\MT@define@patch{footnote}
+ {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}
+ {}}
+ {\MT@define@patch{footnote}
+ {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}
+ {}}}%
+}}
+% \end{macrocode}
+%\end{description}
+% \begin{macrocode}
+%</package>
%</package|letterspace>
% \end{macrocode}
%\changes{v1.6}{2005/01/19}{load a font if none is selected}
@@ -5582,7 +6621,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% Setting up a font entails checking for each feature whether it should be
% applied to the current font (\cs{MT@font}).
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
+%<*pdf-|lua-|xe->
\def\MT@setupfont{%
% \end{macrocode}
%\changes{v2.5}{2012/08/22}{select font with \pkg{fontspec} (found by \contributor Georg Duffner <g.duffner\at gmail.com>)}
@@ -5595,7 +6634,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% hence we might see a wrong font (in \cs{MT@get@slot}).
% Therefore, we first load the current font.
% \begin{macrocode}
-%<xetex-def|luatex-def> \MT@font
+%<xe-|lua-> \MT@font
% \end{macrocode}
% We might have to disable stuff when used together with adventurous
% packages.
@@ -5606,9 +6645,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
% and the use of more than one set of protrusion factors for a font within one
% paragraph).
% \begin{macrocode}
-%<pdftex-def>\MT@requires@pdftex7{
-%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@copy@font
-%<pdftex-def>}\relax
+%<pdf->\MT@requires@pdftex7{
+%<pdf-|lua->\g@addto@macro\MT@setupfont\MT@copy@font
+%<pdf->}\relax
% \end{macrocode}
% The font properties must be extracted from \cs{MT@font}, since the current
% value of \cmd\f@encoding\ and friends may be wrong!
@@ -5638,9 +6677,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
% Tracking has to come first, since it means actually loading a different font.
%\changes{v2.2}{2007/04/15}{only add features that are available with the respective \pdftex}
% \begin{macrocode}
-%<pdftex-def>\MT@requires@pdftex6
-%<luatex-def>\MT@requires@luatex3
-%<pdftex-def|luatex-def> {\g@addto@macro\MT@setupfont\MT@tracking}\relax
+%<pdf->\MT@requires@pdftex6
+%<lua->\MT@requires@luatex3
+%<pdf-|lua-> {\g@addto@macro\MT@setupfont\MT@tracking}\relax
\g@addto@macro\MT@setupfont{%
\MT@check@font
\ifMT@inlist@
@@ -5657,22 +6696,22 @@ time will almost certainly lead to undesired results. Have your choice!}%
% with 1.20, the order doesn't matter.
% \begin{macrocode}
\MT@protrusion
-%<pdftex-def|luatex-def> \MT@expansion
+%<pdf-|lua-> \MT@expansion
}
% \end{macrocode}
% Interword spacing and kerning (\pdftex\ 1.40).
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@requires@pdftex6{
\g@addto@macro\MT@setupfont{\MT@spacing\MT@kerning}
}\relax
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
% Disable ligatures (\pdftex\ 1.30).
% \begin{macrocode}
-%<pdftex-def>\MT@requires@pdftex5{
-%<pdftex-def|luatex-def>\g@addto@macro\MT@setupfont\MT@noligatures
-%<pdftex-def>}\relax
+%<pdf->\MT@requires@pdftex5{
+%<pdf-|lua->\g@addto@macro\MT@setupfont\MT@noligatures
+%<pdf->}\relax
\g@addto@macro\MT@setupfont{%
% \end{macrocode}
% Debugging.
@@ -5684,7 +6723,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@register@font
\fi
}
-%</pdftex-def|xetex-def|luatex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@copy@font}
@@ -5696,9 +6735,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \cs{SetProtrusion} or \cs{SetExpansion} in the preamble, or when the package
% has been loaded with the \opt{copyfonts} option.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\let\MT@copy@font\relax
-%<pdftex-def>\MT@requires@pdftex7{
+%<pdf->\MT@requires@pdftex7{
\def\MT@copy@font@{%
% \end{macrocode}
%\begin{macro}{\MT@font@copy}
@@ -5721,7 +6760,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\else
\MT@exp@two@c\let\font@name\MT@font@orig
\fi
-%<pdftex-def> \global\MT@exp@two@c\pdfcopyfont\MT@font@copy\font@name
+%<pdf-> \global\MT@exp@two@c\pdfcopyfont\MT@font@copy\font@name
% \end{macrocode}
%\end{macro}
% Even though \luatex\ also provides the primitive from \pdftex\ (even renamed to
@@ -5734,7 +6773,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A https://tex.stackexchange.com/questions/419288/microtypecontext-with-lualatex
% Therefore, we do not copy the font but load it anew.
% \begin{macrocode}
-%<luatex-def> \MT@exp@two@c\MT@lua@copyfont\meaning\font@name\@nil
+%<lua-> \MT@exp@two@c\MT@lua@copyfont\meaning\font@name\@nil
%<debug>\MT@dinfo1{creating new copy: \MT@font@copy}%
% \end{macrocode}
% Since it's a new font, we have to remove it from the context lists.
@@ -5767,16 +6806,16 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@font \csname MT@\@tempa @#1font@list\endcsname
\fi
}
-%<pdftex-def>}\relax
+%<pdf->}\relax
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@lua@copy@font}
% \meta{\#1} and \meta{\#2} are `|select|' and `|font|', respectively,
% \meta{\#3} is the font spec.
% \begin{macrocode}
-%<luatex-def>\def\MT@lua@copyfont #1 #2 #3\@nil{%
-%<luatex-def> \global\expandafter\font\MT@font@copy=#3\relax}
-%</pdftex-def|luatex-def>
+%<lua->\def\MT@lua@copyfont #1 #2 #3\@nil{%
+%<lua-> \global\expandafter\font\MT@font@copy=#3\relax}
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\ifpdf\phantomsection\fi\label{exp-hack}
@@ -5823,20 +6862,20 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \xetex\ doesn't provide an equivalent to \cmd\pdffontsize, so we use the
% nominal size instead.
% \begin{macrocode}
-%<*pdftex-def|luatex-def|xetex-def>
+%<*pdf-|lua-|xe->
\def\MT@fix@fontdimen@six{%
\ifnum\fontdimen6\MT@font=\z@
\fontdimen6\MT@font=%
-%<pdftex-def> \pdffontsize\MT@font
-%<luatex-def> \MT@requires@luatex4{\pdffeedback fontsize}{\pdffontsize}\MT@font
-%<xetex-def> \MT@size pt
+%<pdf-> \pdffontsize\MT@font
+%<lua-> \MT@requires@luatex4{\pdffeedback fontsize}{\pdffontsize}\MT@font
+%<xe-> \MT@size pt
\MT@info{Fixing zero \string\fontdimen 6 for font `\MT@@font'\MessageBreak
(new value: \the\fontdimen6\MT@font)}%
- \MT@glet@nc{\MT@@font-fake6}\@empty
+%<pdf-> \MT@requires@pdftex8\relax{\MT@glet@nc{\MT@@font-fake6}\@empty}%
\fi
\edef\MT@dimen@six{\number\fontdimen6\MT@font}%
}
-%</pdftex-def|luatex-def|xetex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -6076,7 +7115,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \end{macrocode}
%\end{macro}
%
-%\subsubsection{Protrusion}
+%\subsubsection{Protrusion}\label{ssub:setup-prot}
%
%\begin{macro}{\ifMT@nofamily}
% Info for settings that are not family-specific.
@@ -6088,14 +7127,13 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A (beta:07)
% \begin{macrocode}
\newif\ifMT@nofamily
-%</package>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@protrusion}
% Set up for protrusion?
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
\def\MT@protrusion{\MT@maybe@do{pr}}
+%</package>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@pr@codes}
@@ -6105,8 +7143,11 @@ time will almost certainly lead to undesired results. Have your choice!}%
% characters}
%\changes{v1.6}{2004/12/18}{introduce \texttt{factor} option}
% \begin{macrocode}
-\def\MT@set@pr@codes{%
- \MT@nofamilyfalse
+%<*pdf-|lua-|xe-|show>
+%<show>\def\MTS@show@pr
+%<pdf-|lua-|xe->\def\MT@set@pr@codes
+ {%
+%<pdf-|lua-|xe-> \MT@nofamilyfalse
% \end{macrocode}
% Check whether and if, which list should be applied to the current font.
% If family-specific settings don't exist, we write it to the log
@@ -6115,7 +7156,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A private mail, 2013/01/24
% (for each encoding).
% \begin{macrocode}
+%<show> \MTS@printtext{Protrusion settings for font `\texttt{\MT@@font}':}\\
\MT@if@list@exists{%
+%<*pdf-|lua-|xe->
\ifMT@nofamily
\MT@ifdefined@n@TF{\MT@encoding-\MT@family-settings}\relax{%
\MT@info@nl{Loading generic protrusion settings for font family\MessageBreak
@@ -6125,6 +7168,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@glet@nc{\MT@encoding-\MT@family-settings}\@empty
}%
\fi
+%</pdf-|lua-|xe->
+%<show> \MTS@printtext{First matching list is for `\texttt{\@tempa}':\\\texttt{\MT@pr@c@name}}%
\MT@get@opt
\MT@reset@pr@codes
% \end{macrocode}
@@ -6145,7 +7190,22 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
\MT@let@cn\@tempc{MT@pr@c@\MT@pr@c@name}%
\expandafter\MT@set@codes\@tempc,\relax,%
- }\MT@reset@pr@codes
+%<show> \vrule width 4cm height .5pt \\
+%<show> \MTS@printtext{End of list `\texttt{\MT@pr@c@name}'}\\[.5em]
+%<show> \MT@ifdefined@c@T\MT@pr@inh@name{%
+%<show> \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @prefixes}{%
+%<show> \par \MTS@printtext{(with prefixes:)}%
+%<show> \@tempcntb=\z@
+% \end{macrocode}
+% Set unconditional heirs.
+% \begin{macrocode}
+ \MT@set@pr@prefixheirs
+%<show> }}%
+%<show> \ifShowMissingGlyphs\MTS@show@missing\fi
+ }%
+%<show> {\MTS@printtext{NOT DEFINED}%
+ \MT@reset@pr@codes
+%<show> }\par
}
% \end{macrocode}
%\end{macro}
@@ -6158,6 +7218,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A https://tex.stackexchange.com/questions/25036/microtype-package-v-2-5-beta-06-and-footnote-protrusion
% ^^A (beta:08)
% \begin{macrocode}
+%<*pdf-|lua-|xe->
\def\MT@set@all@pr#1#2{%
%<debug>\MT@dinfo@nl{3}{-- lp/rp: setting all to #1/#2}%
\let\MT@temp\@empty
@@ -6185,14 +7246,14 @@ time will almost certainly lead to undesired results. Have your choice!}%
% the margin kerns. This will be activated in \cs{MT@set@tr@codes}.
% \begin{macrocode}
\def\MT@the@pr@code{\@tempcntb}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex6
-%<luatex-def>\MT@requires@luatex3
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex6
+%<lua->\MT@requires@luatex3
{\def\MT@the@pr@code@tr{%
\numexpr\@tempcntb+\MT@letterspace@/2\relax
}
}\relax
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -6219,8 +7280,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
\def\@tempa{#1}%
\ifx\@tempa\@empty \else
\MT@get@slot
-%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne
-%<xetex-def> \ifx\MT@char\@empty \else
+%<pdf-|lua-> \ifnum\MT@char > \m@ne
+%<xe-> \ifx\MT@char\@empty \else
\MT@get@char@unit
\csname MT@\MT@feat @split@val\endcsname#2\relax
\fi
@@ -6230,19 +7291,34 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\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=\MT@the@pr@code
-%<debug>\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char\space: [#1]}%
+\def\MT@pr@split@val#1,#2\relax
+%</pdf-|lua-|xe->
+%<show>\def\MTS@pr@split@val#1,#2\relax
+ {\def\@tempb{#1}%
+ \MT@ifempty\@tempb
+%<pdf-|lua-|xe-> \relax
+%<show> {\MTS@lp@=\z@ \let\MTS@lpcode\@empty}%
+ {\MT@scale@to@em
+%<pdf-|lua-|xe-> \lpcode\MT@font\MT@char=\MT@the@pr@code
+%<show> \MTS@lp@=\dimexpr\@tempcntb em/1000\relax\relax
+%<show> \edef\MTS@lpcode{[\@tempb] \the\@tempcntb/\the\MTS@lp@}%
+%<debug>\MT@dinfo@nl{4}{;;; lp (\MT@char): \number\lpcode\MT@font\MT@char: [#1]}%
}%
\def\@tempb{#2}%
- \MT@ifempty\@tempb\relax{%
- \MT@scale@to@em
- \rpcode\MT@font\MT@char=\MT@the@pr@code
-%<debug>\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char\space: [#2]}%
+ \MT@ifempty\@tempb
+%<pdf-|lua-|xe-> \relax
+%<show> {\MTS@rp@=\z@ \let\MTS@rpcode\@empty}%
+ {\MT@scale@to@em
+%<pdf-|lua-|xe-> \rpcode\MT@font\MT@char=\MT@the@pr@code
+%<show> \MTS@rp@=\dimexpr\@tempcntb em/1000\relax\relax
+%<show> \edef\MTS@rpcode{[\@tempb] \the\@tempcntb/\the\MTS@rp@}%
+%<debug>\MT@dinfo@nl{4}{;;; rp (\MT@char): \number\rpcode\MT@font\MT@char: [#2]}%
}%
+%<show> \llap{\MTS@show@char@pr\MT@char\quad}%
+%<show> \parbox[b][][b]{3.5cm}{\MTS@printtext{%
+%<show> \footnotesize\makebox[.4cm][l]{L:} \MT@ifempty{\MTS@lpcode}{---}{\MTS@lpcode}\\
+%<show> \makebox[.4cm][l]{R:} \MT@ifempty{\MTS@rpcode}{---}{\MTS@rpcode}}}%
+%<show> \parbox[t][][t]{\dimexpr\textwidth-3.5cm}{%
% \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}|@|.
@@ -6251,10 +7327,13 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @\MT@char @}{%
\MT@exp@cs\MT@map@tlist@c
{MT@inh@\MT@pr@inh@name @\MT@char @}%
- \MT@set@pr@heirs
+%<pdf-|lua-|xe-> \MT@set@pr@heirs
+%<show> \MTS@show@char@pr
}%
}%
+%<show> }\newline
}
+%<*pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@scale@to@em}
@@ -6266,21 +7345,21 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\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,
+% \cmd\lpcode\ resp. \cmd\rpcode, since this would disallow protrusion factors
+% larger than the character width (since \verb!\[lr]pcode!'s limit is 1000). Now,
% the maximum protrusion is \EM{1} 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}
-%<pdftex-def>\MT@requires@pdftex3{
+%<pdf->\MT@requires@pdftex3{
\def\MT@scale@to@em{%
\@tempcntb=\MT@count\relax
% \end{macrocode}
% For really huge fonts (100\,pt 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}.
+% than \cmd\maxdimen.
% \begin{macrocode}
\MT@scale\@tempcntb \@tempb \MT@dimen@six
\ifnum\@tempcntb=\z@ \else
@@ -6296,24 +7375,24 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v1.8}{2005/05/25}{warning for missing (resp. zero-width) characters}
% \begin{macrocode}
\def\MT@get@charwd{%
-%<*pdftex-def>
+%<*pdf->
^^X \MT@count=\fontcharwd\MT@font\MT@char\relax
^^Q \setbox\z@=\hbox{\MT@font \char\MT@char}%
^^Q \MT@count=\wd\z@
-%</pdftex-def>
-%<luatex-def> \MT@count=\fontcharwd\MT@font\MT@char\relax
+%</pdf->
+%<lua-> \MT@count=\fontcharwd\MT@font\MT@char\relax
% \end{macrocode}
% \cs{MT@char} contains a slot number (legacy fonts), a Unicode number,
% or a glyph name (if \cs{MT@char@} is negative).
% \begin{macrocode}
-%<*xetex-def>
+%<*xe->
\ifnum\MT@char@<\z@
\setbox\z@=\hbox{\MT@font \XeTeXglyph-\MT@char@}%
\MT@count=\wd\z@
\else
\MT@count=\fontcharwd\MT@font\MT@char@\relax
\fi
-%</xetex-def>
+%</xe->
\ifnum\MT@count=\z@ \MT@info@missing@char \fi
}
% \end{macrocode}
@@ -6323,7 +7402,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \cs{MT@set@pr@codes}.
% The letterspaced font is already loaded so that \EM{1} = \fontdim6.
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@requires@pdftex6{
\g@addto@macro\MT@get@charwd{%
\MT@ifdefined@c@T\MT@letterspace@
@@ -6346,8 +7425,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
\def\MT@get@charwd{\MT@count=\MT@dimen@six}
}
-%</pdftex-def>
-%</pdftex-def|xetex-def|luatex-def>
+%</pdf->
+%</pdf-|lua-|xe->
+%</pdf-|lua-|xe-|show>
% \end{macrocode}
%\begin{macro}{\MT@get@font@dimen}
% For the |space| unit.
@@ -6610,26 +7690,89 @@ time will almost certainly lead to undesired results. Have your choice!}%
%<debug>\MT@dinfo@nl{1}{loading input encoding: \@nameuse{\@tempa}}%
\inputencoding{\@nameuse{\@tempa}}%
}
-%</package>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@pr@heirs}
% Set the inheriting characters.
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
\def\MT@set@pr@heirs#1{%
\lpcode\MT@font #1=\lpcode\MT@font\MT@char\relax
\rpcode\MT@font #1=\rpcode\MT@font\MT@char\relax
%<debug>\MT@dinfo@nl{2}{-- heir of \MT@char: #1}%
-%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char\space/%
-%<debug> \number\rpcode\MT@font\MT@char\space}%
+%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#1): \number\lpcode\MT@font\MT@char/%
+%<debug> \number\rpcode\MT@font\MT@char}%
}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\MT@set@pr@prefixheirs}
+% Inheriting characters that have been specified in a prefixed list.
+% \begin{macrocode}
+\def\MT@set@pr@prefixheirs{%
+ \MT@ifdefined@c@T\MT@pr@inh@name{%
+ \MT@ifdefined@n@T{MT@inh@\MT@pr@inh@name @prefixes}{%
+ \MT@exp@cs\MT@map@tlist@c
+ {MT@inh@\MT@pr@inh@name @prefixes}%
+ \MT@set@pr@prefixes
+ }%
+ }%
+}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@set@pr@prefixes}
+%\begin{macro}{\MT@set@pr@prefixes@}
+% Add |charwidth(inheriting char)-charwidth(base char)| to either left or
+% right side or half the amount to both sides. For \xetex, we may have to
+% translate to glyph numbers because \cmd\fontcharwd\ doesn't have the nice
+% feature of understanding the `|U|' or `|/|' prefixes.
+% \begin{macrocode}
+%<*pdf-|lua-|xe-|show>
+%<pdf-|lua-|xe->\def\MT@set@pr@prefixes#1{\MT@set@pr@prefixes@#1}
+%<pdf-|lua-|xe->\def\MT@set@pr@prefixes@#1#2#3#4%
+%<show>\def\MTS@set@pr@prefixes@#1#2#3#4%
+ {%
+%<show> \MTS@lp@=\z@ \MTS@rp@=\z@
+%<show> \ifnum#1=\@tempcntb \else
+%<show> \par\leavevmode
+%<show> \llap{\MTS@show@char@pr{#1} \MTS@printtext{=} }%
+%<show> \fi
+%<*xe->
+ \edef\@tempa{\expandafter\ifx\@car#1\@nil U\@gobble#1\else\number\XeTeXglyphindex"#1" \fi}%
+ \edef\@tempb{\expandafter\ifx\@car#2\@nil U\@gobble#2\else\number\XeTeXglyphindex"#2" \fi}%
+%</xe->
+ \@tempcnta=\z@
+ \ifnum#3>\z@
+ \@tempcnta=\numexpr
+%<pdf-|lua-|show> (\fontcharwd\MT@font#2-\fontcharwd\MT@font#1)%
+%<xe-> (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)%
+ *#3/\MT@dimen@six\relax
+ \fi
+%<pdf-|lua-|xe-> \lpcode\MT@font #2=\numexpr\lpcode\MT@font#1+\@tempcnta\relax
+%<show> \MTS@lp@=\dimexpr\numexpr\lpcode\MT@font#1+\@tempcnta\relax em/1000\relax
+ \@tempcnta=\z@
+ \ifnum#4>\z@
+ \@tempcnta=\numexpr
+%<pdf-|lua-|show> (\fontcharwd\MT@font#2-\fontcharwd\MT@font#1)%
+%<xe-> (\fontcharwd\MT@font\@tempb-\fontcharwd\MT@font\@tempa)%
+ *#4/\MT@dimen@six\relax
+ \fi
+%<pdf-|lua-|xe-> \rpcode\MT@font #2=\numexpr\rpcode\MT@font#1+\@tempcnta\relax
+%<show> \MTS@rp@=\dimexpr\numexpr\rpcode\MT@font#1+\@tempcnta\relax em/1000\relax
+%<debug>\MT@dinfo@nl{2}{-- (prefix) heir of #1: #2}%
+%<debug>\MT@dinfo@nl{4}{;;; lp/rp (#2): \number\lpcode\MT@font#2/%
+%<debug> \number\rpcode\MT@font#2}%
+%<show> \MTS@show@char@pr{#2}%
+%<show> \@tempcntb=#1\relax
+}
+%</pdf-|lua-|xe-|show>
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
%\begin{macro}{\MT@preset@pr}
%\begin{macro}{\MT@preset@pr@}
% Preset characters. Presetting them relative to their widths is not allowed.
% \begin{macrocode}
+%<*package>
\def\MT@preset@pr{%
\expandafter\expandafter\expandafter\MT@preset@pr@
\csname MT@pr@c@\MT@pr@c@name @preset\endcsname\@nil
@@ -6674,10 +7817,299 @@ time will almost certainly lead to undesired results. Have your choice!}%
\def\MT@warn@preset@towidth#1{%
\MT@warning@nl{%
Cannot preset characters relative to their widths\MessageBreak
- for \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'. Presetting them%
- \MessageBreak relative to 1em instead}%
+ for \@nameuse{MT@abbr@#1} list `\@nameuse{MT@#1@c@name}'.
+ Presetting them\MessageBreak relative to 1em instead}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\noprotrusion}
+%\changes{v3.0}{2021/05/15}{provide command for older \LaTeX\ versions}
+% This command may be used to inhibit protrusion on either side. It's part
+% of \LaTeX\ since 2018-12-01.
+% We provide it for older releases.
+% \begin{macrocode}
+\MT@ifdefined@c@TF\noprotrusion\relax{
+ \DeclareRobustCommand\noprotrusion{\leavevmode\kern-\p@\kern\p@}
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@tempbox}
+%\begin{macro}{\MT@leftmarginkern}
+%\begin{macro}{\MT@rightmarginkern}
+% \begin{macrocode}
+\newbox\MT@tempbox
+\newdimen\MT@leftmarginkern
+\newdimen\MT@rightmarginkern
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\leftprotrusion}
+%\changes{v3.0}{2021/05/15}{new command}
+% This command may be used to add protrusion on the left hand side.
+% We try to reconstruct the next glyph (possibly a ligature).\footnote{
+% \luatex\ offers the command \cmd\protrusionboundary, which could
+% potentially be very helpful here, but it doesn't seem to do what it
+% promises (not even the example from the manual works as advertised).}
+% ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-May/006486.html
+% \begin{macrocode}
+\DeclareRobustCommand\leftprotrusion{%
+ \MT@toks{}%
+ \MT@prot@get@firstchar
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@l}
+% These macros need to be \cmd\long.
+% \begin{macrocode}
+\long\def\MT@prot@l#1{%
+ \MT@get@prot{#1}%
+ \ifdim\MT@leftmarginkern=\z@ \else
+ \leavevmode
+ \MT@vinfo{|<< adding left margin kern for `\@tempa':\MessageBreak
+ \the\MT@leftmarginkern \on@line}%
+ \kern\MT@leftmarginkern
+ \fi
+ #1%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\rightprotrusion}
+% Unfortunately, there's no way to retrieve anything that's already been typeset,
+% so the counterpart cannot be symmetric.
+%\changes{v3.0}{2021/05/15}{new command}
+% \begin{macrocode}
+\DeclareRobustCommand\rightprotrusion{\MT@prot@r}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@r}
+% \begin{macrocode}
+\long\def\MT@prot@r#1{%
+ #1%
+ \MT@get@prot{#1}%
+ \ifdim\MT@rightmarginkern=\z@ \else
+ \MT@vinfo{>>| adding right margin kern for `\@tempa':\MessageBreak
+ \the\MT@rightmarginkern \on@line}%
+ \kern\MT@rightmarginkern
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@get@prot}
+% Typeset the text inside a box and get the left and right margin kerns.
+% We add an extra \cmd\vbox\ in case we're inside a |tabular|.
+% \cmd\@newlistfalse\ is meant to make \cmd\\ work in |centering| etc.
+% \begin{macrocode}
+\long\def\MT@get@prot#1{%
+ \MT@leftmarginkern=\z@
+ \MT@rightmarginkern=\z@
+ \begingroup
+ \setbox\MT@tempbox\vbox{%
+ \everypar{}%
+ \parfillskip=\z@skip
+ \hbadness\@M
+ \@newlistfalse
+ \noindent #1}%
+ \vbadness=\@M
+ \splittopskip=\z@
+ \setbox\MT@tempbox\vbox{%
+ \global\setbox\MT@tempbox=\vsplit\MT@tempbox to \normalbaselineskip
+ \unvbox\MT@tempbox
+ \global\setbox\MT@tempbox=\lastbox
+ }%
+ \endgroup
+ \ifhbox\MT@tempbox
+ \def\@tempa{#1}%
+ \MT@leftmarginkern=\leftmarginkern\MT@tempbox\relax
+ \MT@rightmarginkern=\rightmarginkern\MT@tempbox\relax
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@ifx}
+% Test next token.
+% \begin{macrocode}
+\def\MT@prot@ifx#1{%
+ \ifx\MT@prot@next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@ifcat}
+% Test catcode of next token.
+% \begin{macrocode}
+\def\MT@prot@ifcat#1{%
+ \ifcat#1\noexpand\MT@prot@next\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@ifmacro}
+%\begin{macro}{\MT@prot@ifmacro@}
+%\begin{macro}{\MT@prot@ifmacro@@}
+% Test whether \meta{\#1} is a macro or an active character
+% that does not take an argument.
+% (inspired by Joseph Wright). ^^A https://tex.stackexchange.com/a/331696/
+% Only works with \etex.
+% \begin{macrocode}
+^^X\def\MT@prot@ifmacro{%
+^^X \expandafter\MT@prot@ifmacro@\meaning\MT@prot@next\@nil
+^^X}
+^^X\edef\MT@prot@ifmacro@#1\@nil{%
+^^X \noexpand\MT@prot@ifmacro@@#1{}{}\detokenize{macro:->}\noexpand\@nil
+^^X}
+^^X\edef\MT@temp{%
+^^X \def\noexpand\MT@prot@ifmacro@@##1\detokenize{macro:->}##2\noexpand\@nil{%
+^^X \noexpand\ifx\relax##1\relax
+^^X \unexpanded{\expandafter\@firstofone\else\expandafter\@gobble\fi}%
+^^X }%
+^^X}
+^^X\MT@temp
+^^Q\let\MT@prot@ifmacro\@gobble
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@prot@iffirstcmd}
+% Test for the first command.
+% \begin{macrocode}
+\def\MT@prot@iffirstcmd#1{%
+ \ifx\relax#1\relax\expandafter\@secondoftwo\else
+ \MT@exp@two@c\ifx\@car\MT@prot@next\relax\@empty\@nil#1%
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@iflicrcmd}
+% Fun with <LICR>:
+% Test if the first command of the third command of the first command
+% is \cmd\@text@composite, in which case also grab the next token,
+% otherwise it should be a text command.
+% \begin{macrocode}
+\def\MT@getthird#1#2#3#4\@nil{#3}
+\def\MT@prot@iflicrcmd#1{%
+ \MT@exp@cs\MT@prot@iffirstcmd{#1-cmd}{%
+ \expandafter\expandafter\expandafter\let
+ \expandafter\expandafter\expandafter\@tempa
+ \expandafter\MT@getthird\MT@prot@next\relax\@nil
+ \MT@exp@two@c\ifx\@car\@tempa\relax\@nil\@text@composite
+ \def\MT@temp*##1##2{\MT@prot@l{##1##2}}%
+ \else
+ \def\MT@temp*##1{\MT@prot@l{##1}}%
+ \fi
+ \@gobble
+ }\@firstofone
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@get@firstchar}
+%\begin{macro}{\MT@prot@get@nextchar}
+% Scan token by token.
+% \begin{macrocode}
+\def\MT@prot@get@firstchar{\futurelet\MT@prot@next\MT@prot@get@first@char}
+\def\MT@prot@get@nextchar{\futurelet\MT@prot@next\MT@prot@get@next@char}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@prot@get@first@char}
+% If next char is |{|, treat what follows as an argument, else continue until
+% we find a beginning char.
+% \begin{macrocode}
+\def\MT@prot@get@first@char{%
+ \def\MT@temp*##1{\MT@prot@get@firstchar}%
+ \MT@prot@ifcat\bgroup{%
+ \long\def\MT@temp*##1{{\MT@prot@l{##1}}}%
+ }{%
+ \MT@prot@ifx\ignorespaces\relax{%
+ \MT@prot@ifx\relax\relax{%
+ \MT@prot@ifx\@sptoken{%
+ \def\MT@temp* {\MT@prot@get@firstchar}%
+ }{%
+% \end{macrocode}
+% But only add it if it's a letter or a character, \dots
+% \begin{macrocode}
+ \def\MT@temp*{\MT@prot@addtoken@first}%
+ \MT@prot@ifcat{a}\relax{%
+ \MT@prot@ifcat{!}\relax{%
+% \end{macrocode}
+% \dots~or a command/active char whose first command is one of the below.
+% \begin{macrocode}
+ \def\MT@temp*{}%
+ \MT@prot@ifmacro{%
+ \MT@prot@iffirstcmd\UTFviii@two@octets{%
+ \def\MT@temp*##1##2{\MT@prot@l{##1##2}}%
+ }{%
+ \MT@prot@iffirstcmd\UTFviii@three@octets{%
+ \def\MT@temp*##1##2##3{\MT@prot@l{##1##2##3}}%
+ }{%
+ \MT@prot@iffirstcmd\UTFviii@four@octets{%
+ \def\MT@temp*##1##2##3##4{\MT@prot@l{##1##2##3##4}}%
+ }{%
+ \MT@prot@iflicrcmd{T1}{%
+ \MT@prot@iflicrcmd{TU}{%
+ \MT@prot@iflicrcmd{LY1}{%
+ \MT@prot@iflicrcmd{OT1}{%
+ \MT@prot@iflicrcmd{T2A}\relax % should we add more encodings?
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \MT@temp*%
}
-%</pdftex-def|xetex-def|luatex-def>
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@ifx}
+% Continue if letter or other.
+% \begin{macrocode}
+\def\MT@prot@get@next@char{%
+ \def\MT@temp*{\MT@prot@addtoken@next}%
+ \MT@prot@ifcat{a}\relax{%
+ \MT@prot@ifcat{!}\relax{%
+ \def\MT@temp*{\MT@prot@l{\the\MT@toks}}%
+ }%
+ }%
+ \MT@temp*%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@addtoken@first}
+% Begin filling toks.
+% \begin{macrocode}
+\def\MT@prot@addtoken@first#1{%
+ \edef\MT@temp{\MT@toks={\the\MT@toks\noexpand#1}}\MT@temp
+ \MT@prot@get@nextchar
+}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@addtoken@next}
+% Add token to our toks and test whether we've seen enough (ligature completed).
+% For luatex, we have to jump through another hoop (\ie, box), because, contrary
+% to the manual, \cmd\lastnodetype\ isn't really compatible. ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-August/006536.html et seqq.
+% \begin{macrocode}
+%<*pdf-|lua-|xe->
+\def\MT@prot@addtoken@next#1{%
+ \edef\MT@temp{\MT@toks={\the\MT@toks\noexpand#1}}\MT@temp
+ \setbox\MT@tempbox\hbox{\the\MT@toks
+%<pdf-|xe-> \relax
+%<lua-> }\setbox\MT@tempbox\hbox{\unhbox\MT@tempbox
+ \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
+ \MT@prot@get@nextchar
+ {\MT@prot@l{\the\MT@toks}}%
+}
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%
@@ -6686,7 +8118,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\begin{macro}{\MT@expansion}
% Set up for expansion?
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@expansion{\MT@maybe@do{ex}}
% \end{macrocode}
%\end{macro}
@@ -6711,7 +8143,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@expandfont
}\relax
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%
@@ -6726,7 +8158,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \end{macrocode}
%\end{macro}
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@set@ex@codes@n{%
\MT@nonselectedtrue
\MT@if@list@exists
@@ -6763,7 +8195,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v2.7d}{2019/11/17}{use \luatex\ function \texttt{font.}\penalty\exhyphenpenalty\texttt{setexpansion} if available}
%\fi
% \begin{macrocode}
-%<*luatex-def>
+%<*lua->
\MT@requires@luatex3{
\MT@requires@luatex4{\let\pdffontexpand\expandglyphsinfont}\relax
\ifnum\luatexversion<79
@@ -6776,11 +8208,11 @@ time will almost certainly lead to undesired results. Have your choice!}%
}
\fi
}{
-%</luatex-def>
+%</lua->
\def\MT@expandfont{%
\pdffontexpand\MT@font \MT@stretch@ \MT@shrink@ \MT@step@ \MT@auto@\relax
}
-%<luatex-def>}
+%<lua->}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@all@ex}
@@ -6802,8 +8234,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v1.6a}{2005/01/30}{only reset \cmd\efcode s for older \pdftex\ versions}
%\changes{v2.7}{2017/02/13}{only reset \cmd\efcode s for older \luatex\ versions}
% \begin{macrocode}
-%<pdftex-def>\MT@requires@pdftex4
-%<luatex-def>\MT@requires@luatex5
+%<pdf->\MT@requires@pdftex4
+%<lua->\MT@requires@luatex5
{
\def\MT@reset@ef@codes{%
\ifnum\MT@ex@factor@=\@m \else
@@ -6876,9 +8308,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@get@ex@opt@{stretch}{Setting stretch limit to \number\MT@stretch@}%
\MT@get@ex@opt@{shrink} {Setting shrink limit to \number\MT@shrink@}%
\MT@get@ex@opt@{step} {Setting expansion step to \number\MT@step@}%
-%<luatex-def> \MT@requires@luatex3\relax{%
+%<lua-> \MT@requires@luatex3\relax{%
\MT@get@ex@opt@{auto}{\MT@ifstreq{\MT@auto@}{autoexpand}{En}{Dis}abling automatic expansion}%
-%<luatex-def> }%
+%<lua-> }%
\MT@ifdefined@n@T{MT@ex@c@\MT@ex@c@name @preset}{%
\MT@preset@ex
\let\MT@reset@ef@codes\relax
@@ -6919,7 +8351,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@scale@factor
\MT@set@all@ex\@tempcntb
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%
@@ -6928,7 +8360,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\begin{macro}{\MT@spacing}
% Adjustment of interword spacing? Only works with \pdftex.
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@requires@pdftex6{
\def\MT@spacing{\MT@maybe@do{sp}}
% \end{macrocode}
@@ -7140,7 +8572,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@set@all@kn\@tempa\@tempb
}
}\relax
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -7151,9 +8583,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v2.5}{2010/09/17}{letterspacing with \luatex\ 0.62} ^^A (beta:03)
% or \luatex\ 0.62.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex6
-%<luatex-def>\MT@requires@luatex3
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex6
+%<lua->\MT@requires@luatex3
{
% \end{macrocode}
%\begin{macro}{\MT@tracking}
@@ -7174,9 +8606,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
\fi
\fi
}
-%</pdftex-def|luatex-def>
-%<pdftex-def|luatex-def|letterspace>\let\MT@tracking
-%<pdftex-def|luatex-def> \MT@tracking@
+%</pdf-|lua->
+%<pdf-|lua-|letterspace>\let\MT@tracking
+%<pdf-|lua-> \MT@tracking@
%<letterspace> \relax
% \end{macrocode}
%\end{macro}
@@ -7187,26 +8619,33 @@ time will almost certainly lead to undesired results. Have your choice!}%
% settings from \cs{SetTracking}, or the global \opt{letterspace} option, in
% this order.
%
-% Tracking won't work if the original font's \fontdim6 is zero, in which
+% Tracking won't work with older \pdftex\ versions (\less\ 1.40.23)
+% if the original font's \fontdim6 is zero, in which
+%\changes{v3.0}{2021/06/11}{with \luatex, tracking also works for fonts with a zero \fontdim6}
+%\changes{v3.0}{2021/07/01}{with \pdftex\ 1.40.23, tracking also works for fonts with a zero \fontdim6}
% case we issue a warning (once for every font).
% \begin{macrocode}
-%<*pdftex-def|luatex-def|letterspace>
+%<*pdf-|lua-|letterspace>
\def\MT@set@tr@codes{%
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\MT@vinfo{Tracking font `\MT@@font'\on@line}%
- \MT@ifdefined@n@TF{\MT@@font-fake6}{%
- \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty
- \MT@warning@nl{%
- Font `\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}%
- \MT@glet@nc{\MT@@font-fake6}\relax
- \fi
+%<*pdf->
+ \MT@requires@pdftex8\@firstofone{%
+ \MT@ifdefined@n@TF{\MT@@font-fake6}{%
+ \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty
+ \MT@warning@nl{%
+ Font `\MT@@font' does not specify its\MessageBreak
+ \@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak
+ tracking will not work with this font}%
+ \MT@glet@nc{\MT@@font-fake6}\relax
+ \fi
+ }%
}{%
+%</pdf->
\MT@if@list@exists
\MT@get@tr@opt
\relax
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
\MT@ifdefined@c@TF\MT@letterspace@\relax{\let\MT@letterspace@\MT@letterspace}%
\ifnum\MT@letterspace@=\z@
% \end{macrocode}
@@ -7215,7 +8654,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
\MT@set@tr@zero
\else
-%<pdftex-def|luatex-def> \MT@vinfo{... Tracking by \number\MT@letterspace@}%
+%<pdf-|lua-> \MT@vinfo{... Tracking by \number\MT@letterspace@}%
% \end{macrocode}
% Letterspacing only works in <PDF> mode.
% \begin{macrocode}
@@ -7246,24 +8685,21 @@ time will almost certainly lead to undesired results. Have your choice!}%
% use when dealing with non-legacy fonts, as it is less problematic and faster
% than the \pdftex\ primitive \cmd\letterspacefont.
% \begin{macrocode}
-%<*luatex-def|letterspace>
+%<*lua-|letterspace>
\MT@if@luaotf@font{%
-%<luatex-def&debug>\MT@dinfo@nl{1}{... luaotf font: \MessageBreak
-%<luatex-def&debug> \expandafter\fontname\font@name}%
- \ifnum\MT@letterspace@<\z@\def\MT@minus{-}\else\let\MT@minus\@empty\fi
- \global\expandafter\font\MT@lsfont=%
- \expandafter\MT@exp@two@c\expandafter\MT@ls@fontspec@font
- \expandafter\fontname\expandafter\font@name\space \@nil
+%<lua-&debug>\MT@dinfo@nl{1}{... luaotf font: \MessageBreak
+%<lua-&debug> \expandafter\fontname\font@name}%
+ \global\expandafter\font\MT@lsfont=\MT@ls@fontspec@font
}{%
-%</luatex-def|letterspace>
-%<luatex-def&debug>\MT@dinfo@nl{1}{... legacy font}%
+%</lua-|letterspace>
+%<lua-&debug>\MT@dinfo@nl{1}{... legacy font}%
\global\expandafter\letterspacefont\MT@lsfont\font@name\MT@letterspace@
-%<luatex-def|letterspace> }%
+%<lua-|letterspace> }%
% \end{macrocode}
%\changes{v2.2}{2007/06/16}{possibility to customise interword spacing}
% Scale interword spacing (not configurable in \letterspace).
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\MT@ifdefined@c@TF\MT@tr@ispace
{\let\@tempa\MT@tr@ispace}%
{\edef\@tempa{\MT@letterspace@*,,}}%
@@ -7271,7 +8707,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
{\edef\@tempa{\@tempa,\MT@tr@ospace}}%
{\edef\@tempa{\@tempa,,,}}%
\expandafter\MT@tr@set@space\@tempa,%
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
%<*letterspace>
% spacing = {<letterspace amount>*,,}
\fontdimen2\MT@lsfont=\dimexpr\numexpr 1000+\MT@letterspace@\relax sp
@@ -7283,7 +8719,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% ^^A MID: <46aa1cbb$0$31620$9b4e6d93@newsspool3.arcor-online.net>
% Adjust outer kerning (\microtype\ only).
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\MT@ifdefined@c@TF\MT@tr@okern{\let\@tempa\MT@tr@okern}{\def\@tempa{*,*}}%
\expandafter\MT@tr@set@okern\@tempa,%
% \end{macrocode}
@@ -7292,7 +8728,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% Disable ligatures (not configurable in \letterspace).
% \begin{macrocode}
\MT@ifdefined@c@T\MT@tr@ligatures\MT@tr@noligatures
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
%<*letterspace>
% no ligatures = {f}
\tagcode\MT@lsfont`f=\m@ne
@@ -7308,12 +8744,12 @@ time will almost certainly lead to undesired results. Have your choice!}%
% (reported by \contributor Wolfram Schaalo <schaalo\at gmx.net>)}
% ^^A private mail, 2008/05/12
% \begin{macrocode}
-%<luatex-def|letterspace> \MT@if@luaotf@font\relax{%
+%<lua-|letterspace> \MT@if@luaotf@font\relax{%
%<debug>\MT@dinfo@nl{2}{... compensating for tracking (\number\MT@letterspace@)}%
\MT@do@font{\lpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax
\rpcode\MT@lsfont\@tempcnta=\numexpr\MT@letterspace@/2\relax}%
\let\MT@the@pr@code\MT@the@pr@code@tr
-%<luatex-def|letterspace> }%
+%<lua-|letterspace> }%
\fi
% \end{macrocode}
% Finally, let the letterspaced font propagate.
@@ -7321,8 +8757,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v2.5a}{2013/05/15}{fix: load font for \pkg{fontspec}} ^^A for MT@get@slot
% \begin{macrocode}
\aftergroup\MT@set@lsfont
-%<pdftex-def|luatex-def> \let\MT@font\MT@lsfont
-%<luatex-def> \MT@if@luaotf@font\MT@font\relax
+%<pdf-|lua-> \let\MT@font\MT@lsfont
+%<lua-> \MT@if@luaotf@font\MT@font\relax
% \end{macrocode}
%\begin{macro}{\MT@set@curr@ls}
%\begin{macro}{\MT@curr@ls}
@@ -7339,11 +8775,11 @@ time will almost certainly lead to undesired results. Have your choice!}%
% We get the current outer spacing and adjust it, then, after the end of the
% current outer group, set the current outer spacing, again, and adjust.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\MT@outer@space=\csname MT@outer@space\expandafter\string\font@name\endcsname\relax
\xdef\MT@set@curr@os{\MT@outer@space=\the\MT@outer@space\relax}%
\MT@tr@outer@l
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
% If \cs{MT@ls@adjust} is empty, it's the starred version of \cs{textls}.
@@ -7357,14 +8793,14 @@ time will almost certainly lead to undesired results. Have your choice!}%
% Otherwise, get the current outer kerning and adjust it, for left and right
% side (\microtype\ only).
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\else
\MT@outer@kern=\expandafter\expandafter\expandafter\@firstoftwo
\csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
\ifdim\MT@outer@kern=\z@\else \MT@ls@outer@k \fi
\MT@outer@kern=\expandafter\expandafter\expandafter\@secondoftwo
\csname MT@outer@kern\expandafter\string\font@name\endcsname\relax
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
%<*letterspace>
\xdef\MT@set@curr@ok{\MT@outer@kern=\the\MT@outer@kern\relax}%
\MT@afteraftergroup{%
@@ -7373,7 +8809,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
}%
%</letterspace>
\fi
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
% \end{macrocode}
%\begin{macro}{\MT@set@curr@ok}
% Carry the outer kerning amount to outside the next group, then set outer
@@ -7390,9 +8826,9 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@set@curr@ok
\noexpand\MT@tr@outer@r
}%
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
\fi
-%<pdftex-def|luatex-def> }%
+%<pdf-> }%
}
% \end{macrocode}
%\end{macro}
@@ -7412,36 +8848,50 @@ time will almost certainly lead to undesired results. Have your choice!}%
}%
%<!letterspace> }%
}
-%</pdftex-def|luatex-def|letterspace>
+%</pdf-|lua-|letterspace>
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT@ls@fontspec@colon}
%\begin{macro}{\MT@ls@fontspec@font}
%\changes{v2.6a}{2016/05/03}{fix for value of \textpm1000}
%\changes{v2.7}{2017/02/10}{fix for `\texttt{file:}\meta{font}' spec
-% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)}
+% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)}
% ^^A http://tug.org/pipermail/lualatex-dev/2017-February/001670.html
-% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}
-% (we might have to add the colon ourselves).
+%\changes{v3.0}{2021/03/19}{use \texttt{lua} to parse font spec\slash fix for font spec containing spaces
+% (reported by \contributor Aman Mehra <reportaman\at gmail.com>)}
+% ^^A https://tex.stackexchange.com/questions/567698/luatex-microtype-fontspec-luaotfload-buggy-interaction-canceling-each-others-s
+% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}.
% \begin{macrocode}
-%<*luatex-def|letterspace>
-\def\MT@ls@fontspec@colon#1:#2:#3:#4\@nil{\ifx\\#3\\#1:#2\else#1:#2:#3\fi}
-\def\MT@ls@fontspec@font#1 #2\@nil{%
- "\MT@ls@fontspec@colon#1:::\relax\@nil
- kernfactor=\MT@minus \ifnum\MT@letterspace@=1000 1\else 0.%
- \ifnum\MT@minus\MT@letterspace@<100 0\fi
- \ifnum\MT@minus\MT@letterspace@<10 0\fi
- \number\MT@minus\MT@letterspace@ \fi;"
- \ifx\\#2\\ at \f@size pt\else#2\fi\relax
+%<*lua-|letterspace>
+\def\MT@ls@fontspec@font{%
+ \MT@lua{microtype.add_ls([[\MT@letterspace@]])}%
}
-%</luatex-def|letterspace>
+%</lua-|letterspace>
+%<*luafile>
+local function add_ls(k)
+ local f = tex.fontname(font.current())
+ local spec,size = match(f,'^(.+)( at .+)$')
+ if not spec then spec = f end
+ local a,b,c = match(spec,'^([^:]+):?([^:]*):?(.*)$')
+ local ls = "kernfactor=" .. k/1000 .. ';'
+ microtype.sprint(a..':')
+ if (a == "name" or a == "file") then
+ microtype.sprint(b..':'..ls..c)
+ else
+ microtype.sprint(ls..b)
+ end
+ if size then
+ microtype.sprint(size)
+ end
+end
+microtype.add_ls = add_ls
+
+%</luafile>
% \end{macrocode}
%\end{macro}
-%\end{macro}
%\begin{macro}{\MT@get@tr@opt}
% Various settings (only for the \microtype\ version).
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@get@tr@opt{%
\MT@set@listname
\let\MT@tr@factor@\@m
@@ -7497,14 +8947,14 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@ifdefined@n@T{MT@tr@c@\MT@tr@c@name @#1}%
{\MT@let@nn{MT@tr@#2}{MT@tr@c@\MT@tr@c@name @#1}}%
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@set@lsfont}
% Redefine \cmd\font@name, which will be called a second later (in
% \cmd\selectfont).
% \begin{macrocode}
-%<*pdftex-def|luatex-def|letterspace>
+%<*pdf-|lua-|letterspace>
%<plain>\MT@requires@latex2{
\def\MT@set@lsfont{\MT@exp@two@c\let\font@name\MT@lsfont}
% \end{macrocode}
@@ -7540,8 +8990,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
\DeclareRobustCommand\lsstyle{%
\not@math@alphabet\lsstyle\textls
\let\glb@currsize\@empty
-%<pdftex-def|luatex-def> \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}%
-%<pdftex-def|luatex-def> \def\MT@feat{tr}%
+%<pdf-|lua-> \MT@maybe@gobble@with@tikz{\aftergroup\glb@settings}%
+%<pdf-|lua-> \def\MT@feat{tr}%
\let\MT@tracking\MT@set@tr@codes
\selectfont
}
@@ -7625,15 +9075,15 @@ time will almost certainly lead to undesired results. Have your choice!}%
\aftergroup\MT@set@lsbasefont
\fi
}
-%</pdftex-def|luatex-def|letterspace>
+%</pdf-|lua-|letterspace>
% \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@tr@noligatures}
% \pdftex\ 1.40.0--1.40.3 disabled all ligatures in letterspaced fonts.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex7{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex7{
\def\MT@tr@noligatures{%
\ifx\MT@tr@ligatures\@empty
\MT@noligatures@\MT@lsfont\@undefined
@@ -7641,7 +9091,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@noligatures@\MT@lsfont\MT@tr@ligatures
\fi
}
-%<*pdftex-def>
+%<*pdf->
}{
\def\MT@tr@noligatures{%
\MT@warning@nl{%
@@ -7650,7 +9100,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@glet\MT@tr@noligatures\relax
}
}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@outer@space}
@@ -7787,8 +9237,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\end{macro}
%\end{macro}
%\begin{macro}{\MT@if@outer@next}
-% We avoid using \cs{ifx} tests, in case \cs{MT@tr@outer@next} is \cmd\let\ to
-% \cs{fi} etc.
+% We avoid using \orig@cs{ifx} tests, in case \cs{MT@tr@outer@next} is \cmd\let\ to
+% \orig@cs{fi} etc.
%\changes{v2.5}{2012/02/20}{fix: conflict with \pkg{amsmath}
% (reported by \contributor Scott Pakin <scott\at pakin.org>)}
% ^^A private mail, 2012/02/09
@@ -7933,8 +9383,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
}{
\DeclareRobustCommand\lsstyle{%
\MT@error{Letterspacing only works with \MT@engine tex version
-%<pdftex-def> 1.40%
-%<luatex-def> 0.62%
+%<pdf-> 1.40%
+%<lua-> 0.62%
\MessageBreak or newer}
{Upgrade \MT@engine tex, or try the `soul' package instead.}%
\MT@glet\lsstyle\relax
@@ -7943,14 +9393,14 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \end{macrocode}
% And for \xetex, too.
% \begin{macrocode}
-%</pdftex-def|luatex-def>
-%<*xetex-def>
+%</pdf-|lua->
+%<*xe->
\DeclareRobustCommand\lsstyle{%
\MT@error{Letterspacing currently doesn't work with xetex}
{Run pdftex or luatex, or use the `soul' package instead.}%
\MT@glet\lsstyle\relax
}
-%</xetex-def>
+%</xe->
% \end{macrocode}
%\begin{macro}{\textls}
%\changes{v2.0}{2005/09/21}{new command: letterspacing} ^^A (beta:1)
@@ -8022,11 +9472,11 @@ time will almost certainly lead to undesired results. Have your choice!}%
\def\MT@ls@too@large#1{%
\ifnum#1>\MT@tr@max
\MT@warning{Maximum for option `letterspace' is \number\MT@tr@max}%
- \let#1\MT@tr@max
+ \edef#1{\number\MT@tr@max}%
\else
\ifnum#1<\MT@tr@min
\MT@warning{Minimum for option `letterspace' is \number\MT@tr@min}%
- \let#1\MT@tr@min
+ \edef#1{\number\MT@tr@min}%
\fi
\fi
}
@@ -8040,7 +9490,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
\newdimen\MT@outer@kern
%</package|letterspace>
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@tr@set@okern#1,#2,{%
\let\MT@temp\@empty
\MT@ifempty{#1}{\MT@tr@set@okern@{*}}{\MT@tr@set@okern@{#1}}%
@@ -8069,7 +9519,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
* \fontdimen6\MT@lsfont/2000\relax
\edef\MT@temp{\MT@temp{\the\@tempdima}}%
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@ls@outer@k}
@@ -8077,7 +9527,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% for cases of nested letterspacing without anything actually printed. ^^A eg. \LaTeX!
%\changes{v2.5a}{2013/05/15}{add marker for tightly nested letterspacing}
% \begin{macrocode}
-%<*pdftex-def|luatex-def|letterspace>
+%<*pdf-|lua-|letterspace>
\def\MT@ls@outer@k{%
\ifhmode
\ifdim\lastkern=-3sp \unkern
@@ -8092,7 +9542,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
{\kern\MT@outer@kern\kern3sp\kern-3sp\relax}%
\fi
}
-%</pdftex-def|luatex-def|letterspace>
+%</pdf-|lua-|letterspace>
% \end{macrocode}
%\end{macro}
%
@@ -8103,8 +9553,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
% also works with \luatex.
%\changes{v2.3}{2007/10/23}{fix: set evaluation didn't work (bug introduced in v2.2)}
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex5{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex5{
\def\MT@noligatures{%
\MT@dotrue
\let\@tempa\MT@nl@setname
@@ -8122,7 +9572,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\begin{macro}{\MT@noligatures@}
% This is also used by \cs{MT@set@tr@codes}.
% \begin{macrocode}
-%<luatex-def>\MT@requires@luatex4{\let\pdfnoligatures\ignoreligaturesinfont}\relax
+%<lua->\MT@requires@luatex4{\let\pdfnoligatures\ignoreligaturesinfont}\relax
\def\MT@noligatures@#1#2{%
\MT@ifdefined@c@TF#2{%
% \end{macrocode}
@@ -8144,8 +9594,8 @@ time will almost certainly lead to undesired results. Have your choice!}%
% in a table (used by the \pkg{luaotfload} function |keepligature|).
%\changes{v2.6}{2016/04/20}{use \pkg{luaotfload} function to keep\slash inhibit ligatures}
% \begin{macrocode}
-%<luatex-def> \MT@if@luaotf@font
-%<luatex-def> {\MT@lua{microtype.noligatures([[#1]],[[\MT@char]])}}\relax
+%<lua-> \MT@if@luaotf@font
+%<lua-> {\MT@lua{microtype.noligatures([[#1]],[[\MT@char]])}}\relax
\fi
}%
\MT@vinfo{... Disabling ligatures for characters: #2}%
@@ -8157,13 +9607,13 @@ time will almost certainly lead to undesired results. Have your choice!}%
}%
}{%
\pdfnoligatures#1%
-%<luatex-def> \MT@if@luaotf@font
-%<luatex-def> {\MT@lua{microtype.noligatures([[#1]],"_all_")}}\relax
+%<lua-> \MT@if@luaotf@font
+%<lua-> {\MT@lua{microtype.noligatures([[#1]],"_all_")}}\relax
\MT@vinfo{... Disabling all ligatures}%
}%
}
-%<pdftex-def>}\relax
-%</pdftex-def|luatex-def>
+%<pdf->}\relax
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -8221,30 +9671,38 @@ end
%</luafile>
% \end{macrocode}
%
-%\subsubsection{Loading the configuration}
+%\subsubsection{Loading the configuration}\label{ssub:setup-config}
%
%\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}
-%<*package>
-\def\MT@load@list#1{%
- \edef\@tempa{#1}%
+%<*package|show>
+%<package>\def\MT@load@list#1%
+%<show>\def\MTS@load@list#1%
+ {\edef\@tempa{#1}%
\MT@let@cn\@tempb{MT@\MT@feat @c@\@tempa @load}%
\MT@ifstreq\@tempa\@tempb{%
\MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempa' cannot load itself}{}%
}{%
- \ifx\@tempb\relax \else
+ \ifx\@tempb\relax
+%<show> :\par\medskip\leavevmode
+ \else
\MT@ifdefined@n@TF{MT@\MT@feat @c@\@tempb}{%
+%<show> \MTS@printtext{, loading \texttt{\@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
- \noexpand\MessageBreak`\@tempb'}%
+ \edef\MT@curr@list@name{%
+%<package> \@nameuse{MT@abbr@\MT@feat} list \noexpand\MessageBreak
+ `\@tempb'}%
\MT@let@cn\@tempc{MT@\MT@feat @c@\@tempb}%
\expandafter\MT@set@codes\@tempc,\relax,%
+%<show> \vrule width 4cm height .5pt \\
+%<show> \MTS@printtext{End of list \texttt{\MT@curr@list@name}}%
+%<show> \par\medskip\leavevmode
}{%
\MT@error{\@nameuse{MT@abbr@\MT@feat} list `\@tempb' undefined.\MessageBreak
Cannot load it from list `\@tempa'}{}%
@@ -8252,6 +9710,7 @@ end
\fi
}%
}
+%</package|show>
% \end{macrocode}
%\end{macro}
%\changes{v1.1}{2004/09/13}{configuration file names in lowercase
@@ -8265,6 +9724,7 @@ end
%\begin{macro}{\MT@file@list}
% We must also record whether we've already loaded the file.
% \begin{macrocode}
+%<*package>
\let\MT@file@list\@empty
\def\MT@find@file#1{%
% \end{macrocode}
@@ -8528,7 +9988,7 @@ end
% \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,
+%\changes{v1.7}{2005/02/06}{don't define \cs{MT@pr@c@name} etc. \cmd\global ly,
% here and elsewhere}
%\begin{macro}{\MT@context}
% \begin{macrocode}
@@ -8633,7 +10093,7 @@ end
%
%\begin{macro}{\MT@char}
%\begin{macro}{\MT@char@}
-% The character is in \cs{@tempa}, we want its slot number in \cs{MT@char}.
+% The character is in \cmd\@tempa, we want its slot number in \cs{MT@char}.
% \begin{macrocode}
\def\MT@get@slot{%
\escapechar`\\
@@ -8665,8 +10125,8 @@ end
%
% 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/04}{test whether \cs{}\meta{encoding}\cs{}\meta{...} is defined
+%\changes{v1.7}{2005/02/27}{test whether \texttt{\string\bslash}\meta{encoding}\texttt{\string\bslash}\meta{...} is defined}
+%\changes{v1.8}{2005/04/04}{test whether \texttt{\string\bslash}\meta{encoding}\texttt{\string\bslash}\meta{...} is defined
% made more robust}
%
% We must be cautious not to stumble over accented characters consisting
@@ -8703,12 +10163,12 @@ end
%\begin{macro}{\MT@get@slot@}
%\changes{v2.5}{2010/05/18}{adapt for \xetex}
% \begin{macrocode}
-%<*pdftex-def|luatex-def|xetex-def>
+%<*pdf-|lua-|xe->
\def\MT@get@slot@{%
% \end{macrocode}
% If it's a legacy (\ie, <TFM>) font, proceed as usual.
% \begin{macrocode}
-%<xetex-def> \ifnum\XeTeXfonttype\MT@font=\z@
+%<xe-> \ifnum\XeTeXfonttype\MT@font=\z@
\ifnum\MT@char > \m@ne
% \end{macrocode}
% In \luatex, it may also be a glyph name, prefixed with `|/|'.
@@ -8716,7 +10176,7 @@ end
% ^^A private mail, 2012/07/17
% ^^A (beta:10)
% \begin{macrocode}
-%<*luatex-def>
+%<*lua->
\ifnum\MT@char=47\relax
\ifMT@norest \else
\@tempcnta=\MT@lua{
@@ -8734,7 +10194,7 @@ end
\fi
\fi
\else
-%</luatex-def>
+%</lua->
% \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
@@ -8745,20 +10205,22 @@ end
% \begin{macrocode}
\ifMT@norest \else
\MT@warn@rest
-%<pdftex-def|luatex-def> \let\MT@char\m@ne
-%<xetex-def> \let\MT@char\@empty
+%<pdf-|lua-> \let\MT@char\m@ne
+%<xe-> \let\MT@char\@empty
\fi
-%<luatex-def> \fi
+%<lua-> \fi
\else
\MT@warn@unknown
-%<xetex-def> \let\MT@char\@empty
+%<xe-> \let\MT@char\@empty
\fi
-%<*xetex-def>
+%<*xe->
\else
% \end{macrocode}
% There are more possibilities for \xetex:
-% It may also be a glyph name (prefixed with~`|/|'). We indicate this to
-% \cs{MT@get@charwd} by reversing the sign of \cs{MT@char@}.
+% It may be a Unicode codepoint (prefixed with `|U|') or a glyph name (prefixed with~`|/|').\footnote{
+% This doesn't seem to be documented anywhere, but it has been announced here:
+% \url{https://tug.org/pipermail/xetex/2010-May/016531.html}}
+% We indicate glyph names to \cs{MT@get@charwd} by reversing the sign of \cs{MT@char@}.
% \begin{macrocode}
\ifnum\MT@char=47\relax
\ifMT@norest \edef\MT@char{U47}%
@@ -8778,7 +10240,7 @@ end
\ifMT@norest
% \end{macrocode}
% Or, it's a Unicode number, which we mustn't translate into a glyph number,
-% since the latter is font-specific.
+% since the latter is font-specific. But we add the `|U|' prefix.
% \begin{macrocode}
\@tempcnta=\XeTeXcharglyph\MT@char\relax
\ifnum\@tempcnta=\z@
@@ -8799,23 +10261,35 @@ end
\fi
\fi
\fi
-%</xetex-def>
+%</xe->
}
-%</pdftex-def|luatex-def|xetex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
% This is the lua function to translate glyph name into slot number.
-% Beginning with v2.2, \pkg{luaotfload} provides this function in an <API>, which
+% Beginning with v2.2, \pkg{luaotfload} provides this function in its <API>, which
% we use if available, but (for now, at least) keep the old code for backward
% compatibility.
%\changes{v2.5a}{2013/04/19}{adapt to \pkg{luaotfload} v2.2
% (contributed by \contributor \'Elie Roux <elie.roux\at telecom-bretagne.eu>)}
% ^^A MID: <516AAF6B.8040605@telecom-bretagne.eu>
+% With HarfBuzz, the return value is not guaranteed to be inside the
+% Unicode range, so we have to guard against this case as well (same as in
+% |do_font|).
+% ^^A cf. https://github.com/latex3/luaotfload/issues/198
+%\changes{v3.0}{2021/10/26}{guard against return values outside Unicode range (for HarfBuzz)}
+% Also, older versions of \pkg{luaotfload} (until v3.18) returned the numbers as floats.
+%^^A fixed here: https://github.com/latex3/luaotfload/commit/53b70cbdb60101e2869d879e9d8daf576b0c8f82
+%\changes{v3.0}{2021/10/30}{convert floats to integers
+% (reported by \contributor azur <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/616329/using-polyglossia-microtype-and-newcomputermodern-with-lualatex-results-in-0-0
% \begin{macrocode}
%<*luafile>
if luaotfload and luaotfload.aux and luaotfload.aux.slot_of_name then
local slot_of_name = luaotfload.aux.slot_of_name
microtype.name_to_slot = function(name, unsafe)
- return slot_of_name(font.current(), name, unsafe)
+ local n = math.tointeger(slot_of_name(font.current(), name, unsafe))
+ if n and n > 1114111 then n = -1 end
+ return n
end
else
-- we dig into internal structure (should be avoided)
@@ -8852,14 +10326,14 @@ end
%\begin{macro}{\MT@max@slot}
% Warning if resulting character or slot number is too large.
% \begin{macrocode}
-%<*pdftex-def|luatex-def|xetex-def>
+%<*pdf-|lua-|xe->
\def\MT@max@char
-%<pdftex-def> {127 }
-%<luatex-def|xetex-def> {1114111 }
+%<pdf-> {127 }
+%<lua-|xe-> {1114111 }
\def\MT@max@slot
-%<pdftex-def> {255 }
-%<luatex-def|xetex-def> {1114111 }
-%</pdftex-def|luatex-def|xetex-def>
+%<pdf-> {255 }
+%<lua-|xe-> {1114111 }
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -9048,7 +10522,7 @@ end
% 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.
+% been defined with \cmd\DeclareTextSymbol in the encoding definition files.
%\changes{v2.0}{2006/09/15}{made even more robust}
% \begin{macrocode}
\def\MT@is@symbol{%
@@ -9064,7 +10538,7 @@ end
\meaning\expandafter\MT@char\MT@charstring\relax\relax\relax
\ifnum\MT@char@ < \z@
% \end{macrocode}
-%\changes{v2.7c}{2019/08/13}{take care of \cs{remove@tlig}}
+%\changes{v2.7c}{2019/08/13}{take care of \cmd\remove@tlig}
% In <TU> encoding, some commands (currently, \cmd\textquotesingle, \cmd\textasciigrave\
% and \cmd\textquotedbl) are defined by means of the auxiliary macro
% \cmd\remove@tlig, which we take care of here.
@@ -9073,7 +10547,7 @@ end
\ifnum\MT@char@ < \z@
% \end{macrocode}
%\changes{v2.2}{2007/03/07}{expand once more (for \pkg{frenchpro})}
-% Finally, if it hasn't been defined by \cs{DeclareTextSymbol}, it could be a letter
+% Finally, if it hasn't been defined by \cmd\DeclareTextSymbol, it could be a letter
% (\eg, \cmd\i, when using \pkg{frenchpro}). ^^A as noted by Bernard Gaulle
% ^^A private mail, 2005/01/28
% \begin{macrocode}
@@ -9090,14 +10564,17 @@ end
% (reported by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)}
% ^^A private mail, 2021/03/02
% ^^A also: https://github.com/latex3/latex2e/issues/525
+%\changes{v3.0}{2021/10/18}{fix for incompatibility with \pkg{syntax}
+% (reported by \contributor Safron <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/619410/conflict-between-microtype-and-syntax-packages/
% \begin{macrocode}
\def\MT@is@opt@char#1\iffontchar#2\char#3\else#4\fi\relax{%
- \ifx\\#1\\%
+ \MT@ifempty{#1}{%
\iffontchar#2%
\expandafter\chardef
\csname\MT@encoding\MT@detokenize@c\@tempa\endcsname=#3\relax
\fi
- \fi
+ }\relax
}
% \end{macrocode}
%\end{macro}
@@ -9209,7 +10686,7 @@ end
% Again, we construct a control sequence, this time of the form:
% |\\|\meta{encoding}\allowbreak|\|\meta{accent}|-|\meta{character}, \eg,
% |\\T1\"-a|, which we then expand once to see if it is a letter (if it has
-% been defined by \cs{DeclareTextComposite}). This should be robust, finally,
+% been defined by \cmd\DeclareTextComposite). This should be robust, finally,
% especially, since we also \cmd\detokenize\ the input instead of only
% \cmd\string ifying it. Thus, we will die gracefully even on wrong Unicode
% input without |utf8|.
@@ -9219,9 +10696,9 @@ end
\MT@detokenize@n{#1}-\MT@detokenize@n{#2}\endcsname}%
% \end{macrocode}
% In 2017, \LaTeX\ introduced a new way of declaring accented
-% Unicode commands (\cs{DeclareUnicodeComposite}), which we take care of here
-% (\cs{UnicodeEncodingName} has been introduced at the same time):
-%\changes{v2.7}{2017/04/29}{compatibility with \LaTeX\ 2017/01/01 (\cs{DeclareUnicodeComposite})
+% Unicode commands (\cmd\DeclareUnicodeComposite), which we take care of here
+% (\cmd\UnicodeEncodingName\ has been introduced at the same time):
+%\changes{v2.7}{2017/04/29}{compatibility with \LaTeX\ 2017/01/01 (\cmd\DeclareUnicodeComposite)
% (reported by \contributor Ulrike Fischer <news3\at nililand.de> and
% `\contributor jcr <@\at @>')}
% ^^A (1) private mail, 2017/04/25
@@ -9247,7 +10724,7 @@ end
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@is@uni@comp}
-% Helper for \cs{DeclareUnicodeComposite}.
+% Helper for \cmd\DeclareUnicodeComposite.
% \begin{macrocode}
\def\MT@is@uni@comp#1\iffontchar#2\else#3\fi\relax{%
\ifx\\#1\\\edef\MT@char{\iffontchar#2\fi}\fi
@@ -9278,7 +10755,7 @@ end
% 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}
-%\changes{v1.9f}{2006/08/03}{fix: \cs{MessageBreak} must not be expanded}
+%\changes{v1.9f}{2006/08/03}{fix: \cmd\MessageBreak\ must not be expanded}
%\begin{macro}{\MT@set@listname}
% The type and name of the current list, defined at various places.
% \begin{macrocode}
@@ -9352,7 +10829,7 @@ end
\MT@warning@nl{One or more slots in the configuration are unknown.\MessageBreak
Make sure that no text commands are used.\MessageBreak
See the documentation for details (the note\MessageBreak
- on `#1' in section 9: `Hints and caveats')}%
+ on `#1' in section 11: `Hints and caveats')}%
\MT@glet\MT@warn@unknown\relax}%
}
%
@@ -9925,16 +11402,16 @@ end
% \begin{macrocode}
\newcommand\MT@DeclareSet[3][]{%
\MT@ifempty{#1}{%
- \MT@map@clist@c\MT@features{{\MT@declare@sets{##1}{#2}{#3}}}%
+ \MT@map@clist@c\MT@features{\begingroup\MT@declare@sets{##1}{#2}{#3}\endgroup}%
}{%
- \MT@map@clist@n{#1}{{%
+ \MT@map@clist@n{#1}{\begingroup
\MT@ifempty{##1}\relax{%
\MT@is@feature{##1}{set declaration `#2'}{%
\MT@exp@one@n\MT@declare@sets
{\csname MT@rbba@##1\endcsname}{#2}{#3}%
}%
}%
- }}%
+ \endgroup}%
}%
\MT@end@catcodes
}
@@ -10019,7 +11496,7 @@ end
\MT@ifempty\@tempa{\def\@tempa{#1}}\relax
% \end{macrocode}
% Test whether the command is actually defined.
-%\changes{v2.7a}{2017/11/17}{test whether \cs{\dots default} is defined}
+%\changes{v2.7a}{2017/11/17}{test whether \cmd{\...default} is defined}
% \begin{macrocode}
\MT@ifdefined@n@TF{\@tempa default}%
{\edef\MT@val{\expandafter\noexpand\csname \@tempa default\endcsname}}%
@@ -10153,7 +11630,7 @@ end
% \begin{macrocode}
\def\MT@get@size{%
% \end{macrocode}
-% A single star would mean \cs{sizedefault}, which doesn't exist, so we define
+% A single star would mean \cmd\sizedefault, which doesn't exist, so we define
% it to be \cmd\normalsize.
% \begin{macrocode}
\if*\MT@val\relax
@@ -10323,16 +11800,16 @@ end
% \begin{macrocode}
\newcommand*\MT@UseMicrotypeSet[2][]{%
\MT@ifempty{#1}{%
- \MT@map@clist@c\MT@features{{\MT@use@set{##1}{#2}}}%
+ \MT@map@clist@c\MT@features{\begingroup\MT@use@set{##1}{#2}\endgroup}%
}{%
- \MT@map@clist@n{#1}{{%
+ \MT@map@clist@n{#1}{\begingroup
\MT@ifempty{##1}\relax{%
\MT@is@feature{##1}{activation of set `#2'}{%
\MT@exp@one@n\MT@use@set
{\csname MT@rbba@##1\endcsname}{#2}%
}%
}%
- }}%
+ \endgroup}%
}%
\MT@end@catcodes
}
@@ -10385,16 +11862,16 @@ end
% \begin{macrocode}
\newcommand*\MT@DeclareMicrotypeSetDefault[2][]{%
\MT@ifempty{#1}{%
- \MT@map@clist@c\MT@features{{\MT@set@default@set{##1}{#2}}}%
+ \MT@map@clist@c\MT@features{\begingroup\MT@set@default@set{##1}{#2}\endgroup}%
}{%
- \MT@map@clist@n{#1}{{%
+ \MT@map@clist@n{#1}{\begingroup
\MT@ifempty{##1}\relax{%
\MT@is@feature{##1}{declaration of default set `#2'}{%
\MT@exp@one@n\MT@set@default@set
{\csname MT@rbba@##1\endcsname}{#2}%
}%
}%
- }}%
+ \endgroup}%
}%
\MT@end@catcodes
}
@@ -10540,8 +12017,8 @@ end
%
% The optional argument may be used to disable selected ligatures only.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex5{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex5{
\def\DisableLigatures{%
\MT@begin@catcodes
\MT@DisableLigatures
@@ -10554,25 +12031,25 @@ end
\gdef\MT@nl@setname{no ligatures}%
\MT@end@catcodes
}
-%<pdftex-def>}{
-%</pdftex-def|luatex-def>
+%<pdf->}{
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
% If \pdftex\ is too old, we throw an error.
% \begin{macrocode}
-%<*pdftex-def|xetex-def>
+%<*pdf-|xe->
\renewcommand*\DisableLigatures[2][]{%
\MT@error{Disabling ligatures of a font is only possible\MessageBreak
with pdftex version 1.30 or newer.\MessageBreak
Ignoring \string\DisableLigatures}{%
-%<pdftex-def> Upgrade
-%<xetex-def> Use
+%<pdf-> Upgrade
+%<xe-> Use
pdftex.}%
}
-%<pdftex-def>}
-%</pdftex-def|xetex-def>
+%<pdf->}
+%</pdf-|xe->
% \end{macrocode}
%\end{macro}
%
@@ -10613,7 +12090,7 @@ end
% A new macro called |\MT@pr@c@|\meta{name} will be defined to be \meta{\#3}
% (\ie, the list of characters, not expanded).
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
+%<*pdf-|lua-|xe->
\def\SetProtrusion{%
\MT@begin@catcodes
\MT@SetProtrusion
@@ -10649,7 +12126,7 @@ end
\MT@gdef@n{MT@pr@c@\MT@pr@c@name}{#3}%
\MT@end@catcodes
}
-%</pdftex-def|xetex-def|luatex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -10662,7 +12139,7 @@ end
% \cs{SetExpansion} only differs in that it allows some extra options
% (|stretch|, |shrink|, |step|, |auto|).
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\SetExpansion{%
\MT@begin@catcodes
\MT@SetExpansion
@@ -10732,13 +12209,13 @@ end
tracking set `\MT@curr@set@name'}}}%
\MT@end@catcodes
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\SetExtraSpacing}
%\changes{v2.0}{2005/09/28}{new command: adjustment of interword spacing} ^^A (beta:1)
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\def\SetExtraSpacing{%
\MT@begin@catcodes
\MT@SetExtraSpacing
@@ -10789,7 +12266,7 @@ end
\MT@gdef@n{MT@kn@c@\MT@kn@c@name}{#3}%
\MT@end@catcodes
}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -10986,8 +12463,8 @@ end
%\changes{v2.5}{2010/02/27}{allow contexts for \luatex}
% It also works with \luatex\ 0.30 or newer.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex7{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex7{
\define@key{MT@ex@c}{context}[]{%
\MT@ifempty{#1}\relax{%
\MT@glet\MT@copy@font\MT@copy@font@
@@ -11029,26 +12506,26 @@ end
\fi
}%
}
-%</pdftex-def|luatex-def>
-%<*pdftex-def>
+%</pdf-|lua->
+%<*pdf->
}{
\define@key{MT@ex@c}{context}[]{%
\MT@error{Expansion contexts only work with pdftex 1.40.4\MessageBreak
or later. Ignoring `context' key\on@line}%
{Upgrade pdftex.}%
}
-%</pdftex-def>
-%<*pdftex-def|xetex-def>
+%</pdf->
+%<*pdf-|xe->
\define@key{MT@pr@c}{context}[]{%
\MT@error{Protrusion contexts only work with pdftex
-%<pdftex-def> 1.40.4\MessageBreak or later.
-%<xetex-def> \MessageBreak or luatex.
+%<pdf-> 1.40.4\MessageBreak or later.
+%<xe-> \MessageBreak or luatex.
Ignoring `context' key\on@line}%
-%<pdftex-def> {Upgrade pdftex.}%
-%<xetex-def> {Use pdftex or luatex.}%
+%<pdf-> {Upgrade pdftex.}%
+%<xe-> {Use pdftex or luatex.}%
}
-%</pdftex-def|xetex-def>
-%<pdftex-def>}
+%</pdf-|xe->
+%<pdf->}
% \end{macrocode}
%\begin{macro}{\MT@warn@nodim}
% \begin{macrocode}
@@ -11068,7 +12545,7 @@ end
%\todo{new key for unit: \texttt{dimen} (for \texttt{kerning}, especially)}
% Protrusion codes may be relative to character width, or to any dimension.
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
+%<*pdf-|lua-|xe->
\define@key{MT@pr@c}{unit}[character]{%
\MT@glet@nc{MT@pr@c@\MT@curr@set@name @unit}\@empty
\def\@tempa{#1}%
@@ -11082,11 +12559,11 @@ end
{\MT@warn@nodim{character widths}}%
}%
}
-%</pdftex-def|xetex-def|luatex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
% Tracking may only be relative to a dimension.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\define@key{MT@tr@c}{unit}[1em]{%
\MT@glet@nc{MT@tr@c@\MT@curr@set@name @unit}\@empty
\def\@tempa{#1}%
@@ -11095,11 +12572,11 @@ end
{\MT@warn@nodim{1em}%
\MT@gdef@n{MT@tr@c@\MT@curr@set@name @unit}{1em}}%
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
% Spacing and kerning codes may additionally be relative to space dimensions.
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@map@clist@n{sp,kn}{%
\define@key{MT@#1@c}{unit}[space]{%
\MT@glet@nc{MT@#1@c@\MT@curr@set@name @unit}\@empty
@@ -11114,11 +12591,11 @@ end
}%
}%
}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
% The first argument to \cs{SetExpansion} accepts some more options.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\MT@map@clist@n{stretch,shrink,step}{%
\define@key{MT@ex@c}{#1}[]{%
\MT@ifempty{##1}\relax{%
@@ -11144,19 +12621,19 @@ end
%\changes{v1.7}{2005/03/07}{disallow automatic expansion if \pdftex\ too old}
%\changes{v2.7a}{2017/08/08}{disallow non-automatic expansion with \luatex}
% \begin{macrocode}
-%<pdftex-def> \MT@requires@pdftex4%
-%<luatex-def> \MT@requires@luatex3\relax
+%<pdf-> \MT@requires@pdftex4%
+%<lua-> \MT@requires@luatex3\relax
{\MT@gdef@n{MT@ex@c@\MT@curr@set@name @auto}{autoexpand}}%
-%<pdftex-def> {\MT@warning{pdftex too old for automatic font expansion}}%
+%<pdf-> {\MT@warning{pdftex too old for automatic font expansion}}%
\else
-%<pdftex-def> \MT@requires@pdftex4%
-%<*luatex-def>
+%<pdf-> \MT@requires@pdftex4%
+%<*lua->
\MT@requires@luatex3{%
\MT@warning{Non-automatic font expansion doesn't work with\MessageBreak
luatex}}%
-%</luatex-def>
+%</lua->
{\MT@glet@nc{MT@ex@c@\MT@curr@set@name @auto}\@empty}%
-%<pdftex-def> \relax
+%<pdf-> \relax
\fi
}
% \end{macrocode}
@@ -11175,7 +12652,7 @@ end
\define@key{MT@tr@c}{outer spacing}[]{\setkeys{MT@tr@c}{outerspacing={#1}}}
\define@key{MT@tr@c}{outer kerning}[]{\setkeys{MT@tr@c}{outerkerning={#1}}}
\define@key{MT@tr@c}{no ligatures}[]{\setkeys{MT@tr@c}{noligatures={#1}}}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%
%\subsubsection{Character inheritance}
@@ -11214,20 +12691,23 @@ end
%\end{macro}
%\begin{macro}{\MT@set@inh@list}
% No need to create an inheritance list for tracking.
+%\changes{v3.0}{2021/03/27}{fix: grouping with \cmd\begingroup~\dots~\cmd\endgroup\ instead of \texttt{\{}\dots\texttt{\}}
+% (reported by \contributor chsk <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/590265/improper-halign-inside-s-with-lmodern-microtype-fontspec
% \begin{macrocode}
\def\MT@set@inh@list#1#2{%
\MT@ifempty\MT@inh@feat{%
- \MT@map@clist@c\MT@features{{%
+ \MT@map@clist@c\MT@features{\begingroup
\MT@ifstreq{##1}{tr}\relax{\MT@declare@char@inh{##1}{#1}{#2}}%
- }}%
+ \endgroup}%
}{%
- \MT@map@clist@c\MT@inh@feat{{%
+ \MT@map@clist@c\MT@inh@feat{\begingroup
\KV@@sp@def\@tempa{##1}%
\MT@ifempty\@tempa\relax{%
\edef\@tempa{\csname MT@rbba@\@tempa\endcsname}%
\MT@ifstreq\@tempa{tr}\relax{%
\MT@exp@one@n\MT@declare@char@inh{\@tempa}{#1}{#2}}}%
- }}%
+ \endgroup}%
}%
\MT@end@catcodes
}
@@ -11290,32 +12770,74 @@ end
% in |\MT@set@|\meta{feature}|@codes|.
% \begin{macrocode}
%</package>
-%<*pdftex-def|xetex-def|luatex-def>
+%<*pdf-|lua-|xe->
\def\MT@inh@split#1=#2=#3\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty \else
+ \expandafter\MT@has@inh@prefix\@tempa()\relax\@nil
\MT@get@slot
-%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne
-%<xetex-def> \ifx\MT@char\@empty\else
+%<pdf-|lua-> \ifnum\MT@char > \m@ne
+%<xe-> \ifx\MT@char\@empty\else
\let\MT@val\MT@char
\MT@map@clist@n{#2}{%
\def\@tempa{##1}%
\ifx\@tempa\@empty \else
\MT@get@slot
-%<pdftex-def|luatex-def> \ifnum\MT@char > \m@ne
-%<xetex-def> \ifx\MT@char\@empty\else
- \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}%
+%<pdf-|lua-> \ifnum\MT@char > \m@ne
+%<xe-> \ifx\MT@char\@empty\else
+ \ifx\MT@inh@prefix\@empty
+ \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @\MT@val @}{{\MT@char}}%
+ \else
+ \MT@exp@cs\MT@xadd{MT@inh@\MT@listname @prefixes}%
+ {{{\MT@val}{\MT@char}\MT@inh@prefix@}}%
+ \fi
\fi
\fi
}%
%<debug>\MT@dinfo@nl{2}{children of #1 (\MT@val):
-%<debug> \@nameuse{MT@inh@\MT@listname @\MT@val @}}%
+%<debug> \@nameuse{MT@inh@\MT@listname @\ifx\MT@inh@prefix\@empty\MT@val @\else prefixes\fi}}%
\fi
\fi
}
-%</pdftex-def|xetex-def|luatex-def>
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\MT@inh@prefix}
+%\begin{macro}{\MT@has@inh@prefix}
+% If the inheriting character is preceded by |(|\meta{prefix}|)|, where
+% \meta{prefix} is one of |l|, |r| or |lr|, this has a special meaning
+% for protrusion. For the other features, we ignore these settings.
+%\changes{v3.0}{2021/03/27}{new: automatical protrusion based on char widths difference
+% (suggested by \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>)}
+% ^^A private mail, 2020/12/24
+% \begin{macrocode}
+\def\MT@has@inh@prefix#1(#2)#3#4\@nil{%
+ \let\MT@temp\relax
+ \ifx\relax#3%
+ \def\@tempa{#1#2}%
+ \let\MT@inh@prefix\@empty
+ \else
+ \MT@ifstreq{\MT@feat}{pr}{%
+ \MT@ifstreq{#2}{l}{\def\MT@inh@prefix@{{1000}{0}}\@firstoftwo}{%
+ \MT@ifstreq{#2}{r}{\def\MT@inh@prefix@{{0}{1000}}\@firstoftwo}{%
+ \MT@ifstreq{#2}{lr}{\def\MT@inh@prefix@{{500}{500}}\@firstoftwo}{%
+ \MT@warning@nl{`#2' is not a valid prefix in inheritance list%
+ \MessageBreak\MT@listname. Ignoring it}%
+ \@secondoftwo}}}%
+ {\def\@tempa{#3}%
+ \def\MT@inh@prefix{#2}%
+ \@gobble}%
+ {\@firstofone}%
+ }{\@firstofone}%
+ {\let\MT@char\m@ne
+ \let\MT@temp\@gobble
+ }%
+ \fi
+ \MT@temp
+}
+%</pdf-|lua-|xe->
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
%
%\subsubsection{Permutation}\label{ssub:permutation}
%
@@ -11727,7 +13249,7 @@ end
% ^^A (beta:1)
%\begin{macro}{\MT@def@bool@opt}
% The |true|/|false| options:
-% \opt{draft}, \opt{final} (may be inherited from the class options),
+% \opt{draft} (may be inherited from the class options),
% \opt{auto},
% \opt{selected},
% \opt{babel},
@@ -11760,21 +13282,21 @@ end
%\changes{v2.5}{2010/09/17}{disable `\opt{DVIoutput}' option for \xetex} ^^A (beta:03)
% \begin{macrocode}
%</package>
-%<*pdftex-def|luatex-def|xetex-def>
-%<luatex-def>\MT@requires@luatex4{\let\pdfoutput\outputmode}\relax
+%<*pdf-|lua-|xe->
+%<lua->\MT@requires@luatex4{\let\pdfoutput\outputmode}\relax
\MT@def@bool@opt{DVIoutput}{%
\csname if\@tempa\endcsname
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\ifnum\pdfoutput>\z@ \MT@opt@DVItrue \fi
\pdfoutput\z@
\else
\ifnum\pdfoutput<\@ne \MT@opt@DVItrue \fi
\pdfoutput\@ne
-%</pdftex-def|luatex-def>
-%<xetex-def> \MT@warning@nl{Ignoring `DVIoutput' option}%
+%</pdf-|lua->
+%<xe-> \MT@warning@nl{Ignoring `DVIoutput' option}%
\fi
}
-%</pdftex-def|luatex-def|xetex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\changes{v1.9a}{2005/11/21}{new option: \opt{defersetup}, by default true}
% Setting the \opt{defersetup} option to false will restore the old behaviour,
@@ -11805,8 +13327,8 @@ end
% out automatically whether it's required.
% It also works with \luatex\ 0.30 or newer.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex7{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex7{
\MT@def@bool@opt{copyfonts}{%
\csname if\@tempa\endcsname
\MT@glet\MT@copy@font\MT@copy@font@
@@ -11814,31 +13336,45 @@ end
\MT@glet\MT@copy@font\relax
\fi
}
-%<pdftex-def>}{
-%</pdftex-def|luatex-def>
-%<*pdftex-def|xetex-def>
+%<pdf->}{
+%</pdf-|lua->
+%<*pdf-|xe->
\MT@def@bool@opt{copyfonts}{%
\csname if\@tempa\endcsname
\MT@error
-%<pdftex-def> {The pdftex version you are using is too old\MessageBreak
-%<pdftex-def> to use the `copyfonts' option}{Upgrade pdftex.}%
-%<xetex-def> {The `copyfonts' option does not work with xetex}
-%<xetex-def> {Use pdftex or luatex instead.}%
+%<pdf-> {The pdftex version you are using is too old\MessageBreak
+%<pdf-> to use the `copyfonts' option}{Upgrade pdftex.}%
+%<xe-> {The `copyfonts' option does not work with xetex}
+%<xe-> {Use pdftex or luatex instead.}%
\fi
}
-%<pdftex-def>}
-%</pdftex-def|xetex-def>
+%<pdf->}
+%</pdf-|xe->
% \end{macrocode}
% \opt{final} is the opposite to \opt{draft}.
%\changes{v1.4a}{2004/11/16}{new option: \opt{final}}
+% It's only kept for backwards compatibility.
+%\changes{v3.0}{2021/08/13}{remove option \opt{final}}
% \begin{macrocode}
%<*package>
-\MT@def@bool@opt{final}{%
- \csname if\@tempa\endcsname
- \MT@draftfalse
- \else
- \MT@drafttrue
- \fi
+\MT@def@bool@opt{final}{}
+% \end{macrocode}
+% The \opt{disable} option replaces the \opt{draft} option,
+% which could be inherited from the class options.
+% The third value |ifdraft| mimicks this behaviour.
+%\changes{v3.0}{2021/08/13}{new option: \opt{disable}, replacing the \texttt{draft} option
+% (suggested by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>)}
+% ^^A private mail, 2018/07/04
+% \begin{macrocode}
+\define@key{MT}{disable}[true]{%
+ \def\@tempa{#1}%
+ \MT@ifstreq\@tempa{true}\MT@disabletrue{%
+ \MT@ifstreq\@tempa{ifdraft}{\ifMT@draft\MT@disabletrue\fi}{%
+ \MT@ifstreq\@tempa{false}\relax{%
+ \MT@optwarn@admissible{#1}{disable}%
+ }%
+ }%
+ }%
}
% \end{macrocode}
% For \opt{verbose} output, we redefine \cs{MT@vinfo}.
@@ -11932,6 +13468,55 @@ end
}%
}
% \end{macrocode}
+%\changes{v3.0}{2021/05/22}{new options: \opt{patch} and \opt{nopatch}}
+%\begin{macro}{\MT@patches@list}
+%\begin{macro}{\MT@nopatches@list}
+% The \opt{patch} and \opt{nopatch} options.
+% Remember chosen option for later (\cmd\relax\ means `all',
+% \cmd\@empty\ means `none').
+% \begin{macrocode}
+\let\MT@patches@list\relax
+\let\MT@nopatches@list\@empty
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+% \begin{macrocode}
+\define@key{MT}{patch}[all]{%
+ \def\@tempa{#1}%
+ \MT@ifstreq\@tempa{all}
+ \relax
+ {\MT@ifstreq\@tempa{none}
+ {\let\MT@patches@list\@empty}
+ {\def\MT@patches@list{#1}}}%
+}
+\define@key{MT}{nopatch}[all]{%
+ \def\@tempa{#1}%
+ \MT@ifstreq\@tempa{all}
+ {\let\MT@nopatches@list\relax}
+ {\MT@ifstreq\@tempa{none}
+ \relax
+ {\def\MT@nopatches@list{#1}}}%
+}
+% \end{macrocode}
+% We can only apply the patches AtBeginDocument.
+% \begin{macrocode}
+\MT@addto@setup{%
+ \ifx\MT@patches@list\relax
+ \let\MT@patches@list\MT@patches@def
+ \fi
+ \ifx\MT@nopatches@list\@empty\else
+ \ifx\MT@nopatches@list\relax
+ \let\MT@nopatches@list\MT@patches@def
+ \fi
+ \MT@map@clist@c\MT@nopatches@list{%
+ \MT@rem@from@clist{#1}\MT@patches@list}%
+ \fi
+ \ifx\MT@patches@list\@empty\else
+^^X \MT@map@clist@c\MT@patches@list{\MT@apply@patch{#1}}%
+^^Q \MT@warning@nl{Patches require the etex extensions. Ignoring them}%
+ \fi
+}
+% \end{macrocode}
%
%\subsubsection{Loading the definition file}
%
@@ -11967,20 +13552,20 @@ end
% \begin{macrocode}
\MT@protrusiontrue
%</package>
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\ifnum\pdfoutput<\@ne \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}
% \begin{macrocode}
-%<pdftex-def> \MT@requires@pdftex4{
+%<pdf-> \MT@requires@pdftex4{
\MT@expansiontrue
-%<pdftex-def> \MT@autotrue
-%<pdftex-def> }\relax
+%<pdf-> \MT@autotrue
+%<pdf-> }\relax
\fi
-%<luatex-def>\MT@autotrue
-%</pdftex-def|luatex-def>
+%<lua->\MT@autotrue
+%</pdf-|lua->
% \end{macrocode}
% The main configuration file will be loaded before processing the package
% options.
@@ -12052,7 +13637,7 @@ end
%
%\subsubsection{Hook for other packages}\label{sub:hook}
%
-% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar usage}}
+% {\let\special@index\index\SpecialIndex@{\Microtype@Hook}{\encapchar hyperpage}}
%\begin{macro}{\Microtype@Hook}
%\changes{v1.7}{2005/03/22}{new command for font package authors}
% This hook may be used by font package authors, \eg, to declare alias fonts. If
@@ -12079,13 +13664,13 @@ end
% {\let\Microtype@Hook\MinionPro@MT@Hook}
% {\g@addto@macro\Microtype@Hook{\MinionPro@MT@Hook}}}
%\end{verbatim}
-% \cs{MicroType@Hook} with a capital |T| (which only existed in version 1.7) is
-% provided for compatibility reasons. At some point in the future, it will no
-% longer be available, hence it should not be used.
+% \orig@cs{MicroType@Hook} with a capital |T| (which only existed in version 1.7)
+% is now officially deprecated.
% \begin{macrocode}
-\MT@ifdefined@c@T\MicroType@Hook{\MT@warning{%
+\MT@ifdefined@c@T\MicroType@Hook{\MT@error{%
Command \string\MicroType@Hook\space is deprecated.\MessageBreak
- Use \string\Microtype@Hook\space instead}\MicroType@Hook}
+ Use \string\Microtype@Hook\space instead}
+ {You might want to inform the font package authors.}\MicroType@Hook}
\MT@ifdefined@c@T\Microtype@Hook\Microtype@Hook
% \end{macrocode}
%\end{macro}
@@ -12102,13 +13687,13 @@ end
% Inside the preamble, \cs{microtypesetup} accepts the same options as the
% package (unless \opt{defersetup}|=false|).
% In the document body, it accepts the options:
-% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning|.
-% Specifying font sets is not allowed.
+% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning|
+% (but specifying font sets is not allowed), and |patch| and |nopatch|.
% \begin{macrocode}
\def\microtypesetup{\setkeys{MT}}
\MT@addto@setup{\def\microtypesetup#1{\setkeys{MTX}{#1}\selectfont}}
%</package>
-%<*pdftex-def|luatex-def|xetex-def>
+%<*pdf-|lua-|xe->
\def\MT@define@optionX#1#2{%
\define@key{MTX}{#1}[true]{%
\edef\@tempb{\csname MT@rbba@#1\endcsname}%
@@ -12178,26 +13763,26 @@ end
%\end{macro}
% \begin{macrocode}
\MT@define@optionX{protrusion}\MT@protrudechars
-%</pdftex-def|luatex-def|xetex-def>
-%<*pdftex-def|luatex-def>
+%</pdf-|lua-|xe->
+%<*pdf-|lua->
\MT@define@optionX{expansion}\MT@adjustspacing
% \end{macrocode}
%\begin{macro}{\MT@protrudechars}
%\begin{macro}{\MT@adjustspacing}
% \begin{macrocode}
-%<*luatex-def>
+%<*lua->
\MT@requires@luatex4{
\let\pdfprotrudechars\protrudechars
\let\pdfadjustspacing\adjustspacing
}\relax
-%</luatex-def>
+%</lua->
\let\MT@protrudechars\pdfprotrudechars
\let\MT@adjustspacing\pdfadjustspacing
-%</pdftex-def|luatex-def>
-%<*xetex-def>
+%</pdf-|lua->
+%<*xe->
\let\MT@protrudechars\XeTeXprotrudechars
\define@key{MTX}{expansion}[true]{\MT@warning{Ignoring expansion setup}}
-%</xetex-def>
+%</xe->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -12205,9 +13790,9 @@ end
% The same for |tracking|, |spacing| and |kerning|, which do not have a
% |compatibility| level.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex6{
-%<luatex-def>\MT@requires@luatex3{
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex6{
+%<lua->\MT@requires@luatex3{
\def\MT@define@optionX@#1#2{%
\define@key{MTX}{#1}[true]{%
\MT@map@clist@n{##1}{%
@@ -12241,45 +13826,71 @@ end
% \begin{macrocode}
\MT@define@optionX@{tracking}{\ifnum\@tempcnta=\z@ \let\MT@tracking\MT@set@tr@zero
\else \let\MT@tracking\MT@tracking@ \fi}
-%<pdftex-def> \MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta}
-%<pdftex-def> \MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta
-%<pdftex-def> \pdfappendkern\@tempcnta}
+%<pdf-> \MT@define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta}
+%<pdf-> \MT@define@optionX@{kerning}{\pdfprependkern\@tempcnta
+%<pdf-> \pdfappendkern\@tempcnta}
}{
-%</pdftex-def|luatex-def>
-%<*pdftex-def|luatex-def|xetex-def>
+%</pdf-|lua->
+%<*pdf-|lua-|xe->
% \end{macrocode}
% Disable for older \pdftex\ versions and for \xetex\ and \luatex.
% \begin{macrocode}
\define@key{MTX}{tracking}[true]{\MT@warning{Ignoring tracking setup}}
-%<luatex-def>}
+%<lua->}
\define@key{MTX}{kerning}[true]{\MT@warning{Ignoring kerning setup}}
\define@key{MTX}{spacing}[true]{\MT@warning{Ignoring spacing setup}}
-%<pdftex-def>}
+%<pdf->}
\define@key{MTX}{activate}[true]{%
\setkeys{MTX}{protrusion={#1}}%
-%<pdftex-def|luatex-def> \setkeys{MTX}{expansion={#1}}%
+%<pdf-|lua-> \setkeys{MTX}{expansion={#1}}%
}
-%</pdftex-def|luatex-def|xetex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\begin{macro}{\MT@saved@setupfont}
% Disable everything -- may be used as a temporary work-around in case
% setting up fonts doesn't work under certain circumstances, but only until
-% that specific problem is fixed. This is \emph{undocumented}, as it completely
-% deprives us of the possibility to act -- we're blind and paralysed.
+% that specific problem is fixed. These options are \emph{undocumented}, as they
+% completely deprive us of the possibility to act -- we're blind and paralysed.
% \begin{macrocode}
%<*package>
\let\MT@saved@setupfont\MT@setupfont
% \end{macrocode}
%\end{macro}
% \begin{macrocode}
-\define@key{MTX}{disable}[]{%
- \MT@info{Inactivate `\MT@MT' package}%
+\define@key{MTX}{deactivate}[]{%
+ \MT@info{Deactivate `\MT@MT' package}%
\let\MT@setupfont\relax
}
-\define@key{MTX}{enable}[]{%
+\define@key{MTX}{reactivate}[]{%
\MT@info{Reactivate `\MT@MT' package}%
\let\MT@setupfont\MT@saved@setupfont
}
+% \end{macrocode}
+% Apply or revert patches.
+% \begin{macrocode}
+\define@key{MTX}{patch}[all]{%
+ \def\@tempa{#1}%
+ \MT@ifstreq\@tempa{all}
+ \relax
+ {\MT@ifstreq\@tempa{none}
+ {\let\@tempa\@empty}
+ \relax}%
+ \ifx\@tempa\@empty\else
+^^X \MT@map@clist@c\@tempa{\MT@apply@patch{##1}}%
+^^Q \MT@warning@nl{Patches require the etex extensions. Ignoring them}%
+ \fi
+}
+\define@key{MTX}{nopatch}[all]{%
+ \def\@tempa{#1}%
+ \MT@ifstreq\@tempa{all}
+ \relax
+ {\MT@ifstreq\@tempa{none}
+ {\let\@tempa\@empty}
+ \relax}%
+ \ifx\@tempa\@empty\else
+^^X \MT@map@clist@c\@tempa{\MT@undo@patch{##1}}%
+ \fi
+}
%</package>
% \end{macrocode}
%
@@ -12333,13 +13944,13 @@ end
% options the user has chosen (in case it's interested).
% \begin{macrocode}
\MT@addto@setup{%
-\ifMT@draft
+\ifMT@disable
% \end{macrocode}
% We disable most of what we've just defined in the \arabic{CodelineNo} lines
-% above if we are running in draft mode.
+% above if we are running in disable (aka. draft) mode.
%\changes{v1.7}{2005/02/06}{warning when running in draft mode}
% \begin{macrocode}
- \MT@warning@nl{`draft' option active.\MessageBreak
+ \MT@warning@nl{The `disable' option is in effect.\MessageBreak
Disabling all micro-typographic extensions.\MessageBreak
This might lead to different line and page breaks}%
\let\MT@setupfont\relax
@@ -12377,7 +13988,7 @@ end
% for each package (that's not our job), we only say that it was \microtype\
% that changed it. This must be sufficient!
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@setup@PDF{%
\MT@info@nl{Generating \ifnum\pdfoutput<\@ne DVI \else PDF \fi output%
\ifMT@opt@DVI\space (changed by \MT@MT)\fi}%
@@ -12390,17 +14001,17 @@ end
\def\MT@setup@copies{%
\ifx\MT@copy@font\relax\else \MT@info@nl{Using font copies for contexts}\fi
}
-%</pdftex-def|luatex-def>
-%<*xetex-def>
+%</pdf-|lua->
+%<*xe->
\let\MT@setup@PDF\relax
\let\MT@setup@copies\relax
-%</xetex-def>
+%</xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@protrusion}
% Protrusion.
% \begin{macrocode}
-%<*pdftex-def|xetex-def|luatex-def>
+%<*pdf-|lua-|xe->
\def\MT@setup@protrusion{%
\ifMT@protrusion
\edef\MT@active@features{\MT@active@features,pr}%
@@ -12415,7 +14026,7 @@ end
\MT@info@nl{No character protrusion}%
\fi
}
-%</pdftex-def|xetex-def|luatex-def>
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@expansion}
@@ -12430,11 +14041,11 @@ end
% (reported by \contributor Daniel Benjamin Miller <dbmiller\at dbmiller.org>)} ^^A aka `d909'
% ^^A https://tex.stackexchange.com/questions/531413/dvipdfmx-and-dvips-do-not-expand-fonts-properly-with-lualatex-in-dvi-mode
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@setup@expansion{%
\ifnum\pdfoutput<\@ne
\ifMT@opt@expansion
-%<*luatex-def>
+%<*lua->
\ifMT@expansion
\MT@requires@luatex3{%
\MT@warning@nl{Font expansion doesn't work properly with luatex in\MessageBreak
@@ -12444,7 +14055,7 @@ end
%\MT@expansionfalse
}\relax
\fi
-%</luatex-def>
+%</lua->
\else
\MT@expansionfalse
\fi
@@ -12476,9 +14087,9 @@ end
%\changes{v1.9}{2005/07/08}{warning if user requested zero \opt{step}}
% \begin{macrocode}
\ifnum\MT@step=\m@ne
-%<pdftex-def> \MT@requires@pdftex6{%
+%<pdf-> \MT@requires@pdftex6{%
\def\MT@step{1 }%
-%<*pdftex-def>
+%<*pdf->
}{%
\ifnum\MT@stretch>\MT@shrink
\ifnum\MT@shrink=\z@
@@ -12497,7 +14108,7 @@ end
\ifnum\@tempcnta=\z@ \@tempcnta=\@ne \fi
\edef\MT@step{\number\@tempcnta\space}%
}%
-%</pdftex-def>
+%</pdf->
\fi
\ifnum\MT@step=\z@
\MT@warning@nl{The expansion step cannot be set to zero.\MessageBreak
@@ -12529,7 +14140,7 @@ end
%\changes{v1.5}{2004/12/02}{disable automatic expansion for <DVI> output}
%\changes{v2.7}{2017/07/02}{don't disable automatic expansion for <DVI> output with \luatex}
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\MT@requires@pdftex4{%
\ifnum\pdfoutput<\@ne
\ifMT@opt@auto
@@ -12560,18 +14171,18 @@ end
\MT@autofalse
\def\MT@auto{1000 }%
}%
-%</pdftex-def>
-%<luatex-def> \MT@requires@luatex3\relax{\def\MT@auto{autoexpand}}%
+%</pdf->
+%<lua-> \MT@requires@luatex3\relax{\def\MT@auto{autoexpand}}%
\else
-%<*pdftex-def>
+%<*pdf->
% \end{macrocode}
% No automatic expansion.
% \begin{macrocode}
\MT@requires@pdftex4\relax{%
\def\MT@auto{1000 }%
}%
-%</pdftex-def>
-%<*luatex-def>
+%</pdf->
+%<*lua->
\MT@requires@luatex3{%
\ifMT@opt@auto
\MT@error{Non-automatic font expansion does not work with\MessageBreak
@@ -12579,7 +14190,7 @@ end
\MT@autotrue
\fi
}\relax
-%</luatex-def>
+%</lua->
\fi
% \end{macrocode}
% Choose the appropriate macro for selected expansion.
@@ -12668,8 +14279,8 @@ end
\MT@info@nl{No font expansion}%
\fi
}
-%</pdftex-def|luatex-def>
-%<*xetex-def>
+%</pdf-|lua->
+%<*xe->
\def\MT@setup@expansion{%
\ifMT@expansion
\ifMT@opt@expansion
@@ -12678,15 +14289,15 @@ end
\fi
\fi
}
-%</xetex-def>
+%</xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@tracking}
% Tracking, spacing and kerning.
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
-%<pdftex-def>\MT@requires@pdftex6{%
-%<luatex-def>\MT@requires@luatex3{%
+%<*pdf-|lua->
+%<pdf->\MT@requires@pdftex6{%
+%<lua->\MT@requires@luatex3{%
\def\MT@setup@tracking{%
\ifMT@tracking
\edef\MT@active@features{\MT@active@features,tr}%
@@ -12702,12 +14313,12 @@ end
\MT@info@nl{No adjustment of tracking}%
\fi
}
-%</pdftex-def|luatex-def>
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@spacing}
% \begin{macrocode}
-%<*pdftex-def>
+%<*pdf->
\def\MT@setup@spacing{%
\ifMT@spacing
\edef\MT@active@features{\MT@active@features,sp}%
@@ -12775,7 +14386,7 @@ end
\MT@info@nl{No adjustment of character kerning}%
\fi
}
-%</pdftex-def>
+%</pdf->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@error@doesnt@work}
@@ -12784,8 +14395,8 @@ end
% and throw an error message.
% We also switch the features off for \luatex\ and \xetex.
% \begin{macrocode}
-%<pdftex-def|luatex-def>}{
-%<*luatex-def>
+%<pdf-|lua->}{
+%<*lua->
\def\MT@setup@tracking{%
\ifMT@tracking
\MT@error{The tracking feature only works with luatex 0.62\MessageBreak
@@ -12797,33 +14408,33 @@ end
\fi
}
}
-%</luatex-def>
-%<*pdftex-def|xetex-def|luatex-def>
+%</lua->
+%<*pdf-|lua-|xe->
\def\MT@error@doesnt@work#1{%
\csname ifMT@#1\endcsname
\MT@error{The #1 feature only works with pdftex 1.40\MessageBreak
or newer. Switching it off}
-%<pdftex-def> {Upgrade pdftex.}%
-%<luatex-def|xetex-def> {Use pdftex instead.}%
+%<pdf-> {Upgrade pdftex.}%
+%<lua-|xe-> {Use pdftex instead.}%
\csname MT@#1false\endcsname
\MT@let@nc{MT@#1}\relax
\else
\MT@info@nl{No adjustment of #1%
-%<pdftex-def> \space(pdftex too old)%
+%<pdf-> \space(pdftex too old)%
}%
\fi
}
-%<pdftex-def|xetex-def> \def\MT@setup@tracking{\MT@error@doesnt@work{tracking}}
+%<pdf-|xe-> \def\MT@setup@tracking{\MT@error@doesnt@work{tracking}}
\def\MT@setup@kerning {\MT@error@doesnt@work{kerning}}
\def\MT@setup@spacing {\MT@error@doesnt@work{spacing}}
-%<pdftex-def>}
-%</pdftex-def|xetex-def|luatex-def>
+%<pdf->}
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@warntracking}
% \begin{macrocode}
%<letterspace>\MT@addto@setup
-%<pdftex-def|luatex-def>\def\MT@setup@warntracking
+%<pdf-|lua->\def\MT@setup@warntracking
% \end{macrocode}
%\begin{macro}{\MT@warn@tracking@DVI}
%\changes{v2.2}{2007/02/11}{warning when letterspacing in <DVI> mode}
@@ -12832,9 +14443,9 @@ end
% not work. We also switch on protrusion if it isn't already, to compensate for
% the letterspacing kerns.
% \begin{macrocode}
-%<*pdftex-def|luatex-def|letterspace>
+%<*pdf-|lua-|letterspace>
{%
-%<*pdftex-def|letterspace>
+%<*pdf-|letterspace>
\ifnum\pdfoutput<\@ne
\def\MT@warn@tracking@DVI{%
%<letterspace> \MT@pdf@or@lua{%
@@ -12847,12 +14458,12 @@ end
\MT@glet\MT@warn@tracking@DVI\relax
}%
\else
-%</pdftex-def|letterspace>
+%</pdf-|letterspace>
\def\MT@warn@tracking@DVI{%
\ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
\MT@glet\MT@warn@tracking@DVI\relax
}%
-%<pdftex-def|letterspace> \fi
+%<pdf-|letterspace> \fi
% \end{macrocode}
%\end{macro}
% \begin{macrocode}
@@ -12862,8 +14473,8 @@ end
\MT@ls@too@large\MT@letterspace
\fi
}
-%</pdftex-def|luatex-def|letterspace>
-%<xetex-def>\let\MT@setup@warntracking\relax
+%</pdf-|lua-|letterspace>
+%<xe->\let\MT@setup@warntracking\relax
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT@setup@noligatures}
@@ -12871,16 +14482,16 @@ end
% now disable the corresponding macro, if it was never called.
%\changes{v2.0}{2006/12/14}{maybe disable \cs{MT@noligatures} after the preamble}
% \begin{macrocode}
-%<*pdftex-def|luatex-def>
+%<*pdf-|lua->
\def\MT@setup@noligatures{%
-%<pdftex-def> \MT@requires@pdftex5{%
+%<pdf-> \MT@requires@pdftex5{%
\ifMT@noligatures \else
\let\MT@noligatures\relax
\fi
-%<pdftex-def> }\relax
+%<pdf-> }\relax
}
-%</pdftex-def|luatex-def>
-%<xetex-def>\let\MT@setup@noligatures\relax
+%</pdf-|lua->
+%<xe->\let\MT@setup@noligatures\relax
% \end{macrocode}
%\end{macro}
% Remove the leading comma in \cs{MT@active@features}, and set the
@@ -12977,7 +14588,7 @@ end
\fi
}
% \end{macrocode}
-% Now we close the \cs{fi} from \cs{ifMT@draft}.
+% Now we close the \orig@cs{fi} from \cs{ifMT@disable}.
% \begin{macrocode}
\MT@addto@setup{\fi
% \end{macrocode}
@@ -13126,7 +14737,9 @@ end
% \end{macrocode}
% The default sets.
%\changes{v2.2}{2007/04/15}{default set for tracking: \texttt{smallcaps}}
-%\changes{v2.8}{2019/12/04}{default set for expansion: \texttt{alltext-nott}}
+%\changes{v2.8}{2019/12/04}{default set for expansion: \texttt{alltext-nott}
+% (suggested by \contributor Aman Mehra <reportaman\at gmail.com>)}
+% ^^A https://tex.stackexchange.com/questions/519166/microtype-expansion-gets-disabled-when-fontsize-is-changed-lualatex
%\changes{v2.8}{2019/12/04}{default set for spacing: \texttt{alltext-nott}}
% \begin{macrocode}
%%% -----------------------------------------------------------------------
@@ -13218,10 +14831,10 @@ end
%\changes{v2.8a}{2021/01/09}{reference New Computer Modern also by file name
% (reported by \contributor Canageek <@\at @>)}
% ^^A https://tex.stackexchange.com/questions/578121/how-do-i-properly-tell-microtype-that-newcomputermodern-is-the-same-as-comput
+%\changes{v3.0}{2021/08/08}{New Computer Modern has its own settings}
% \begin{macrocode}
-\DeclareMicrotypeAlias{New Computer Modern}{Latin Modern Roman}
-\DeclareMicrotypeAlias{NewCM10-Book.otf} {Latin Modern Roman}
-\DeclareMicrotypeAlias{NewCM10-Regular.otf}{Latin Modern Roman}
+\DeclareMicrotypeAlias{NewCM10-Book.otf} {New Computer Modern}
+\DeclareMicrotypeAlias{NewCM10-Regular.otf}{New Computer Modern}
% \end{macrocode}
% The packages \pkg{pxfonts} and \pkg{txfonts} fonts inherit Palatino and Times
% settings respectively,
@@ -13359,6 +14972,29 @@ end
% \begin{macrocode}
\DeclareMicrotypeAlias{zpeus} {zpeu} % Adobe Euro sans -> serif
\DeclareMicrotypeAlias{eurosans}{zpeu} % Adobe Euro sans -> serif
+% \end{macrocode}
+% The Lato and Fontin fonts (and many, many more\dots) only contain a
+% basic set of glyphs. We alias them here to the basic settings
+% (see \ref{subsub:OT-inh-basic}) to prevent lots of warning
+% messages from the inheritance settings; they will still receive
+% protrusion settings from the default (<T1>) configuration.
+%\changes{v3.0}{2021/06/22}{declare \texttt{basic} aliases for the Fontin font}
+%\changes{v3.0}{2021/06/25}{declare \texttt{basic} alias for Bergamo Std}
+% \begin{macrocode}
+\DeclareMicrotypeAlias{Lato} {TU-basic}
+\DeclareMicrotypeAlias{Lato-Regular} {TU-basic}
+\DeclareMicrotypeAlias{Fontin} {TU-basic}
+\DeclareMicrotypeAlias{Fontin-Regular} {TU-basic}
+\DeclareMicrotypeAlias{Bergamo Std} {TU-basic}
+% \end{macrocode}
+% The \pkg{fontawesome} and \pkg{fontawesome5} packages are aliased
+% to empty settings (see \ref{subsub:OT-inh-empty} and \ref{subsub:OT-prot-empty}).
+%\changes{v3.0}{2021/03/15}{declare \texttt{empty} aliases for \pkg{fontawesome5}}
+% \begin{macrocode}
+\DeclareMicrotypeAlias{FontAwesome} {TU-empty} % fontawesome
+\DeclareMicrotypeAlias{fontawesomefree} {TU-empty} % fontawesome5
+\DeclareMicrotypeAlias{fontawesomepro} {TU-empty}
+\DeclareMicrotypeAlias{fontawesomebrands}{TU-empty}
% \end{macrocode}
%
@@ -13429,11 +15065,11 @@ end
% that are the same on \emph{both} sides, \ie, not \OE\ for O.
% \begin{macrocode}
%</m-t>
-%<*m-t|zpeu|mvs>
+%<*m-t|ebg|zpeu|mvs>
%%% -----------------------------------------------------------------------
%%% CHARACTER INHERITANCE
-%</m-t|zpeu|mvs>
+%</m-t|ebg|zpeu|mvs>
%<*m-t>
% \end{macrocode}
%
@@ -13718,6 +15354,45 @@ end
%</m-t>
% \end{macrocode}
+%\subsubsection{<LGR>}
+%\changes{v3.0}{2021/06/24}{add settings for <LGR>}
+% The Greek <LGR> encoding. <EB> Garamond contains some more glyphs.
+% \begin{macrocode}
+%<*m-t|ebg>
+\DeclareCharacterInheritance
+ { encoding = LGR,
+%<ebg> family = {EBGaramond-OsF,EBGaramond-TOsF,EBGaramond-LF,EBGaramond-TLF}
+ }
+ {
+%<m-t> A = {012},
+%<ebg> A = {009,012,253},
+%<ebg> (l)E = {199},
+%<ebg> H = {010},
+%<ebg> (l)H = {159},
+ I = {219},
+%<ebg> (l)I = {155},
+ O = J,
+%<ebg> (l)O = {151},
+ U = {013,223},
+ W = {011},
+ a = {014,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+ 144,145,146,148,149,150,248},
+ e = {224,225,226,227,232,233,234,235},
+ h = {152,153,154,156,157,158,160,161,162,163,164,165,166,167,168,169,170,
+ 171,172,173,174,175,249},
+%<m-t> i = {200,201,202,203,208,209,210,211,216,217,218,240,241,242,243},
+%<ebg> i = {008,200,201,202,203,208,209,210,211,216,217,218,240,241,242,243},
+ o = {228,229,230,231,236,237,238,239},
+ r = {251,252},
+ u = {015,204,205,206,207,212,213,214,215,220,221,222,244,245,246,247},
+ w = {176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,
+ 193,194,196,197,198,250},
+%<ebg> \textstigma = \textvarstigma,
+ . = {059} % ano teleia
+ }
+
+%</m-t|ebg>
+% \end{macrocode}
%
%\subsubsection{Euro symbols}
% Make Euro symbols settings simpler.
@@ -14013,12 +15688,11 @@ end
%\end{itemize}
% \begin{macrocode}
%<ugm> [ name = ugm-default ]
-%<m-t|cmr|pmn> { }
-%<bch|blg|ebg|ugm> { encoding = OT1,
+%<m-t|cmr|pmn|ebg> { }
+%<bch|blg|ugm> { encoding = OT1,
%<ppl|ptm> { encoding = {OT1,OT4},
%<bch> family = bch }
%<blg> family = blg }
-%<ebg> family = {EBGaramond-LF,EBGaramond-OsF,EBGaramond-TLF,EBGaramond-TOsF} }
%<ppl> family = {ppl,pplx,pplj} }
%<ptm> family = {ptm,ptmx,ptmj} }
%<ugm> family = ugm }
@@ -14053,10 +15727,10 @@ end
%<bch|ebg|pmn> Q = {50,70},
%<ugm> Q = {50,50},
%<bch> R = { ,50},
-%<ugm> R = { ,70},
-%<m-t|bch|cmr|ebg|pmn|ppl|ptm> T = {50,50},
+%<ugm|ebg> R = { ,70},
+%<m-t|bch|cmr|pmn|ppl|ptm> T = {50,50},
%<blg> T = {100,100},
-%<ugm> T = {70,70},
+%<ebg|ugm> T = {70,70},
%<m-t|bch|cmr|ebg|pmn|ppl|ptm> V = {50,50},
%<blg|ugm> V = {70,70},
%<m-t|bch|cmr|ebg|pmn|ppl|ptm> W = {50,50},
@@ -14073,8 +15747,8 @@ end
%<ugm> k = { ,70},
%<blg> l = {150,150},
%<pmn> l = { ,-50},
-%<ebg|ppl> p = {50,50},
-%<ugm> p = { ,50},
+%<ppl> p = {50,50},
+%<ebg|ugm> p = { ,50},
%<ebg|ppl> q = {50, },
%<!blg> r = { ,50},
%<blg> r = {100, 80},
@@ -14100,41 +15774,39 @@ end
% \begin{macrocode}
%<cmr> 0 = { ,50},
%<m-t> 1 = {50,50},
-%<bch|blg|ebg|ptm|ugm> 1 = {150,150},
+%<bch|blg|ptm|ugm> 1 = {150,150},
%<cmr> 1 = {100,200},
%<pmn> 1 = { ,50},
%<ppl> 1 = {100,100},
-%<bch|cmr|ebg|ugm> 2 = {50,50},
+%<bch|cmr|ugm> 2 = {50,50},
%<blg> 2 = { ,100},
%<bch|pmn> 3 = {50, },
-%<cmr|ebg|ugm> 3 = {50,50},
+%<cmr|ugm> 3 = {50,50},
%<blg> 3 = {100, },
-%<m-t|ebg> 4 = {50,50},
+%<m-t> 4 = {50,50},
%<bch> 4 = {100,50},
%<blg> 4 = {100, },
%<cmr|ugm> 4 = {70,70},
%<pmn> 4 = {50, },
%<ptm> 4 = {70, },
%<cmr> 5 = { ,50},
-%<ebg> 5 = {50,50},
%<bch> 6 = {50, },
%<cmr> 6 = { ,50},
-%<ebg> 6 = {50,50},
%<m-t> 7 = {50,50},
-%<bch|ebg|pmn|ugm> 7 = {50,80},
+%<bch|pmn|ugm> 7 = {50,80},
%<blg> 7 = {100,100},
%<cmr|ptm> 7 = {50,100},
%<ppl> 7 = { ,50},
%<cmr> 8 = { ,50},
-%<bch|ebg> 9 = {50,50},
+%<bch> 9 = {50,50},
%<cmr> 9 = { ,50},
-%<m-t|cmr|ebg|pmn|ppl|ptm|ugm> . = { ,700},
-%<bch> . = { ,600},
+%<m-t|cmr|pmn|ppl|ptm|ugm> . = { ,700},
+%<bch|ebg> . = { ,600},
%<blg> . = {400,500},
%<!blg> {,}= { ,500},
%<blg> {,}= {300,400},
-%<m-t|cmr|ebg|pmn|ppl|ptm|ugm> : = { ,500},
-%<bch> : = { ,400},
+%<m-t|cmr|pmn|ppl|ptm|ugm> : = { ,500},
+%<bch|ebg> : = { ,400},
%<blg> : = {300,400},
%<m-t|bch|ebg|pmn|ptm> ; = { ,300},
%<blg> ; = {200,300},
@@ -14161,9 +15833,8 @@ end
%<bch|pmn> * = {200,300},
%<blg> * = {150,200},
%<cmr|ebg> * = {300,300},
-%<m-t|cmr|ppl|ptm> + = {250,250},
+%<m-t|cmr|ebg|ppl|ptm> + = {250,250},
%<bch> + = {150,250},
-%<ebg> + = {300,300},
%<blg|pmn> + = {150,200},
%<ugm> + = {250,300},
%<blg|ugm> {=}= {200,200},
@@ -14203,13 +15874,14 @@ end
%<m-t|bch|pmn> \textquoteleft = {300,400}, \textquoteright = {300,400},
%<blg> \textquoteleft = {400,600}, \textquoteright = {400,600},
%<cmr> \textquoteleft = {500,700}, \textquoteright = {500,600},
-%<ebg|ppl> \textquoteleft = {500,700}, \textquoteright = {500,700},
+%<ebg> \textquoteleft = {300,500}, \textquoteright = {400,400},
+%<ppl> \textquoteleft = {500,700}, \textquoteright = {500,700},
%<ptm> \textquoteleft = {500,500}, \textquoteright = {300,500},
%<ugm> \textquoteleft = {300,600}, \textquoteright = {300,600},
-%<m-t|bch|pmn> \textquotedblleft = {300,300}, \textquotedblright = {300,300}
+%<m-t|ebg|bch|pmn> \textquotedblleft = {300,300}, \textquotedblright = {300,300}
%<blg> \textquotedblright = {300,400}
%<cmr> \textquotedblleft = {500,300}, \textquotedblright = {200,600}
-%<ebg|ppl|ptm> \textquotedblleft = {300,400}, \textquotedblright = {300,400}
+%<ppl|ptm> \textquotedblleft = {300,400}, \textquotedblright = {300,400}
%<ugm> \textquotedblleft = {400,400}, \textquotedblright = {400,400}
}
@@ -14217,43 +15889,82 @@ end
% Greek uppercase letters are in <OT1> encoding only.
%\changes{v1.9}{2005/07/10}{fix: remove uppercase Greek letters from <T1> encoded <CMR>}
% \begin{macrocode}
-%<*m-t|cmr|pmn>
+%<*m-t|cmr|ebg|pmn>
\SetProtrusion
%<m-t> [ name = OT1-default,
%<cmr> [ name = cmr-OT1,
+%<ebg> [ name = EBGaramond-OT1,
%<pmn> [ name = pmnj-OT1,
%<m-t> load = default ]
%<cmr> load = cmr-default ]
+%<ebg> load = EBGaramond-default ]
%<pmn> load = pmnj-default ]
%<m-t> { encoding = OT1 }
%<cmr> { encoding = {OT1,OT4},
%<pmn> { encoding = OT1,
%<cmr> family = cmr }
%<pmn> family = pmnj }
+%<ebg> { }
{
%<m-t|cmr> \AE = {50, },
%<pmn> \OE = {50, }
-%<*cmr>
+%<*cmr|ebg>
"00 = { ,150}, % \Gamma
"01 = {100,100}, % \Delta
"02 = { 50, 50}, % \Theta
"03 = {100,100}, % \Lambda
- "06 = { 50, 50}, % \Sigma
+%<ebg> "04 = { 50, 50}, % \Xi
+%<cmr> "06 = { 50, 50}, % \Sigma
"07 = {100,100}, % \Upsilon
"08 = { 50, 50}, % \Phi
- "09 = { 50, 50} % \Psi
+ "09 = { 50, 50}, % \Psi
+%<ebg> "0A = { 50, 50}, % \Omega
+%<ebg> 138 = { , 50}, % \L
% \end{macrocode}
% Remaining slots can be found in the source file.
%\iffalse ^^A ... namely, here:
-% "04 = { , }, % \Xi
% "05 = { , }, % \Pi
-% "0A = { , }, % \Omega
%\fi
% \begin{macrocode}
-%</cmr>
+%</cmr|ebg>
}
-%</m-t|cmr|pmn>
+% \end{macrocode}
+% Settings for figure variants.
+%\changes{v3.0}{2021/06/10}{settings for <EB> Garamond figure variants}
+% \begin{macrocode}
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-OT1-LF,
+ load = EBGaramond-OT1 ]
+ { encoding = OT1,
+ family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 4 = {50,50},
+ 7 = {50,50},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-OT1-TOsF,
+ load = EBGaramond-OT1 ]
+ { encoding = OT1,
+ family = {EBGaramond-TOsF} }
+ {
+ 1 = {150,150},
+ 2 = {50,50},
+ 3 = {50,50},
+ 4 = {50,50},
+ 5 = {50,50},
+ 6 = {50,50},
+ 7 = {50,80},
+ 8 = {50,50},
+ 9 = {50,50},
+ }
+
+%</ebg>
+%</m-t|cmr|ebg|pmn>
% \end{macrocode}
% <T1> and <LY1> encodings contain some more characters. The default list
% will be loaded first.
@@ -14283,8 +15994,9 @@ end
%<ptm> load = ptm-default ]
%<ugm> load = ugm-default ]
%<m-t> { encoding = {T1,LY1,EU1,EU2,TU} }
-%<bch|cmr|ebg|pmn|ppl> { encoding = {T1,LY1},
+%<bch|cmr|pmn|ppl> { encoding = {T1,LY1},
%<blg|ptm|ugm> { encoding = {T1},
+%<ebg> { encoding = {LY1},
%<bch> family = bch }
%<blg> family = blg }
%<cmr> family = cmr }
@@ -14332,7 +16044,8 @@ end
%<m-t> \guillemotleft = {200,200}, \guillemotright = {200,200},
%<cmr> \guillemotleft = {300,200}, \guillemotright = {100,400},
%<bch|pmn> \guillemotleft = {200,200}, \guillemotright = {150,300},
-%<blg|ebg|ppl|ptm> \guillemotleft = {300,300}, \guillemotright = {200,400},
+%<blg|ppl|ptm> \guillemotleft = {300,300}, \guillemotright = {200,400},
+%<ebg> \guillemotleft = {300,300}, \guillemotright = {200,300},
%<ugm> \guillemotleft = {300,400}, \guillemotright = {300,400},
%<m-t|bch|cmr|ebg|pmn|ppl|ugm> \textexclamdown = {100, }, \textquestiondown = {100, },
%<blg> \textexclamdown = {200, }, \textquestiondown = {100, },
@@ -14371,6 +16084,37 @@ end
}
%</cmr>
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-T1-LF,
+ load = EBGaramond-T1 ]
+ { encoding = T1,
+ family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 4 = {50,50},
+ 7 = {50,50},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-T1-TOsF,
+ load = EBGaramond-T1 ]
+ { encoding = T1,
+ family = {EBGaramond-TOsF} }
+ {
+ 1 = {150,150},
+ 2 = {50,50},
+ 3 = {50,50},
+ 4 = {50,50},
+ 5 = {50,50},
+ 6 = {50,50},
+ 7 = {50,80},
+ 8 = {50,50},
+ 9 = {50,50},
+ }
+
+%</ebg>
% \end{macrocode}
% Settings for the <T2A> encoding (generic, Computer Modern Roman, and Minion).\footnote{Contributed by
% \contributor Karl Karlsson <karl-karlsson\at yandex.ru>.}
@@ -14587,6 +16331,76 @@ end
%</ptm>
% \end{macrocode}
+%\changes{v3.0}{2021/06/25}{<LGR> settings for <EB> Garamond}
+% For the Greek <LGR> encoding.
+% \begin{macrocode}
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-LGR ]
+ { }
+ {
+ A = {50,50},
+ D = {100,100},
+ F = {50,50},
+ G = { ,150},
+ K = { ,50},
+ L = {100,100},
+ O = {50,50},
+ U = {100,100},
+ T = {50,50},
+ W = { ,50},
+ Y = {50,50},
+ . = { ,600},
+ {,}= { ,500},
+ : = { ,400},
+ ; = { ,300},
+ ! = { ,100},
+ ? = { ,100},
+ ~ = {200,250},
+ \% = {50,50},
+ * = {300,300},
+ + = {250,250},
+ {=}= { 50, 50},
+ ( = {100, }, ) = { ,200},
+ / = {100,200},
+ - = {300,500},
+ \texteuro = { 50,100},
+ \textendash = {300,300}, \textemdash = {200,200},
+ \textquoteleft = {300,500}, \textquoteright = {400,400},
+ \guillemotleft = {300,300}, \guillemotright = {200,400},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-LGR-LF,
+ load = EBGaramond-LGR ]
+ { encoding = LGR,
+ family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF} }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 4 = {50,50},
+ 7 = {50,50},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-LGR-TOsF,
+ load = EBGaramond-LGR ]
+ { encoding = LGR,
+ family = {EBGaramond-TOsF} }
+ {
+ 1 = {150,150},
+ 2 = {50,50},
+ 3 = {50,50},
+ 4 = {50,50},
+ 5 = {50,50},
+ 6 = {50,50},
+ 7 = {50,80},
+ 8 = {50,50},
+ 9 = {50,50},
+ }
+
+%</ebg>
+% \end{macrocode}
%
%\subsubsection{Italics}
%
@@ -14618,17 +16432,16 @@ end
%<ppl> [ name = ppl-it ]
%<ptm> [ name = ptm-it ]
%<ugm> [ name = ugm-it ]
-%<m-t|bch|blg|ebg|ugm> { encoding = OT1,
+%<m-t|bch|blg|ugm> { encoding = OT1,
%<ppl|ptm> { encoding = {OT1,OT4},
%<bch> family = bch,
%<blg> family = blg,
-%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF},
%<ppl> family = {ppl,pplx,pplj},
%<ptm> family = {ptm,ptmx,ptmj},
%<ugm> family = ugm,
-%<m-t|bch|ebg|ppl|ptm> shape = {it,sl} }
+%<m-t|bch|ppl|ptm> shape = {it,sl} }
%<blg|ugm> shape = it }
-%<cmr|pmn> { }
+%<cmr|ebg|pmn> { }
{
%<cmr> A = {100,100},
%<ptm> A = {100,50},
@@ -14870,11 +16683,13 @@ end
%<ugm> \textquotedblleft = {600,200}, \textquotedblright = {600,200}
}
-%<*cmr|pmn>
+%<*cmr|ebg|pmn>
\SetProtrusion
%<cmr> [ name = cmr-it-OT1,
+%<ebg> [ name = EBGaramond-it-OT1,
%<pmn> [ name = pmnj-it-OT1,
%<cmr> load = cmr-it ]
+%<ebg> load = EBGaramond-it ]
%<pmn> load = pmnj-it ]
%<cmr> { encoding = {OT1,OT4},
%<pmn> { encoding = OT1,
@@ -14882,27 +16697,90 @@ end
%<pmn> family = pmnj,
%<cmr> shape = it }
%<pmn> shape = {it,sl} }
+%<ebg> { }
{
%<cmr> \AE = {100, },
%<pmn> \AE = { ,-50},
%<cmr> \OE = {100, },
%<pmn> \OE = {50, }
-%<*cmr>
- "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
-%</cmr>
+%<*cmr|ebg>
+%<cmr> "00 = {200,150}, % \Gamma
+%<ebg> "00 = { ,150}, % \Gamma
+%<cmr> "01 = {150,100}, % \Delta
+%<ebg> "01 = {100,100}, % \Delta
+%<cmr> "02 = {150, 50}, % \Theta
+%<ebg> "02 = { 50, 50}, % \Theta
+%<cmr> "03 = {150, 50}, % \Lambda
+%<ebg> "03 = {100,100}, % \Lambda
+%<cmr> "04 = {100,100}, % \Xi
+%<ebg> "04 = { 50, 50}, % \Xi
+%<cmr> "05 = {100,100}, % \Pi
+%<cmr> "06 = {100, 50}, % \Sigma
+%<cmr> "07 = {200,150}, % \Upsilon
+%<ebg> "07 = {100,100}, % \Upsilon
+%<cmr> "08 = {150, 50}, % \Phi
+%<ebg> "08 = { 50, 50}, % \Phi
+%<cmr> "09 = {150,100}, % \Psi
+%<ebg> "09 = { 50, 50}, % \Psi
+ "0A = { 50, 50}, % \Omega
+%<ebg> 138 = { , 50}, % \L
+%</cmr|ebg>
+ }
+
+%</cmr|ebg|pmn>
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-it-OT1-LF,
+ load = EBGaramond-it-OT1 ]
+ { encoding = OT1,
+ family = {EBGaramond-LF,EBGaramond-TLF},
+ shape = it }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 3 = {80,50},
+ 4 = {50,50},
+ 5 = {50,50},
+ 6 = {50,50},
+ 7 = {50,50},
+ 8 = {50,50},
+ 9 = {50, },
}
-%</cmr|pmn>
+\SetProtrusion
+ [ name = EBGaramond-it-OT1-OsF,
+ load = EBGaramond-it-OT1 ]
+ { encoding = OT1,
+ family = {EBGaramond-OsF},
+ shape = it }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 3 = { ,80},
+ 4 = {50,50},
+ 7 = {50,50},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-it-OT1-TOsF,
+ load = EBGaramond-it-OT1 ]
+ { encoding = OT1,
+ family = {EBGaramond-TOsF},
+ shape = it }
+ {
+ 0 = {150,150},
+ 1 = {150,150},
+ 2 = {80,80},
+ 3 = {50,80},
+ 4 = {50,80},
+ 5 = {50,80},
+ 6 = {50,50},
+ 7 = {50,100},
+ 8 = {50,50},
+ 9 = {50,80},
+ }
+
+%</ebg>
\SetProtrusion
%<m-t> [ name = T1-it-default,
%<bch> [ name = bch-it-T1,
@@ -14922,7 +16800,8 @@ end
%<ppl> load = ppl-it ]
%<ptm> load = ptm-it ]
%<ugm> load = ugm-it ]
-%<m-t|bch|cmr|ebg|pmn|ppl> { encoding = {T1,LY1},
+%<m-t|bch|cmr|pmn|ppl> { encoding = {T1,LY1},
+%<ebg> { encoding = {LY1},
%<blg|ptm|ugm> { encoding = T1,
%<bch> family = bch,
%<blg> family = blg,
@@ -14932,8 +16811,8 @@ end
%<ppl> family = {ppl,pplx,pplj},
%<ptm> family = {ptm,ptmx,ptmj},
%<ugm> family = ugm,
-%<m-t|bch|ebg|pmn|ppl|ptm> shape = {it,sl} }
-%<blg|cmr|ugm> shape = it }
+%<m-t|bch|pmn|ppl|ptm> shape = {it,sl} }
+%<blg|cmr|ebg|ugm> shape = it }
{
%<m-t|bch|pmn> _ = { ,100},
%<blg> _ = {0,300},
@@ -14987,6 +16866,59 @@ end
%<pmn> \textvisiblespace = {100,100}
}
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-it-T1-LF,
+ load = EBGaramond-it-T1 ]
+ { encoding = T1,
+ family = {EBGaramond-LF,EBGaramond-TLF},
+ shape = it }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 3 = {80,50},
+ 4 = {50,50},
+ 5 = {50,50},
+ 6 = {50,50},
+ 7 = {50,50},
+ 8 = {50,50},
+ 9 = {50, },
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-it-T1-OsF,
+ load = EBGaramond-it-T1 ]
+ { encoding = T1,
+ family = {EBGaramond-OsF},
+ shape = it }
+ {
+ 1 = {50,50},
+ 2 = {50,50},
+ 3 = { ,80},
+ 4 = {50,50},
+ 7 = {50,50},
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-it-T1-TOsF,
+ load = EBGaramond-it-T1 ]
+ { encoding = T1,
+ family = {EBGaramond-TOsF},
+ shape = it }
+ {
+ 0 = {150,150},
+ 1 = {150,150},
+ 2 = {80,80},
+ 3 = {50,80},
+ 4 = {50,80},
+ 5 = {50,80},
+ 6 = {50,50},
+ 7 = {50,100},
+ 8 = {50,50},
+ 9 = {50,80},
+ }
+
+%</ebg>
%<*m-t|cmr|pmn>
\SetProtrusion
%<m-t> [ name = T2A-it-default,
@@ -15303,14 +17235,14 @@ end
%<m-t> [ name = OT1-sc,
%<bch> [ name = bch-sc,
%<cmr> [ name = cmr-sc-OT1,
-%<ebg> [ name = EBGaramond-sc,
+%<ebg> [ name = EBGaramond-sc-OT1-Prop,
%<pmn> [ name = pmnj-sc,
%<ppl> [ name = ppl-sc,
%<ptm> [ name = ptm-sc,
%<m-t> load = default ]
%<bch> load = bch-default ]
%<cmr> load = cmr-OT1 ]
-%<ebg> load = EBGaramond-default ]
+%<ebg> load = EBGaramond-OT1-LF ]
%<pmn> load = pmnj-default ]
%<ppl> load = ppl-default ]
%<ptm> load = ptm-default ]
@@ -15318,7 +17250,7 @@ end
%<cmr|ppl|ptm> { encoding = {OT1,OT4},
%<bch> family = bch,
%<cmr> family = cmr,
-%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF},
+%<ebg> family = {EBGaramond-LF,EBGaramond-OsF},
%<pmn> family = pmnj,
%<ppl> family = {ppl,pplx,pplj},
%<ptm> family = {ptm,ptmx,ptmj},
@@ -15334,7 +17266,7 @@ end
%<bch> j = {100, },
%<m-t|bch|cmr|ebg|pmn|ppl> l = { ,50},
%<ptm> l = { ,80},
-%<m-t|bch|cmr|ebg|pmn|ppl> 013 = { ,50}, % fl
+%<m-t|bch|cmr|pmn|ppl> 013 = { ,50}, % fl
%<ptm> 013 = { ,80}, % fl
%<bch|ebg|pmn> o = {50,50},
%<ebg|pmn> \oe = {50, },
@@ -15347,6 +17279,30 @@ end
%<ptm> y = {80,80}
}
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-sc-OT1-Tab,
+ load = EBGaramond-OT1-TOsF ]
+ { encoding = OT1,
+ family = {EBGaramond-TLF,EBGaramond-TOsF},
+ shape = sc }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+%</ebg>
\SetProtrusion
%<m-t> [ name = T1-sc,
%<bch> [ name = bch-sc-T1,
@@ -15362,7 +17318,8 @@ end
%<pmn> load = pmnj-T1 ]
%<ppl> load = ppl-T1 ]
%<ptm> load = ptm-T1 ]
- { encoding = {T1,LY1},
+%<!ebg> { encoding = {T1,LY1},
+%<ebg> { encoding = {LY1},
%<bch> family = bch,
%<cmr> family = cmr,
%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF},
@@ -15381,7 +17338,7 @@ end
%<bch> j = {100, },
%<m-t|bch|cmr|ebg|pmn|ppl> l = { ,50},
%<ptm> l = { ,80},
-%<m-t|bch|cmr|ebg|pmn|ppl> 029 = { ,50}, % fl
+%<m-t|bch|cmr|pmn|ppl> 029 = { ,50}, % fl
%<ptm> 029 = { ,80}, % fl
%<bch|ebg|pmn> o = {50,50},
%<bch|ebg|pmn> \oe = {50, },
@@ -15457,6 +17414,52 @@ end
}
%</cmr|bch>
+%<*ebg>
+\SetProtrusion
+ [ name = EBGaramond-sc-T1-Prop,
+ load = EBGaramond-T1-LF ]
+ { encoding = T1,
+ family = {EBGaramond-LF,EBGaramond-OsF},
+ shape = sc }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-sc-T1-Tab,
+ load = EBGaramond-T1-TOsF ]
+ { encoding = T1,
+ family = {EBGaramond-TLF,EBGaramond-TOsF},
+ shape = sc }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+%</ebg>
%<*pmn>
\SetProtrusion
[ name = pmnx-sc,
@@ -15585,6 +17588,101 @@ end
}
%</pmn>
+%<*ebg>
+% \end{macrocode}
+% For small caps italics, we copy the definitions from the small caps settings,
+% except that we first load the italics settings.
+%\changes{v3.0}{2021/06/23}{settings for <EB> Garamond small caps italics}
+% \begin{macrocode}
+\SetProtrusion
+ [ name = EBGaramond-scit-OT1-Prop,
+ load = EBGaramond-it-OT1-LF ]
+ { encoding = OT1,
+ family = {EBGaramond-LF,EBGaramond-OsF},
+ shape = scit }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-scit-OT1-Tab,
+ load = EBGaramond-it-OT1-TOsF ]
+ { encoding = OT1,
+ family = {EBGaramond-TLF,EBGaramond-TOsF},
+ shape = scit }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-scit-T1-Prop,
+ load = EBGaramond-it-T1-LF ]
+ { encoding = T1,
+ family = {EBGaramond-LF,EBGaramond-OsF},
+ shape = scit }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+\SetProtrusion
+ [ name = EBGaramond-scit-T1-Tab,
+ load = EBGaramond-it-T1-TOsF ]
+ { encoding = T1,
+ family = {EBGaramond-TLF,EBGaramond-TOsF},
+ shape = scit }
+ {
+ a = {50,50},
+ \ae = {50, },
+ d = { ,50},
+ f = { ,50},
+ g = {50, },
+ j = {50, },
+ l = { ,50},
+ o = {50,50},
+ \oe = {50, },
+ q = {50,70},
+ r = { , 0},
+ t = {50,50},
+ y = {50,50}
+ }
+
+%</ebg>
% \end{macrocode}
%
%\subsubsection{Text companion}
@@ -15815,8 +17913,8 @@ end
%<ebg> family = {EBGaramond-LF,EBGaramond-TLF,EBGaramond-OsF,EBGaramond-TOsF},
%<pmn> family = {pmnx,pmnj},
%<ugm> family = ugm,
-%<!ugm> shape = {it,sl} }
-%<ugm> shape = it }
+%<cmr|pmn> shape = {it,sl} }
+%<ebg|ugm> shape = it }
{
%<cmr> \textquotestraightbase = {300,600},
%<ebg|pmn> \textquotestraightbase = {400,400},
@@ -17231,24 +19329,28 @@ end
%\ifpdf
%\GeneralChanges{Documentation}
%^^A The OpenType configuration files are outsourced to an external file,
-%^^A since they are typeset with \luatex.
+%^^A since they have to be typeset with \luatex.
%
-%\newwrite \utftmp
-%\immediate\openout \utftmp=microtype-utf.tmp
-%\immediate\write \utftmp{\string\setcounter{section}{\the\c@section}}
-%\immediate\write \utftmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}}
-%\immediate\write \utftmp{\string\setcounter{page}{\the\c@page}}
-%\immediate\write \utftmp{\string\setcounter{footnote}{\the\c@footnote}}
-%\immediate\closeout\utftmp
+%\begingroup
+%\def\setcounter#1#2{\expandafter\ifnum\csname c@#1\endcsname=#2 \else\@tempswatrue\fi}
+%\InputIfFileExists{microtype-code.tmp}\@tempswafalse\@tempswatrue
+%\if@tempswa
+%\newwrite \codetmp
+%\immediate\openout \codetmp=microtype-code.tmp
+%\immediate\write \codetmp{\string\setcounter{section}{\the\c@section}}
+%\immediate\write \codetmp{\string\setcounter{CodelineNo}{\the\c@CodelineNo}}
+%\immediate\write \codetmp{\string\setcounter{page}{\the\c@page}}
+%\immediate\write \codetmp{\string\setcounter{footnote}{\the\c@footnote}}
+%\immediate\closeout\codetmp
+%\fi
+%\endgroup
%
-%\InputIfFileExists{microtype.tmp}\relax{\def\utfsectioni{1}\def\utfsectionii{1}}
+%\InputIfFileExists{microtype-utf.tmp}
+% {\def\UTF@setbookmarks##1{\def\UTFBookmarks{##1}}}
+% {\let\UTFBookmarks\@empty}
%
%\IfFileExists{microtype-utf.pdf}
-% {\includepdf[pages=-,
-% addtotoc={1,section,1,OpenType configuration files,sec:OpenType,
-% \utfsectioni,subsection,2,Character inheritance,sub:OT-inheritance,
-% \utfsectionii,subsection,2,Character protrusion,sub:OT-protrusion}]
-% {microtype-utf.pdf}}
+% {\edef\x{\noexpand\includepdf[pages=-,addtotoc={\UTFBookmarks}]{microtype-utf.pdf}}\x}
% {\section{OpenType configuration settings}
% To view the OpenType configuration settings, first typeset
% \file{microtype-utf.dtx} with \luatex.}
@@ -17262,119 +19364,65 @@ end
%
%\section{Auxiliary file for micro fine tuning}
%
-% This file can be used to test protrusion and expansion settings.
+% This file may be used to test protrusion and (less so) expansion settings.
% \begin{macrocode}
%<*test>
\documentclass{article}
+%% options are passed through to microtype
+\usepackage[stretch=50]{microtype-show}
-%% Here you can specify 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
-}
+%% options for microtype-show
+\ShowGlyphIndextrue
+\ShowMissingGlyphstrue
+\def\GlyphScaleFactor{2}
-\usepackage{ifthen}
-\usepackage[T1]{fontenc}
-\usepackage[latin1]{inputenc}
-\usepackage[verbose,expansion=alltext,stretch=50]{microtype}
+%% load any required font packages:
+\ifpdftex
+ \usepackage[T1]{fontenc}
+\else
+ \usepackage{fontspec}
+\fi
-\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
+%% load your font here:
-\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}
+\ShowCharacterInheritance
\newpage
-The following displays the current font stretched by 5\%,
-normal, and shrunk by 5\%:
+\ShowProtrusion
+
+\newpage
+%% show single glyphs
+ %\ShowDummyLine
+ %\ShowProtrusionLineGlyph{A}
+ %\ShowProtrusionLineIndex{27}
+
+%% loop through all glyphs of the font;
+%% protrusion values are shown in 1000th of 1em
+ \ShowProtrusionDefined
+
+ %\ShowProtrusionMissing
+
+ %\ShowProtrusionAll
+
+\newpage %% -------------------------------------------------------------------
+This is the current font stretched by 5\%, normal, and shrunk by 5\%:
-\bigskip
\newlength{\MTln}
\newcommand*\teststring
- {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789}
+ {ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}
\settowidth{\MTln}{\teststring}
\microtypesetup{expansion=true}
-\parbox{1.05\MTln}{\teststring\linebreak\\
- \teststring}\par\bigskip
-\parbox{0.95\MTln}{\teststring}
-
+\bigskip\noindent\parbox{1.05\MTln}{\teststring\linebreak\\\teststring}\par
+\bigskip\noindent\parbox{0.95\MTln}{\teststring}
\end{document}
%</test>
% \end{macrocode}
% Needless to say that things may always be improved. For suggestions, mail to
-% \mailtoRS.
+% \mailtoRS\ or file an issue at \url{\githuburl/issues}.
%
% ^^A -------------------------------------------------------------------------
%
@@ -17408,33 +19456,34 @@ normal, and shrunk by 5\%:
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \CheckSum{10847}
+% \CheckSum{12274}
%
% \Finale
%
+% \InputIfFileExists{lppl.tex}\LPPLSettings\relax
+%
\endinput
%
% -----------------------------------------------------------------------------
*** Typesetting the documentation ***
- The documentation of this package (microtype.pdf) can be found on CTAN,
- if it isn't already installed in your TeX system, so there should be no
- need to re-typeset it.
+ The documentation of this package (microtype.pdf and microtype-code.pdf)
+ can be found on CTAN, if it isn't already installed in your TeX system,
+ so there should be no need to re-typeset it.
If you still want to do this, there are some requirements to consider
and some steps to follow:
-# (1) In microtype.ins, uncomment the lines:
+# (1) In microtype.ins, uncomment the lines
%\generate{\makefile{microtype-gind.ist}{docist}}
# and
%\generate{\makefile{microtype-doc.sty}{docsty}}
-# (2) Install the package by running:
+# (2) Install the package by running
pdflatex microtype.ins
# (3) Extract microtype-lssample.dtx and microtype-logo.dtx from
# microtype.pdf (ie., from the file you are about to recreate ...).
# This can be done, eg., with Adobe Reader or with the pdftk tool.
-# (4) Run
-pdflatex microtype.dtx
+# (4) To typeset the user documentation (microtype.pdf) run
pdflatex microtype.dtx
# [ The following fonts are required:
# - Bitstream Charter
@@ -17444,11 +19493,11 @@ pdflatex microtype.dtx
# - Adobe Zapf Chancery (alternatively URW Zapf Chancery)
# - Adobe Kepler MM (for microtype-logo.dtx, input by microtype.dtx)
# - Adobe Caslon (for microtype-lssample.dtx, input by microtype.dtx) ]
-# (5) Run
+# (5) To create the index run
makeindex -s microtype-gind.ist microtype
-# (6) Run
-makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo
-# (7) Run
+# (6) To typeset the implementation documentation (microtype-code.pdf) run
+pdflatex --jobname=microtype-code microtype.dtx
+# (7) To typeset the OpenType configuration (to be included in microtype-code.pdf) run
lualatex microtype-utf.dtx
# [ The following fonts are required:
# - Bitstream Charter (Type 1)
@@ -17456,15 +19505,15 @@ lualatex microtype-utf.dtx
# - Adobe Source Sans Pro (Type 1)
# - Latin Modern Roman (OpenType)
# - Charis SIL (OpenType)
+# - EB Garamond (OpenType)
# - TeX Gyre Pagella (OpenType) ]
-# (8) Run
-pdflatex microtype.dtx
-# (9) Run
-makeindex -s microtype-gind.ist microtype
-# (10) Run
-makeindex -s gglo.ist -o microtype.gls microtype.glo microtype-utf.glo
-# (11) Run
-pdflatex microtype.dtx
+# (8) To create the code index and history run
+makeindex -r -s microtype-gind.ist -t microtype-code.ilg -o microtype-code.ind microtype.idx microtype-code.idx
+makeindex -s gglo.ist -t microtype-code.glg -o microtype-code.gls microtype.glo microtype-code.glo microtype-utf.glo
+#
+# All three output files (microtype.pdf, microtype-code.pdf, microtype-utf.pdf)
+# are interdependent, so you need to repeat steps 4 to 8 until all Rerun
+# warnings have been resolved.
#
# That's it, although I still may have forgotten some things ...
%
@@ -17472,4 +19521,5 @@ pdflatex microtype.dtx
% -----------------------------------------------------------------------------
%
% vim: ts=2:sw=2:et:
+
%