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.dtx585
1 files changed, 402 insertions, 183 deletions
diff --git a/macros/latex/contrib/microtype/microtype.dtx b/macros/latex/contrib/microtype/microtype.dtx
index 4e061d1810..eb724cae42 100644
--- a/macros/latex/contrib/microtype/microtype.dtx
+++ b/macros/latex/contrib/microtype/microtype.dtx
@@ -37,7 +37,7 @@
%<lua-> {microtype-luatex.def}
%<xe-> {microtype-xetex.def}
%<*package|letterspace|m-t|pdf-|lua-|xe-|show>
- [2022/03/14 v3.0d
+ [2022/06/20 v3.0e
%<package> Micro-typographical refinements
%<letterspace> Robust letterspacing
%<show> Visual debugging for the microtype package
@@ -52,8 +52,8 @@
%<luafile>local microtype = microtype
%<luafile>microtype.module = {
%<luafile> name = "microtype",
-%<luafile> version = "3.0d",
-%<luafile> date = "2022/03/14",
+%<luafile> version = "3.0e",
+%<luafile> date = "2022/06/20",
%<luafile> description = "microtype module.",
%<luafile> author = "E. Roux, R. Schlicht and P. Gesang",
%<luafile> copyright = "E. Roux, R. Schlicht and P. Gesang",
@@ -81,8 +81,7 @@
%<*driver|docsty>
%<*driver>
\makeatletter
-\AddToHook{package/doc/before}{\pkgcls@targetdate=1 \def\pkgcls@targetlabel{v2}}
-\documentclass[10pt,a4paper]{ltxdoc}
+\documentclass[10pt,a4paper,doc2]{ltxdoc}
%</driver>
% Compiling microtype.dtx with the command line option
% --jobname=microtype-code
@@ -1405,7 +1404,7 @@
% 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;
+% from earlier 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.
@@ -2394,7 +2393,7 @@
% & 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}}
+% \pkg{newtx}, \pkg{tempora}, \pkg{step}, \pkg{stix}/\pkg{stix2}/\pkg{stickstoo}}
% & <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|)}
@@ -2780,7 +2779,7 @@
% \MTsupp{standard classes, \cls{memoir}}
% \item[footnote] Protrusion for the first line of footnote text (visible in particular
% when the footnote text is set in block paragraphs, like in this document).
-% \MTsupp{standard classes, \cls{memoir}, <\cls{KOMA}> classes, \pkg{hyperref}}
+% \MTsupp{standard classes, \cls{memoir}, <\cls{KOMA}> classes, \cls{beamer}, \pkg{hyperref}}
% \item[eqnum] Protrusion for equation numbers on either side. If you are using the
% interface provided by \pkg{mathtools}, insert the relevant commands
% yourself, \eg:
@@ -2792,7 +2791,9 @@
%
%\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
+% or in case you are running into problems (or just want to silence a warning that a
+% patch cannot be applied -- which in itself only means that no harm is done, but no
+% good either), 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}
@@ -3334,9 +3335,11 @@
% \contributor Joel Coffman <@\at @>, ^^A https://github.com/joel-coffman
% `\contributor user182849 <@\at @>', ^^A https://tex.stackexchange.com/users/182849/user182849
% `\contributor NightShade <@\at @>', ^^A https://tex.stackexchange.com/users/260836/nightshade
-% \contributor Nelson Lago <@\at @> ^^A https://github.com/urrameu
+% \contributor Nelson Lago <@\at @>, ^^A https://github.com/urrameu
+% \contributor Brian Dunn <@\at @>, ^^A https://github.com/bdtc
+% \contributor Ralf Steinle <rasteinle\at web.de>
% and
-% \contributor Brian Dunn <@\at @>. ^^A https://github.com/bdtc
+% \contributor Denis Bitouz\'e <@\at @>. ^^A https://tex.stackexchange.com/users/18401/denis-bitouz%c3%a9
%
%\iffalse
%\section{History of micro-typography} ^^A some time ...
@@ -3407,7 +3410,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},
-% 18~February 2021.
+% 1~March 2022.
% (\ctanurl{systems/doc/pdftex/manual/pdftex-a.pdf})
%
% \bibitem[Fontname]{fontname}
@@ -3429,7 +3432,7 @@
% \bibitem[\pkg{luaotfload}]{luaotfload}
% \LaTeX3 Project, \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger,
% \emph{The \pkg{luaotfload} package},
-% 21~May 2021.
+% 15~June 2022.
% (\ctanpkgurl{luaotfload})
%
% \bibitem[\pkg{pdfcprot}]{pdfcprot}
@@ -3483,6 +3486,8 @@
%
%\VersionDate{\expandafter\@gobble\fileversion}{\filedate}
%
+%\VersionDate{3.0d}{2022/03/14}
+%
%\VersionDate{3.0c}{2022/02/22}
%
%\VersionDate{3.0b}{2021/12/10}
@@ -3490,12 +3495,12 @@
%\VersionDate{3.0a}{2021/12/02}
%
%\Version{3.0}{2021/10/31}
+% \item New option \opt{disable}, replacing the |draft| option; deprecate option |final|
+% \refsection{\ref{sub:options-misc}}
% \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)
@@ -3568,32 +3573,32 @@
%\VersionDate{2.3a}{2008/02/29}
%
%\Version{2.3}{2007/12/23}
+% \item New option `\opt{verbose}|=silent|' to turn all warnings into mere messages
+% \refsection{\ref{sub:options-misc}}
% \item New key `|outer kerning|' for \cs{SetTracking} to customise outer kerning
% \refsection{\ref{sub:tracking}}
% \item Adjust protrusion settings for tracking even if protrusion is not enabled
-% \item New option `\opt{verbose}|=silent|' to turn all warnings into mere messages
-% \refsection{\ref{sub:options-misc}}
% \item The \letterspace\ package also works with \pkg{eplain} or \pkg{miniltx}
% \refsection{\ref{sec:lettersp}}
%
%\Version{2.2}{2007/07/14}
% \item Improvements to tracking/letterspacing: retain kerning (\pdftex\ $\geq$ 1.40.4);
% automatically adjust protrusion settings
+% \item Possibility to expand a font with different parameters (\pdftex\ $\geq$ 1.40.4)
+% ^^A ; new option `\opt{copyfonts}'
+% \refsection{\ref{sub:expansion}}
% \item New key `|no ligatures|' for \cs{SetTracking} to disable selected or
% all ligatures (\pdftex\ $\geq$ 1.40.4)
% \refsection{\ref{sub:tracking}}
% \item New keys `|spacing|' and `|outer spacing|' for \cs{SetTracking} to
% customise interword spacing
% \refsection{\ref{sub:tracking}}
-% \item Possibility to expand a font with different parameters (\pdftex\ $\geq$ 1.40.4)
-% ^^A ; new option `\opt{copyfonts}'
-% \refsection{\ref{sub:expansion}}
-% \item New optional argument for \cs{DisableLigatures} to disable selected ligatures
-% \refsection{\ref{sec:disable-ligatures}}
% \item New command \cs{DeclareMicrotypeVariants} to specify variant suffixes
% \refsection{\ref{sub:config-file}}
% \item New command \cs{textmicrotypecontext} as a wrapper for \cs{microtypecontext}
% \refsection{\ref{sec:context}}
+% \item New optional argument for \cs{DisableLigatures} to disable selected ligatures
+% \refsection{\ref{sec:disable-ligatures}}
% \item Protrusion settings for Bitstream Letter Gothic
%^^A \item Basic support for \luatex\ (if generated with the |lua| option)
%
@@ -3649,12 +3654,12 @@
% \item Protrusion settings for <T5> encoded Charter
%
%\Version{1.9}{2005/10/28}
-% \item New command \cs{DisableLigatures} to disable ligatures
-% (\pdftex\ $\geq$ 1.30)
-% \refsection{\ref{sec:disable-ligatures}}
% \item New command \cs{microtypecontext} to change the configuration context;
% new key `|context|' for the configuration commands
% \refsection{\ref{sec:context}}
+% \item New command \cs{DisableLigatures} to disable ligatures
+% (\pdftex\ $\geq$ 1.30)
+% \refsection{\ref{sec:disable-ligatures}}
% \item New key `|font|' to add single fonts to the font sets
% \refsection{\ref{sec:font-sets}}
% \item New key `|preset|' to set all characters to the specified value before
@@ -3667,16 +3672,16 @@
%\Version{1.8}{2005/06/23}
%^^A \item If font substitution has occurred, the settings for the substitute will
%^^A be used instead of those for the selected font
-% \item New command \cs{DeclareMicrotypeSetDefault} to declare the default font sets
-% \refsection{\ref{sec:font-sets}}
% \item New option `\opt{config}' to load a different configuration file
% \refsection{\ref{sub:options-misc}}
+% \item New command \cs{DeclareMicrotypeSetDefault} to declare the default font sets
+% \refsection{\ref{sec:font-sets}}
% \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 \cmd{\..MicroType..} to \cmd{\..Microtype..}
% \item Protrusion settings for <AMS> math fonts
-% \item Protrusion settings for Times in <LY1> encoding completed
+%^^A \item Protrusion settings for Times in <LY1> encoding completed
% \item The `|allmath|' font set also includes <U> encoding
%^^A \item 8-bit characters in the configuration finally work as advertised,
%^^A even if made active by the \pkg{csquotes} package
@@ -3699,12 +3704,12 @@
%\VersionDate{1.6a}{2005/02/02}
%
%\Version{1.6}{2005/01/24}
-% \item New option `\opt{factor}' to influence protrusion resp. expansion of
-% all characters of a font or font set
-% \refsection{\ref{sub:options-protrusion}, \ref{sec:fine-tuning}}
% \item When \pdftex\ is too old to expand fonts automatically, expansion
% has to be enabled explicitly, automatic expansion will be disabled
% \refsection{\ref{sub:options-microtype}}
+% \item New option `\opt{factor}' to influence protrusion resp. expansion of
+% all characters of a font or font set
+% \refsection{\ref{sub:options-protrusion}, \ref{sec:fine-tuning}}
%^^A \item Protrusion settings of digits improved
% \item Use \etex\ extensions, if available
%
@@ -3741,17 +3746,17 @@
% \item New font sets: `|allmath|' and `|basicmath|'
% \refsection{\ref{sec:font-sets}, table~\ref{tab:predefined-font-sets}}
% \item Protrusion settings for Computer Modern Roman math symbols
-% \item Protrusion settings for <TS1> encoding completed for Computer Modern
-% Roman and Adobe Garamond
+%^^A \item Protrusion settings for <TS1> encoding completed for Computer Modern
+%^^A Roman and Adobe Garamond
%^^A \item If an alias font name is specified, it will be used as an alternative,
%^^A not as a replacement \refsection{\ref{sub:config-file}}
%
%\Version{1.1}{2004/09/21}
-% \item Protrusion settings for Adobe Minion
% \item New command: \cs{DeclareCharacterInheritance}
% \refsection{\ref{sub:inheritance}}
% \item Characters may also be specified as octal or hexadecimal numbers
% \refsection{\ref{sec:fine-tuning}}
+% \item Protrusion settings for Adobe Minion
%^^A \item Configuration file names in lowercase [\ref{sub:config-file}]
%
%\Version{1.0}{2004/09/11}
@@ -3836,23 +3841,22 @@
% \endinput,\escapechar,\everypar,\expandafter,\fi,\futurelet,\gdef,\global,
% \hbadness,\hbox,\hfill,\hrule,\hsize,\hskip,\if,\ifcase,\ifcat,\ifdim,\iffalse,\ifhbox,
% \ifhmode,\ifmmode,\ifnum,\iftrue,\ifvbox,\ifx,\ignorespaces,\immediate,\input,
-% \inputlineno,\interlinepenalty,\jobname,\kern,\lastbox,\lastkern,\lastskip,\leaders,
-% \let,\long,\lowercase,\maxdimen,\meaning,\multiply,\newlinechar,\noexpand,\noindent,
-% \number,\or,\parfillskip,\pretolerance,\relax,\setbox,\showboxdepth,\splittopskip,
-% \string,\the,\tolerance,\unhbox,\unkern,\unskip,\unvbox,\uppercase,\vbadness,\vbox,
-% \vfuzz,\vrule,\vsplit,\wd,\widowpenalty,\write,\xdef}
+% \inputlineno,\interlinepenalty,\jobname,\kern,\lastbox,\lastkern,\lastskip,\lccode,
+% \leaders,\let,\long,\lowercase,\maxdimen,\meaning,\multiply,\newlinechar,\noexpand,
+% \noindent,\number,\or,\parfillskip,\pretolerance,\relax,\setbox,\showboxdepth,
+% \splittopskip,\string,\the,\tolerance,\unhbox,\unkern,\unskip,\unvbox,\uppercase,
+% \vbadness,\vbox,\vfuzz,\vrule,\vsplit,\wd,\widowpenalty,\write,\xdef}
%^^A\DoNotIndex{\font,\fontdimen,\fontname,\nullfont,\sfcode,\spacefactor,
%^^A \spaceskip,\xspaceskip} ^^A tex
%\DoNotIndex{\currentgrouplevel,\currentgrouptype,\currentiflevel,\detokenize,
% \dimexpr,\eTeXversion,\ifcsname,\ifdefined,\lastnodetype,\numexpr,\protected,
% \unexpanded}
%^^A\DoNotIndex{\fontcharwd,\iffontchar} ^^A e-tex
-%\DoNotIndex{\pdfannot,\pdfmatch,\pdfoutput,\pdfstrcmp,
-% \pdftexrevision,\pdftexversion}
+%\DoNotIndex{\pdfannot,\pdfmatch,\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
+%^^A \pdfoutput,\pdftracingfonts} ^^A pdftex
%\DoNotIndex{\XeTeXversion,\XeTeXrevision,\strcmp}
%^^A\DoNotIndex{\XeTeXcharglyph,\XeTeXfonttype,\XeTeXglyph,\XeTeXglyphindex,
%^^A \XeTeXglyphname,\XeTeXlastfontchar,\XeTeXprotrudechars} ^^A xetex
@@ -3861,22 +3865,25 @@
%^^A \ignoreligaturesinfont,\outputmode,\protrudechars,\tracingfonts} ^^A luatex
%\DoNotIndex{\eplain,\usepkg@pkg} ^^A eplain
%\DoNotIndex{\@backslashchar,\@car,\@cclvi,\@classoptionslist,\@currext,
-% \@currname,\@defaultunits,\@empty,\@@enc@update,\@eqnnum,\@expandtwoargs,
-% \@firstofone,\@firstoftwo,\@footnotetext,\@gobble,\@gobbletwo,\@ifclassloaded,
-% \@ifl@t@r,\@ifl@aded,\@ifpackagelater,\@ifpackageloaded,\@ifstar,\@ifundefined,\@item,
-% \@let@token,\@m,\@M,\@makeother,\@minus,\@mpfootnotetext,\@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,
+% \@currname,\@defaultunits,\@elt,\@empty,\@@enc@update,\@eqnnum,\@expandtwoargs,
+% \@firstofone,\@firstoftwo,\@fontenc@load@list,\@footnotetext,\@gobble,\@gobbletwo,
+% \@ifclassloaded,\@ifl@t@r,\@ifl@aded,\@ifpackagelater,\@ifpackageloaded,\@ifstar,
+% \@ifundefined,\@item,\@let@token,\@m,\@M,\@makeother,\@minus,\@mpfootnotetext,
+% \@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,
+% \active,\bfseries,\documentclass,\dotfill,\fbox,\fboxrule,\fboxsep,\fmtversion,
+% \footnotesize,\huge,\Huge,\itshape,\large,\Large,\LARGE,\leavevmode,\llap,
+% \makeatletter,\makebox,\mathrm,\mbox,\mdseries,\medskip,\newbox,\newcommand,
% \newcount,\newdimen,\newif,\newline,\newskip,\newtoks,\nobreak,\nonfrenchspacing,
% \normalbaselineskip,\normalsize,\numberline,\obeylines,\par,\parbox,\providecommand,
-% \quad,\raggedright,\renewcommand,\scalebox,\space,\strut,\textwidth,\texttt,\tiny,
-% \tracingnone,\usefont,\AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,
+% \quad,\raggedright,\renewcommand,\rmfamily,\scalebox,\sffamily,\scriptsize,\scshape,
+% \slshape,\small,\space,\strut,\textwidth,\texttt,\tiny,\tracingnone,\ttfamily,
+% \upshape,\usefont,\tiny,\AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,
% \CurrentOption,\DeclareOption,\DeclareRobustCommand,\IfFileExists,\IfFormatAtLeastTF,
% \InputIfFileExists,\MessageBreak,\PackageError,\PackageInfo,\PackageWarning,
% \PassOptionsToPackage,\ProcessOptions,\RawNoindent,\RequirePackage,\UnicodeEncodingName}
@@ -3891,8 +3898,9 @@
%\DoNotIndex{\CJK@ifundefined,\CJK@plane,\CJK@temp,\CJK@addcmap} ^^A CJK,CJKutf8
%\DoNotIndex{\color} ^^A color
%\DoNotIndex{\csqQQ,\csq@bqgroup,\csq@eqgroup,\@disablequotes} ^^A csquotes
-%\DoNotIndex{\ifHy@hyperfootnotes,\hyper@@anchor,\Hy@footnote@currentHref,
-% \pdfstringdefDisableCommands,\pdfstringdefWarn} ^^A hyperref
+%\DoNotIndex{\hyper@@anchor,\hyper@nopatch@footnote,\Hy@footnote@currentHref,
+% \ifHy@hyperfootnotes,\ifHy@implicit,\pdfstringdefDisableCommands,
+% \pdfstringdefWarn} ^^A hyperref
%\DoNotIndex{\ifpdf,\ifetex,\ifluatex,\ifxetex} ^^A ifpdf/iftex
%\DoNotIndex{\@inpenc@undefined@,\IeC,\inputencoding,\inputencodingname} ^^A inputenc
%^^A\DoNotIndex{\UTFviii@defined,\UTF@four@octets@noexpand, ^^A inputenc/utf8
@@ -3909,8 +3917,10 @@
%\DoNotIndex{\tikz@expandcount} ^^A tikz
%\DoNotIndex{\conditionally@traceoff} ^^A trace
%\DoNotIndex{\@xspace,\@xspace@firsttrue} ^^A xspace
-%\DoNotIndex{\apptocmd,\gappto,\patchcmd} ^^A etoolbox
-%\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem} ^^A beamer
+%\DoNotIndex{\frakfamily,\swabfamily,\gothfamily} ^^A yfonts
+%\DoNotIndex{\apptocmd,\gappto,\ifdefmacro,\ifdefparam,\patchcmd} ^^A etoolbox
+%\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem,
+% \beamer@framefootnotetext} ^^A beamer
%\DoNotIndex{\eqref,\tagform@} ^^A amsmath
%\DoNotIndex{\@topic@item} ^^A simplecv
%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline,
@@ -4980,6 +4990,7 @@
\RequirePackage{keyval}[1997/11/10]
%<*package>
^^X\RequirePackage{etoolbox}
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
% \end{macrocode}
%\begin{macro}{\MT@toks}
% We need a token register,
@@ -5187,7 +5198,7 @@
%\changes{v2.7}{2017/02/08}{drop \pkg{luatexbase} with recent \LaTeX}
% we load the \pkg{luatexbase} package.
% \begin{macrocode}
-%<lua->\@ifl@t@r\fmtversion{2016/01/01}\relax{\RequirePackage{luatexbase}}
+%<lua->\IfFormatAtLeastTF{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
@@ -5197,7 +5208,7 @@
%\changes{v3.0}{2021/03/21}{\letterspace\ loads \file{microtype.lua}}
% Since 2017/01/01, it is already loaded in the format.
% \begin{macrocode}
-%<lua->\@ifl@t@r\fmtversion{2017/01/01}\relax{\RequirePackage{luaotfload}}
+%<lua->\IfFormatAtLeastTF{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")}
@@ -6232,7 +6243,7 @@ microtype.do_font = do_font
% 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}
+\IfFormatAtLeastTF{2020/10/01}
{\IfFormatAtLeastTF{2021/11/15}
{\AddToHook{package/fontspec/after}{\MT@fontspectrue}}
{\AddToHook{package/after/fontspec}{\MT@fontspectrue}}}\relax
@@ -6378,7 +6389,20 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@with@package@T{csquotes}{%
\@ifpackagelater{csquotes}{2005/05/11}{%
\g@addto@macro\MT@setupfont@hook\@disablequotes
- ^^X\apptocmd\csq@bqgroup{\let\MT@csq@eqgroup\csq@eqgroup}\relax\relax
+% \end{macrocode}
+%\changes{v3.0e}{2022/04/05}{disable \pkg{csquotes}'s grouping control for \cs{leftprotrusion}
+% (reported by \contributor Ralf Steinle <rasteinle\at web.de>
+% and \contributor Denis Bitouz\'e <@\at @>)}
+% ^^A https://www.listserv.dfn.de/sympa/arc/tex-d-l/2022-04/msg00010.html
+% ^^A also: https://tex.stackexchange.com/questions/647223/
+% For \cs{leftprotrusion}, we disable \pkg{csquotes}'s tracking
+% of group level and type, because we'll probably be typesetting
+% the opening quotes only.
+% \begin{macrocode}
+ \g@addto@macro\MT@prot@hook{%
+ \def\csq@bqgroup{\begingroup\leavevmode
+ \let\MT@csq@eqgroup\endgroup}%
+ \let\csq@eqgroup\endgroup}%
}{%
\MT@warning@nl{%
Should you receive warnings about unknown slot\MessageBreak
@@ -6754,13 +6778,20 @@ time will almost certainly lead to undesired results. Have your choice!}%
\MT@patch@patch\theIEEEsubequationdis{)}{\rightprotrusion{)}}}%
{}%
% \end{macrocode}
-% \item \cmd\eqref\ relies on \cmd\tagform@, so we have to have it
+% \item \cmd\eqref\ (\pkg{amsmath}) relies on \cmd\tagform@, so we have to have it
% use the original definition.
% \begin{macrocode}
\@ifpackageloaded{amsmath}
{\MT@patch@patch\tagform@{(}{\leftprotrusion{(}}%
\MT@patch@patch\tagform@{)}{\rightprotrusion{)}}%
- \MT@patch@patch\eqref{\tagform@}{\@nameuse{MT@patch@saved@\string\tagform@}}%
+% \end{macrocode}
+% The command has been made robust in 2022.
+%\changes{v3.0e}{2022/05/21}{protrusion patch \texttt{eqnum}: adjust to robustness of \cmd\eqref\
+% (\LaTeX\ 2022-06-01), cf. \githubissue{19}}
+% \begin{macrocode}
+ \MT@ifdefined@n@TF{eqref }
+ {\MT@exp@cs\MT@patch@patch{eqref }}{\MT@patch@patch\eqref}
+ {\tagform@}{\@nameuse{MT@patch@saved@\string\tagform@}}%
% \end{macrocode}
% \item If the user has altered the tags' appearance via \pkg{mathtools}'s \cmd\newtagform\
% interface, our patch won't have any effect. We don't issue a warning
@@ -6790,13 +6821,25 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\changes{v3.0}{2021/05/25}{protrusion patch for footnote text}^^A
%\changes{v3.0c}{2022/01/21}{protrusion patch \texttt{footnote}: also for minipages}^^A
% \begin{itemize}
-% \item \pkg{hyperref} also patches this command (but only if |hyperfootnotes=true|)
+% \item \pkg{hyperref} also patches this command (but only if |hyperfootnotes=true|,
+% |implicit=true| and \cmd\hyper@nopatch@footnote\ is undefined)
%\changes{v3.0a}{2021/11/30}{fix protrusion patch \texttt{footnote} with \pkg{hyperref}
% (reported by \contributor Liang-Bo Wang <@\at @>) \githubissue{2}}
+%\changes{v3.0e}{2022/05/13}{fix protrusion patch \texttt{footnote} for \pkg{hyperref}
+% with option \texttt{implicit!=false}}
+%\changes{v3.0e}{2022/05/21}{fix protrusion patch \texttt{footnote} for \pkg{hyperref}
+% if \cmd\hyper@nopatch@footnote\ is defined}
% \begin{macrocode}
\MT@define@patch{footnote}{%
\@ifpackageloaded{hyperref}
- {\ifHy@hyperfootnotes\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ {\MT@if@false
+ \ifHy@implicit
+ \ifHy@hyperfootnotes
+ \MT@ifdefined@c@TF\hyper@nopatch@footnote\relax
+ \MT@if@true
+ \fi
+ \fi
+ \ifMT@if@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\@secondoftwo
{\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
\MT@patch@patch\@footnotetext{\@empty\ignorespaces}{\@empty\ignorespaces\leftprotrusion}%
@@ -6810,20 +6853,29 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \item \cls{memoir} additionally allows footnotes in the margins
% \begin{macrocode}
{\@ifclassloaded{memoir}
- {\MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}%
- \MT@patch@patch\@mpfootnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}}
- {\MT@patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ {\MT@patch@patch\@footnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}%
+ \MT@patch@patch\@mpfootnotetext{\foottextfont #1}{\foottextfont\leftprotrusion #1}}
+% \end{macrocode}
+% \item \cls{beamer} has it its own way, of course
+%\changes{v3.0e}{2022/05/13}{fix protrusion patch \texttt{footnote} with \cls{beamer}}
+% \begin{macrocode}
+ {\@ifclassloaded{beamer}
+ {\MT@exp@cs\MT@patch@patch{beamerx@\string\beamer@framefootnotetext}
+ {\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT@exp@cs\MT@patch@patch{beamerx@\string\@mpfootnotetext}
+ {\ignorespaces}{\ignorespaces\leftprotrusion}}
% \end{macrocode}
% \item the <\cls{KOMA}> classes (which load \pkg{scrkbase})
%\changes{v3.0a}{2021/12/02}{fix protrusion patch \texttt{footnote} with <\cls{KOMA}> classes
% (reported by \contributor MisterFiLou <@\at @>) \githubissue{2}}
% \begin{macrocode}
- \@ifpackageloaded{scrkbase}
- {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
+ {\@ifpackageloaded{scrkbase}
+ {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
% \end{macrocode}
% \item the base classes
% \begin{macrocode}
- {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}%
+ {\MT@patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
+ \MT@patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}%
}{}%
% \end{macrocode}
% \end{itemize}
@@ -7181,7 +7233,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\csname ifMT@\csname MT@abbr@#1\endcsname\endcsname
% \end{macrocode}
% Begin with setting micro-typography to true for this font. The
-% \cs{MT@checklist@...} tests will set it to false if the property is not in
+% |\MT@checklist@...| tests will set it to false if the property is not in
% the list. The first non-empty list that does not contain a match will stop us
% (except for |font|).
% \begin{macrocode}
@@ -8069,6 +8121,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\DeclareRobustCommand\noprotrusionifhmode{\relax\ifhmode\kern-\p@\kern\p@\fi}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\ifMT@prot@}
%\begin{macro}{\leftprotrusion}
%\changes{v3.0}{2021/05/15}{new command}
% This command may be used to add protrusion on the left hand side.
@@ -8083,10 +8136,13 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
\DeclareRobustCommand\leftprotrusion{%
\MT@toks{}%
- \MT@prot@get@firstchar
+ \MT@prot@false
+ \MT@prot@get@firstgroup
}
+\newif\ifMT@prot@
% \end{macrocode}
%\end{macro}
+%\end{macro}
%\begin{macro}{\MT@prot@l}
%\changes{v3.0b}{2021/12/05}{make \cmd\long\ again
% (reported by \contributor Akira Yokosawa <@\at @>) \githubissue{3}}
@@ -8126,6 +8182,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
% (reported by \contributor florian <@\at @>)}^^A
% ^^A https://tex.stackexchange.com/questions/624171/overfull-vbox-in-list-of-figures-since-miktex-update
%\changes{v3.0b}{2021/12/05}{unconditionally \cmd\leavevmode}^^A
+%\changes{v3.0e}{2022/06/16}{revert \cmd\leavevmode}^^A
% We set various penalties to zero to allow linebreaking, and don't
% bother if the split box is overfull (but shouldn't we? -- after all,
% that's how the penalties bug was discovered~\dots).
@@ -8133,29 +8190,29 @@ time will almost certainly lead to undesired results. Have your choice!}%
% (reported by \contributor Brian Dunn <@\at @>) \githubissue{14}}
% (We no longer reset counters etc., since we don't typeset groups anymore.)
%\begin{macro}{\MT@prot@hook}
-% Furthermore, we have a hook for compatibility fixes (not used at the moment),
+% Furthermore, we have a hook for compatibility fixes (currently used for \pkg{csquotes} only),
%\begin{macro}{\MT@csq@eqgroup}
%\changes{v3.0c}{2022/01/06}{compatibility for \pkg{csquotes}, again
% (reported by \contributor NightShade <@\at @>)}
% ^^A https://tex.stackexchange.com/questions/629068/microtype-quotation-marks-in-itemize-not-aligned-properly-at-begin-of-an-item
-% and a command for \pkg{csquotes}'s grouping (because we actually typeset
+% and a dedicated command to end \pkg{csquotes}'s group (because we actually typeset
% the quote character, instead of disabling quotes altogether (as we suggested
% for \githubissue{1}, which was wrong)).
+%\changes{v3.0e}{2022/04/05}{add \cmd\relax\ (for \pkg{csquotes})}
+% Compatibility with \pkg{csquotes} is also the reason for the extra \cmd\relax\ after \meta{\#1}.
%\begin{macro}{\MT@noindent}
%\changes{v3.0c}{2022/01/14}{use \cmd\RawNoindent, if available \githubissue{8}}
% Finally, \LaTeX's new paragraph hooks require special attention, as they're
% (currently?) unable to distinguish between real typesetting and trial runs.
% In our case, fortunately, we really don't want to trigger the hooks.
-% Also, we don't need a \cmd\RawParEnd\ at the end (as suggested in \file{ltpara}),
-% I think, as none of our commands are \cmd\long\ anymore.
+% Also, as far as I can tell, we don't need a \cmd\RawParEnd\ at the end
+% (as suggested in \file{ltpara}), because none of our commands are \cmd\long\ anymore.
% \begin{macrocode}
\let\MT@prot@hook\@empty
\let\MT@csq@eqgroup\relax
-\ifx\RawNoindent\@undefined
- \let\MT@noindent\noindent
-\else
- \let\MT@noindent\RawNoindent
-\fi
+\IfFormatAtLeastTF{2021/11/15}
+ {\let\MT@noindent\RawNoindent}
+ {\let\MT@noindent\noindent}
\def\MT@get@prot#1#2{%
\begingroup
\setbox\MT@tempbox\vbox{%
@@ -8167,7 +8224,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
\interlinepenalty\z@
\@newlistfalse
\MT@prot@hook
- \MT@noindent #1\MT@csq@eqgroup}%
+ \MT@noindent #1\relax\MT@csq@eqgroup}%
\vbadness=\@M
\splittopskip=\z@
\vfuzz=\maxdimen
@@ -8179,13 +8236,17 @@ time will almost certainly lead to undesired results. Have your choice!}%
\fi
}%
\endgroup
- \leavevmode
\ifhbox\MT@tempbox
\@tempdima=\@nameuse{#2marginkern}\MT@tempbox\relax
\expandafter\ifdim\@tempdima=\z@ \else
+ \leavevmode
\MT@vinfo{|<< adding #2 margin kern for `#1':\MessageBreak
\the\@tempdima \on@line}%
\kern\@tempdima
+%<debug>%\vbox to0pt{\vss\llap{\fbox{%
+%<debug>% \MT@ifstreq{#2}{left}{\kern\@tempdima}\relax
+%<debug>% \kern-\fboxsep\unhbox\MT@tempbox\kern-\fboxsep
+%<debug>% \MT@ifstreq{#2}{right}{\kern\@tempdima}\relax}\hskip\marginparsep}}%
\fi
\fi
}
@@ -8212,30 +8273,18 @@ time will almost certainly lead to undesired results. Have your choice!}%
%\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 \contributor Joseph Wright <@\at @>). ^^A https://tex.stackexchange.com/a/331696/
-% Only works with \etex.
+%^^A (inspired by \contributor Joseph Wright <@\at @>). ^^A https://tex.stackexchange.com/a/331696/
+%\changes{v3.0e}{2022/06/15}{use \pkg{etoolbox} facilities}
+% As we're using \pkg{etoolbox} here, this 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
+^^X\def\MT@prot@ifmacro@{%
+^^X \ifdefmacro\MT@prot@next{\ifdefparam\MT@prot@next\@gobble\@firstofone}\@gobble}
^^Q\let\MT@prot@ifmacro\@gobble
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\end{macro}
%\begin{macro}{\MT@prot@iffirstcmd}
% Test whether the first token in \cs{MT@prot@next} (once expanded) is the
% command \meta{\#1}. Since \cs{MT@prot@next} may also be user-defined (or
@@ -8273,22 +8322,48 @@ time will almost certainly lead to undesired results. Have your choice!}%
\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}}%
+ \def\MT@temp*##1##2{\MT@prot@l{\the\MT@toks##1##2}}%
\else
- \def\MT@temp*##1{\MT@prot@l{##1}}%
+ \def\MT@temp*##1{\MT@prot@l{\the\MT@toks##1}}%
\fi
- \@gobble
- }\@firstofone
+ \MT@tlist@break
+ }\relax
+}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@enc@list}
+%\changes{v3.0e}{2022/06/09}{new macro: no more guesswork about encodings}
+% The list of all loaded font encodings. For \LaTeX\ formats older than
+% 2020/02/11 (before \cmd\@fontenc@load@list\ was introduced), we don't
+% bother doing any guesswork (like \pkg{babel} used to do). Also, we
+% don't consider the older <EU1>/<EU2> encodings.
+% \begin{macrocode}
+%<pdf-|lua-|xe->\def\MT@enc@list
+%<pdf-> {{T1}{OT1}}
+%<lua-|xe-> {{TU}}
+%<*package>
+\MT@addto@setup{%
+ \ifx\@fontenc@load@list\@undefined \else
+ \def\@elt#1{,#1,}%
+ \edef\@tempa{\@fontenc@load@list}%
+ \MT@map@clist@c\@tempa{%
+ \MT@ifempty{#1}\relax{%
+ \MT@in@tlist{#1}\MT@enc@list
+ \ifMT@inlist@\else\edef\MT@enc@list{\MT@enc@list{#1}}\fi
+ }%
+ }%
+ \fi
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT@prot@group}
+%\begin{macro}{\MT@prot@addgroup}
%\changes{v3.0a}{2021/11/20}{rescan grouped material to allow \texttt{verbatim} etc.
% (reported by \contributor Torsten Schuetze <torsten.schuetze\at gmx.net>)}
% ^^A private mail, 2021/11/18
% ^^A also on the non-public dante-ev mailing list: https://lists.dante.de/mailman/listinfo/dante-ev
-% If we have a group, we inject \cs{MT@prot@get@firstchar} at the
-% beginning again and don't bother about the rest. This still allows,
+% If we have a group, we inject \cs{MT@prot@get@firsttoken} at the
+% beginning and don't bother about the rest. This still allows,
% \eg, |\verb|, |verbatim| or |lstlistings| material.
% The downside of being this cautious is that we'll miss lots of cases.
%\changes{v3.0b}{2021/12/05}{don't rescan anymore
@@ -8296,75 +8371,158 @@ time will almost certainly lead to undesired results. Have your choice!}%
% and \contributor theufman <@\at @>) \githubissue{3,4}}
%\changes{v3.0d}{2022/02/26}{no brace delimiting
% (reported by \contributor Nelson Lago <@\at @>) \githubissue{10}}
+%\changes{v3.0e}{2022/06/16}{only add group if very first token}
% \begin{macrocode}
-\def\MT@prot@group{\bgroup\afterassignment\MT@prot@get@firstchar\let\MT@temp= }
+\def\MT@prot@addgroup{\bgroup\afterassignment\MT@prot@get@firsttoken\let\MT@temp= }
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT@prot@get@firstchar}
-%\begin{macro}{\MT@prot@get@nextchar}
+%\begin{macro}{\MT@prot@get@firstgroup}
+%\begin{macro}{\MT@prot@get@firsttoken}
+%\begin{macro}{\MT@prot@get@nexttoken}
% 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}
+\def\MT@prot@get@firstgroup{\futurelet\MT@prot@next\MT@prot@get@first@group}
+\def\MT@prot@get@firsttoken{\futurelet\MT@prot@next\MT@prot@get@first@token}
+\def\MT@prot@get@nexttoken{\futurelet\MT@prot@next\MT@prot@get@next@token}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@prot@check}
+%\begin{macro}{\MT@prot@check@}
+% We map through a list of commands that should be copied into the toks.
+% \begin{macrocode}
+\def\MT@prot@check#1{\MT@prot@check@#1}
+\def\MT@prot@check@#1#2{%
+ \ifx\MT@prot@next#2%
+ \MT@prot@true
+ \csname MT@prot@check@#1\endcsname
+ \let\MT@prot@ifmacro\@gobble
+ \expandafter\MT@tlist@break
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT@prot@check@I}
+% This is for commands to be \textbf{I}gnored.
+% \begin{macrocode}
+\def\MT@prot@check@I{%
+ \def\MT@temp*##1{\MT@prot@get@firsttoken}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@check@S}
+% Add a \textbf{S}ingle command (without an argument).
+% \begin{macrocode}
+\def\MT@prot@check@S{%
+ \def\MT@temp*##1{\MT@toks\expandafter{\the\MT@toks##1}\MT@prot@get@firsttoken}%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@check@X}
+% Add a command with \textbf{O}ne argument.
+% \begin{macrocode}
+\def\MT@prot@check@O{%
+ \def\MT@temp*##1##2{\MT@toks\expandafter{\the\MT@toks##1{##2}}\MT@prot@get@firsttoken}%
+}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\MT@prot@check@T}
+% Add a command with \textbf{T}wo arguments.
+% \begin{macrocode}
+\def\MT@prot@check@T{%
+ \def\MT@temp*##1##2##3{\MT@toks\expandafter{\the\MT@toks##1{##2}{##3}}\MT@prot@get@firsttoken}%
+}
+% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT@prot@get@first@char}
-% If next char is |{|, treat what follows as an argument, else continue until
+%\begin{macro}{\MT@prot@check@cmds}
+%\changes{v3.0e}{2022/06/09}{new macro: make list of commands extensible}
+%\changes{v3.0e}{2022/05/13}{ignore \cmd\@empty}
+%\changes{v3.0e}{2022/06/15}{add standard font selection commands}
+% Here's the list of commands to be added to our toks.
+% We'll postpone the handling of commands whose argument would have
+% to be processed (\eg, \cmd\textrm).
+% \begin{macrocode}
+\def\MT@prot@check@cmds{%
+ {I\ignorespaces}{I\relax}{I\@empty}%
+ {S\rmfamily}{S\sffamily}{S\ttfamily}{S\mdseries}{S\bfseries}%
+ {S\upshape}{S\slshape}{S\itshape}{S\scshape}%
+ {S\normalfont}{S\selectfont}%
+ {S\tiny}{S\scriptsize}{S\footnotesize}{S\small}{S\normalsize}%
+ {S\large}{S\Large}{S\LARGE}{S\huge}{S\Huge}%
+ {O\fontencoding}{O\fontfamily}{O\fontseries}{O\fontshape}%
+ {T\fontsize}%
+}
+% \end{macrocode}
+%\end{macro}
+% If \pkg{yfonts} is loaded, we add the relevant commands (again, those that
+% don't take an argument).
+% \begin{macrocode}
+\MT@addto@setup{%
+ \MT@with@package@T{yfonts}
+ {\g@addto@macro\MT@prot@check@cmds{{S\frakfamily}{S\swabfamily}{S\gothfamily}}}%
+}
+% \end{macrocode}
+%\begin{macro}{\MT@prot@get@first@group}
+% If next char is |{|, start a group and try again, else continue until
% we find a beginning char.
% \begin{macrocode}
-\def\MT@prot@get@first@char{%
+\def\MT@prot@get@first@group{%
\MT@prot@ifcat\bgroup{%
- \def\MT@temp*{\MT@prot@group}%
+ \def\MT@temp*{\MT@prot@addgroup}%
+ }{%
+ \def\MT@temp*{\MT@prot@get@first@token}%
+ }%
+ \MT@temp*%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@get@first@token}
+%\changes{v3.0e}{2022/06/15}{don't gobble previously captured content}
+% This can be called repeatedly.
+% We add a letter or other character, \dots
+% \begin{macrocode}
+\def\MT@prot@get@first@token{%
+ \def\MT@temp*{\ifMT@prot@\MT@prot@l{\the\MT@toks}\fi}%
+ \MT@prot@ifcat{a}{%
+ \def\MT@temp*{\MT@prot@addtoken@first}%
}{%
- \MT@prot@ifx\ignorespaces{%
- \def\MT@temp*##1{\MT@prot@get@firstchar}%
+ \MT@prot@ifcat{!}{%
+ \def\MT@temp*{\MT@prot@addtoken@first}%
}{%
- \MT@prot@ifx\relax{%
- \def\MT@temp*##1{\MT@prot@get@firstchar}%
+% \end{macrocode}
+% a space character, \dots
+% \begin{macrocode}
+ \MT@prot@ifx\@sptoken{%
+ \def\MT@temp* {\MT@prot@get@firsttoken}%
}{%
- \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
+% commands, \dots
% \begin{macrocode}
- \MT@prot@ifcat{a}{%
- \def\MT@temp*{\MT@prot@addtoken@first}%
+ \let\MT@prot@ifmacro\MT@prot@ifmacro@
+ \MT@map@tlist@c\MT@prot@check@cmds\MT@prot@check
+% \end{macrocode}
+% \dots~or a command/active char whose first command is one of the following.
+% \begin{macrocode}
+ \MT@prot@ifmacro{%
+ \MT@prot@iffirstcmd\UTFviii@two@octets{%
+ \def\MT@temp*##1##2{\MT@prot@l{\the\MT@toks##1##2}}%
}{%
- \MT@prot@ifcat{!}{%
- \def\MT@temp*{\MT@prot@addtoken@first}%
+ \MT@prot@iffirstcmd\UTFviii@three@octets{%
+ \def\MT@temp*##1##2##3{\MT@prot@l{\the\MT@toks##1##2##3}}%
}{%
+ \MT@prot@iffirstcmd\UTFviii@four@octets{%
+ \def\MT@temp*##1##2##3##4{\MT@prot@l{\the\MT@toks##1##2##3##4}}%
+ }{%
% \end{macrocode}
-% \dots~or a command/active char whose first command is one of the below.
+% (this is for \pkg{csquotes})
% \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@iffirstcmd\csqQQ{\def\MT@temp*##1{\MT@prot@l{\the\MT@toks##1}}}{%
% \end{macrocode}
-% (this is for \pkg{csquotes})
+% or, finally, a <LICR> command.
% \begin{macrocode}
- \MT@prot@iffirstcmd\csqQQ{\def\MT@temp*##1{\MT@prot@l{##1}}}{%
- \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@map@tlist@c\MT@enc@list\MT@prot@iflicrcmd
}%
}%
}%
@@ -8377,10 +8535,19 @@ time will almost certainly lead to undesired results. Have your choice!}%
}
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT@prot@ifx}
+%\begin{macro}{\MT@prot@addtoken@first}
+% Begin filling toks.
+% \begin{macrocode}
+\def\MT@prot@addtoken@first#1{%
+ \MT@toks\expandafter{\the\MT@toks#1}%
+ \MT@prot@get@nexttoken
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT@prot@get@next@token}
% Continue if letter or other.
% \begin{macrocode}
-\def\MT@prot@get@next@char{%
+\def\MT@prot@get@next@token{%
\def\MT@temp*{\MT@prot@addtoken@next}%
\MT@prot@ifcat{a}\relax{%
\MT@prot@ifcat{!}\relax{%
@@ -8389,15 +8556,6 @@ time will almost certainly lead to undesired results. Have your choice!}%
}%
\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}
@@ -8408,12 +8566,12 @@ time will almost certainly lead to undesired results. Have your choice!}%
% \begin{macrocode}
%<*pdf-|lua-|xe->
\def\MT@prot@addtoken@next#1{%
- \edef\MT@temp{\MT@toks={\the\MT@toks\noexpand#1}}\MT@temp
+ \MT@toks\expandafter{\the\MT@toks#1}%
\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@get@nexttoken
{\MT@prot@l{\the\MT@toks}}%
}
%</pdf-|lua-|xe->
@@ -8939,7 +9097,7 @@ time will almost certainly lead to undesired results. Have your choice!}%
%<*pdf->
\MT@requires@pdftex8\@firstofone{%
\MT@ifdefined@n@TF{\MT@@font-fake6}{%
- \expandafter\ifx\csname\MT@@font-fake6\endcsname\@empty
+ \MT@exp@cs\ifx{\MT@@font-fake6}\@empty
\MT@warning@nl{%
Font `\MT@@font' does not specify its\MessageBreak
\@backslashchar fontdimen 6 (width of an `em')! Therefore,\MessageBreak
@@ -10806,6 +10964,7 @@ end
% \begin{macrocode}
\MT@ifdefined@c@T\PrerenderUnicode
{\PrerenderUnicode{\@tempa}\let\unicode@charfilter\@firstofone}%
+ \MT@is@active@hook{#1}%
% \end{macrocode}
% The \cmd\expandafter\ hocus-pocus should please \pkg{newunicodechar}.
%\changes{v2.7a}{2017/11/25}{compatibility with \pkg{newunicodechar}
@@ -10826,6 +10985,62 @@ end
}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\MT@is@active@hook}
+%\changes{v3.0e}{2022/05/22}{hook for active chars}
+% Test for these packages only once (requires \pkg{etoolbox}).
+% \begin{macrocode}
+\let\MT@is@active@hook\@gobble
+^^Q\@gobble
+{\catcode`\#=12
+\MT@addto@setup{%
+% \end{macrocode}
+% If a char has been made active by \pkg{listings}'s \cmd\lstMakeShortInline,
+%\changes{v3.0e}{2022/05/21}{fix for \pkg{listings}'s \cmd\lstMakeShortInline\
+% (reported by \contributor Denis Bitouz\'e <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/644665/lstmakeshortinline-fails-with-some-characters-when-luatex-ja-and-microtype-are
+% we need to retrieve the original meaning, or else make sure that we're
+% seeing a non-active char.
+% \begin{macrocode}
+ \MT@with@package@T{listings}{%
+ \apptocmd\MT@is@active@hook{%
+ \MT@ifdefined@n@T{lst@ShortInlineOldCatcode\string#1}{%
+ \catcode`#1=\csname lst@ShortInlineOldCatcode\string#1\endcsname\relax
+ \ifnum\catcode`#1=\active
+ \begingroup
+ \catcode`\~\active \lccode`\~`#1%
+ \lowercase{\endgroup
+ \MT@let@cn~{lst@ShortInlineOldMeaning\string#1}}%
+ \else
+ \def\@tempa{#1}%
+ \fi
+ }%
+ }{}{}%
+ }%
+% \end{macrocode}
+% Same for \cmd\MakeShortVerb\ of \pkg{doc}/\pkg{shortvrb} (and implicitly \cls{memoir}).
+%\changes{v3.0e}{2022/05/22}{fix for \pkg{doc}/\pkg{shortvrb}'s \cmd\MakeShortVerb}
+% \begin{macrocode}
+ \MT@if@false
+ \MT@with@package@T{doc}\MT@if@true
+ \MT@with@package@T{shortvrb}\MT@if@true
+ \ifMT@if@\expandafter\@firstofone\else\expandafter\@gobble\fi{%
+ \apptocmd\MT@is@active@hook{%
+ \MT@ifdefined@n@T{cc\string#1}{%
+ \catcode`#1=\csname cc\string#1\endcsname\relax
+ \ifnum\catcode`#1=\active
+ \begingroup
+ \catcode`\~\active \lccode`\~`#1%
+ \lowercase{\endgroup
+ \MT@let@cn~{ac\string#1}}%
+ \else
+ \def\@tempa{#1}%
+ \fi
+ }%
+ }{}{}%
+ }%
+}}
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\MT@undefined@char}
% For characters not defined in the current input encoding.
% \begin{macrocode}
@@ -10837,7 +11052,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 \cmd\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{%
@@ -10886,8 +11101,7 @@ end
\def\MT@is@opt@char#1\iffontchar#2\char#3\else#4\fi\relax{%
\MT@ifempty{#1}{%
\iffontchar#2%
- \expandafter\chardef
- \csname\MT@encoding\MT@detokenize@c\@tempa\endcsname=#3\relax
+ \MT@exp@cs\chardef{\MT@encoding\MT@detokenize@c\@tempa}=#3\relax
\fi
}\relax
}
@@ -11047,7 +11261,7 @@ end
% \end{macrocode}
%\end{macro}
% [What about math? Well, for a moment the following looked like a solution, with
-% \cs{mt@is@mathchar} defined accordingly, analogous to \cs{MT@is@char} above,
+% \cmd\mt@is@mathchar\ defined accordingly, analogous to \cs{MT@is@char} above,
% to pick up the last two tokens (the \cmd\meaning\ of a \cmd\mathchardef'ed
% command expands to its hexadecimal notation):
%\begin{verbatim}
@@ -11814,7 +12028,7 @@ end
%\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}}%
+ {\edef\MT@val{\MT@exp@cs\noexpand{\@tempa default}}}%
{\MT@warning{`\@backslashchar\@tempa default' is not a defined command.\MessageBreak
Ignoring `#1 = {\@tempa*}' in font set\MessageBreak`\MT@curr@set@name'}%
\let\MT@val\@empty}%
@@ -14551,7 +14765,7 @@ end
% \begin{macrocode}
\MT@ifdefined@n@TF{showhyphens }{%
\def\MT@temp##1##2{%
- \expandafter\CheckCommand\csname showhyphens \endcsname[1]{##1}%
+ \MT@exp@cs\CheckCommand{showhyphens }[1]{##1}%
\DeclareRobustCommand\showhyphens[1]{##2}}%
}{%
\def\MT@temp##1##2{%
@@ -15204,9 +15418,9 @@ end
% The \pkg{newtx} package, a replacement for \pkg{txfonts}.
%\changes{v2.7}{2017/02/25}{declare aliases for \pkg{newtx}}
% \begin{macrocode}
-\DeclareMicrotypeAlias{ntxlf}{ptmx} % newtxtext
-\DeclareMicrotypeAlias{ntxosf}{ptmj} % "
-\DeclareMicrotypeAlias{ntxtlf}{ptmx} % "
+\DeclareMicrotypeAlias{ntxlf} {ptmx} % newtxtext
+\DeclareMicrotypeAlias{ntxtlf} {ptmx} % "
+\DeclareMicrotypeAlias{ntxosf} {ptmj} % "
\DeclareMicrotypeAlias{ntxtosf}{ptmj} % "
% \end{macrocode}
% The \pkg{tempora} package.
@@ -15221,12 +15435,17 @@ end
\DeclareMicrotypeAlias{STEP-TLF} {ptmx} % step
\DeclareMicrotypeAlias{STEP-TOsF}{ptmj} % "
% \end{macrocode}
-% The \pkg{stix} and \pkg{stix2} packages (the latter has departed a bit from being
-% a Times clone, but still seems close enough).
+% The \pkg{stix}, \pkg{stix2} and \pkg{stickstoo} packages (the latter two have departed a bit from being
+% a Times clone, but still seem close enough).
%\changes{v2.8}{2020/05/31}{declare aliases for \pkg{stix} and \pkg{stix2} fonts}
+%\changes{v3.0e}{2022/05/23}{declare aliases for \pkg{stickstoo} fonts}
% \begin{macrocode}
\DeclareMicrotypeAlias{stix} {ptm} % stix
\DeclareMicrotypeAlias{stix2}{ptm} % stix2
+\DeclareMicrotypeAlias{SticksTooText-LF} {ptmx}
+\DeclareMicrotypeAlias{SticksTooText-TLF} {ptmx}
+\DeclareMicrotypeAlias{SticksTooText-OsF} {ptmj}
+\DeclareMicrotypeAlias{SticksTooText-TOsF}{ptmj}
% \end{macrocode}
%\todo{check Times variants}
% More Times variants, to be checked: |pns|, |mns| (TimesNewRomanPS); |mnt|
@@ -19773,7 +19992,7 @@ This is the current font stretched by 5\%, normal, and shrunk by 5\%:
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \CheckSum{12387}
+% \CheckSum{12609}
%
% \Finale
%