From 405f8ac93dcae9c7e56e13aa55c39f32d45979de Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 7 Mar 2023 22:24:33 +0000 Subject: microtype (7mar23) (branch) git-svn-id: svn://tug.org/texlive/branches/branch2022.final@66448 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/microtype/microtype-utf.dtx | 4 +- .../source/latex/microtype/microtype.dtx | 673 ++++++++++++++++----- .../source/latex/microtype/microtype.ins | 2 +- 3 files changed, 511 insertions(+), 168 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx b/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx index fc6226a095a..380619cf8ce 100644 --- a/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx +++ b/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx @@ -3,7 +3,7 @@ % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection -% Copyright (c) 2004--2022 R Schlicht +% Copyright (c) 2004--2023 R Schlicht % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3c of this license or (at @@ -27,7 +27,7 @@ \ProvidesFile % %<*driver> - {\jobname.dtx}[2022/06/23 v3.0f] + {\jobname.dtx}[2023/03/06 v3.1] % % {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)] % {mt-LatinModernRoman.cfg}[2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS)] diff --git a/Master/texmf-dist/source/latex/microtype/microtype.dtx b/Master/texmf-dist/source/latex/microtype/microtype.dtx index 1df1413136a..db89547894b 100644 --- a/Master/texmf-dist/source/latex/microtype/microtype.dtx +++ b/Master/texmf-dist/source/latex/microtype/microtype.dtx @@ -3,7 +3,7 @@ % ------------------------------------------------------------------------ % The `microtype' package % Subliminal refinements towards typographical perfection -% Copyright (c) 2004--2022 R Schlicht +% Copyright (c) 2004--2023 R Schlicht % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3c of this license or (at @@ -37,7 +37,7 @@ % {microtype-luatex.def} % {microtype-xetex.def} %<*package|letterspace|m-t|pdf-|lua-|xe-|show> - [2022/06/23 v3.0f + [2023/03/06 v3.1 % Micro-typographical refinements % Robust letterspacing % Visual debugging for the microtype package @@ -52,8 +52,8 @@ %local microtype = microtype %microtype.module = { % name = "microtype", -% version = "3.0f", -% date = "2022/06/23", +% version = "3.1", +% date = "2023/03/06", % description = "microtype module.", % author = "E. Roux, R. Schlicht and P. Gesang", % copyright = "E. Roux, R. Schlicht and P. Gesang", @@ -343,7 +343,7 @@ \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 + Numbers in italic shape 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 @@ -616,7 +616,8 @@ \DeclareMicrotypeSetDefault,\SetProtrusion,\SetExpansion,\SetTracking, \SetExtraKerning,\SetExtraSpacing,\DisableLigatures,\DeclareCharacterInheritance, \DeclareMicrotypeVariants,\DeclareMicrotypeAlias,\DeclareMicrotypeBabelHook, - \LoadMicrotypeFile,\microtypecontext,\textmicrotypecontext,\textls,\lsstyle,\lslig, + \LoadMicrotypeFile,\DeclareMicrotypeFilePrefix,\microtypecontext,\textmicrotypecontext, + \textls,\lsstyle,\lslig, \leftprotrusion,\rightprotrusion,\noprotrusion,\noprotrusionifhmode, \Microtype@Hook}, keywordstyle=[0]\color{thegreen}, @@ -670,7 +671,7 @@ 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--2022 R Schlicht\textLF + pdfcopyright={\textcopyright\ 2004--2023 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.\textLF @@ -723,7 +724,8 @@ \def\mailtoRS{\href % some PDF viewers don't like spaces: {mailto:Robert\%20Schlicht\%3cw.m.l@gmx.net\%3e?subject=[microtype\%20\fileversion]} {\texttt{w.m.l@gmx.net}}} - % the samples in the introduction, utilising nested optional content groups (aka. layers): + % the samples in the introduction, utilising nested optional content groups (aka. layers) + % (nowadays, I would be using one of the ocg packages, but none of them existed back then (2005)): \ifnum\pdftexversion<140 \else \def\mt@layer#1#2{\pdfliteral page{/OC/#1 BDC}#2\pdfliteral page{EMC}} \ifx\mt@objects\@undefined\let\mt@objects\@empty\fi @@ -960,7 +962,7 @@ % other extensions (see section~\ref{sec:lettersp}\ifcodedoc\space of the User manual\fi). % %\bigskip\noindent -% This package is copyright \textcopyright\ 2004\kern.09em--2022 R Schlicht. +% This package is copyright \textcopyright\ 2004\kern.09em--2023 R Schlicht. % It may be distributed and/or modified under the conditions of the % \IfFileExists{lppl.tex}{\hyperref[LPPL:LPPL]}{\href{https://www.latex-project.org/lppl/}} % {\LaTeX\ Project Public License}, @@ -2506,6 +2508,12 @@ % section~\ref{sub:hook}.} % This command will load the file `|mt-|\meta{font name}|.cfg|'. % +%\medskip +%\Describe{Macro}{\DeclareMicrotypeFilePrefix}{prefix} +% Or, in fact, it will load the file `\meta{prefix}|-|\meta{file name}|.cfg|'. +% The \meta{prefix} may be changed, which, however, you should only do +% if you have your own set of configuration files that you want to be +% loaded \emph{instead of} any of those provided with the package. % %\section{Context-sensitive setup}\label{sec:context} % @@ -2639,8 +2647,8 @@ %\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 (cf. -% section~\ref{sub:tracking}), you usually need not worry +% `\texttt{no ligatures}' key for the respective font (as well as all other +% options mentioned in section~\ref{sub:tracking}), 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. For @@ -2648,17 +2656,17 @@ % `ck', `tz' and `sz'~(`\textfrak{sz}') should never be broken up; you also usually % see the `st'~(`\textfrak{st}') ligature in letterspaced text. Furthermore, at % least the \pkg{yfonts} package realises the short~s~(`\textfrak{s:}') as the -% ligature~`|s:|'. On the other hand, the `ct'~ligature and the other `long~s' +% pseudo-ligature~`|s:|'. On the other hand, the `ct'~ligature and the other `long~s' % ligatures often found in Fraktur fonts should be suppressed. There are two % ways of solving this problem: either don't disable the `|s|' and/or `|c|' % ligatures and break those that need to be broken up by inserting -% `|{\kern0pt}|' or \pkg{babel}'s \verb="|= shortcut; or disable them and +% `|{\kern0pt}|' or \pkg{babel}'s~\verb="|= shortcut; or disable them and % protect those ligatures that need to be protected by enclosing them in the % \cs{lslig} command. So, the following two solutions have the same result % (namely, `\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 here highlighted in green, inhibited ligatures in red). +% with ligatures here highlighted in green, inhibited ligatures in red): % %\begin{verbatim}[morekeywords={[0]{\kern}}] %\SetTracking[no ligatures={f}]{encoding = LY, family = yfrak}{120} @@ -2759,8 +2767,8 @@ % %\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): +% right (indicated in parentheses are dedicated patches for classes and packages +% beyond the standard ones; 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}} @@ -2773,20 +2781,22 @@ % slightly shifted to the right. % This patch also affects environments such as |quote| or |flushleft|, which are % implemented in \LaTeX\ as lists starting with an implicit empty item. -% \MTsupp{standard classes, \cls{beamer}, \cls{simplecv}} +% \MTsupp{\cls{beamer}, \cls{simplecv}} % \item[toc] Adds protrusion at the left margins of sectioning titles in the Table of Contents % and similar Lists of \meta{Things}. -% \MTsupp{standard classes, \cls{memoir}} +% \MTsupp{\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, \cls{beamer}, \pkg{hyperref}} +% \MTsupp{\cls{memoir}, <\cls{KOMA}> classes, \cls{beamer}, \pkg{hyperref}} +% \item[verbatim] Disables protrusion and expansion in verbatim environments. +% \MTsupp{\pkg{alltt}} % \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: %\begin{verbatim}[belowskip=-\smallskipamount] %\newtagform{mytag}[\textbf]{\leftprotrusion{(}}{\rightprotrusion{)}} %\end{verbatim}^^A -% \MTsupp{standard classes, \pkg{amsmath}, \cls{IEEEtran}} +% \MTsupp{\pkg{amsmath}, \cls{IEEEtran}} %\endlist\endgroup % %\medskip\noindent @@ -2924,8 +2934,8 @@ %\end{verbatim} %\fi % +%\iffalse %\changes{v1.9}{2005/07/10}{add hint about \texttt{verbatim} environment} -%\todo{option to patch \texttt{verbatim}?} ^^A for Karl %\paragraph{You might want to disable protrusion in \texttt{verbatim} environments.} % As you know by now, \microtype\ will by default activate character protrusion % for all fonts contained in the font set `|alltext|'. This also includes the @@ -2949,6 +2959,7 @@ % If you are using the \pkg{fancyvrb} or the \pkg{listings} package, this is % not necessary, since their implementation of the corresponding environments % will inhibit protrusion anyway. +%\fi % %\changes{v1.9e}{2006/07/10}{add hint about unknown encodings} %\paragraph{Settings for Greek/Thai/Armenian etc. encodings are not yet included.} @@ -3038,29 +3049,6 @@ %\lstset{style=message} % \item %\begin{verbatim} -%! Font csnameendcsname= not loadable: Metric (TFM) file not found. -%\end{verbatim} -%\changes{v1.9a}{2005/11/15}{add explanation for error message in mode} -% This error message will occur if you are trying to employ font expansion -% while creating output. Remember that \emph{automatic} font expansion -% only works when running \pdftex\ or \luatex\ in mode. Although expansion is also -% possible in mode with \pdftex, it requires that all instances of the expanded fonts -% exist on your \TeX\ system. -% -% \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 -% trying to apply expansion to a bitmap~(|pk|) font, which is still not -% possible, or that the font isn't found at all, \eg, because of missing map -% entries. -% -% \item -%\begin{verbatim} %Package microtype Warning: Unknown slot number of character %(microtype) `<\k A>' %(microtype) in font encoding `TU' in inheritance list @@ -3083,6 +3071,44 @@ % inheritance and protrusion settings specific to the font in question. % % \item +%\begin{verbatim}[deletekeywords={[1]{patch}}] +%Package microtype Warning: Unable to apply patch `' on input line <29>. +%\end{verbatim} +%\changes{v3.1}{2021/09/15}{add hint about protrusion patch warnings} +% As described in chapter~\ref{sec:pedantic} above, \microtype\ tries to patch a number +% of commands to enable or disable protrusion in certain situations. If you receive a warning +% like the above, you should first make sure (as always) that the package is up to date. +% If it is, consider filing a \href{\githuburl/issues}{bug report}. +% Until a fix is available, or if you are, for whatever reason, unable or unwilling +% to update, the easiest solution to get rid of the warning is to disable the +% problematic patch with the \opt{nopatch} option, \eg: +%\begin{verbatim}[style=microtype] +%\microtypesetup{nopatch={eqnum}} +%\end{verbatim} +% +%% \item +%\begin{verbatim} +%! Font csnameendcsname= not loadable: Metric (TFM) file not found. +%\end{verbatim} +%\changes{v1.9a}{2005/11/15}{add explanation for error message in mode} +% This error message will occur if you are trying to employ font expansion +% while creating output. Remember that \emph{automatic} font expansion +% only works when running \pdftex\ or \luatex\ in mode. Although expansion is also +% possible in mode with \pdftex, it requires that all instances of the expanded fonts +% exist on your \TeX\ system. +% +% \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} +% Beginning with \pdftex\ 1.40, font expansion not only works with Type\,1 fonts +% but also with TrueType, OpenType and even non-embedded fonts. +% The above error message indicates either that you are trying to apply expansion to +% a bitmap~(|pk|) font, which is still not possible, or that the font isn't found +% at all, \eg, because of missing map entries. +% +% \item %\begin{verbatim} %Warning: pdflatex: font cannot be expanded (not an included Type1 font) %\end{verbatim} @@ -3122,7 +3148,6 @@ %! TeX capacity exceeded, sorry [maximum internal font number (font_max)=<2000>]. %\end{verbatim} % Memory parameter `|font_max|' too small. -%\pagebreak ^^A layout % \item %\begin{verbatim} %! TeX capacity exceeded, sorry [PDF memory size (pdf_mem_size)=<65536>]. @@ -3338,9 +3363,12 @@ % \contributor Nelson Lago <@\at @>, ^^A https://github.com/urrameu % \contributor Brian Dunn <@\at @>, ^^A https://github.com/bdtc % \contributor Ralf Steinle , -% \contributor Denis Bitouz\'e <@\at @> ^^A https://tex.stackexchange.com/users/18401/denis-bitouz%c3%a9 +% \contributor Denis Bitouz\'e <@\at @>, ^^A https://tex.stackexchange.com/users/18401/denis-bitouz%c3%a9 +% \contributor Christophe Dervieux <@\at @>, ^^A https://github.com/cderv +% \contributor Shen Zhou Hong <@\at @>, ^^A https://github.com/ShenZhouHong +% \contributor David Purton <@\at @> ^^A https://github.com/dcpurton % and -% \contributor Christophe Dervieux <@\at @>. ^^A https://github.com/cderv +% `\contributor rallg <@\at @>'. ^^A https://github.com/rallg % %\iffalse %\section{History of micro-typography} ^^A some time ... @@ -3421,7 +3449,7 @@ % % \bibitem[\LaTeXe\ font selection]{fntguide} % \LaTeX\ Project Team, \emph{\LaTeXe\ font selection}, -% March 2021. +% August 2022. % (\ctanurl{macros/latex/base/fntguide.pdf}) % % \bibitem[\pkg{fontspec}]{fontspec} @@ -3433,7 +3461,7 @@ % \bibitem[\pkg{luaotfload}]{luaotfload} % \LaTeX3 Project, \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger, % \emph{The \pkg{luaotfload} package}, -% 15~June 2022. +% 3~October 2022. % (\ctanpkgurl{luaotfload}) % % \bibitem[\pkg{pdfcprot}]{pdfcprot} @@ -3442,13 +3470,9 @@ % (\ctanpkgurl{pdfcprot}) % % \bibitem[\pkg{soul}]{soul} -% Melchior Franz, \emph{The \pkg{soul} package}, -% 17 November 2003. +% [Melchior Franz,] Heiko Oberdiek, \emph{The \pkg{soul} package}, +% 18 February 2023. % (\ctanpkgurl{soul}). -%\changes{v2.3a}{2008/01/06}{mention \pkg{soulutf8}} -% See also Heiko Oberdiek's extension of this package, -% \pkg{soulutf8}, which adds Unicode support. -% (\ctanpkgurl{soulutf8}) % %\end{thebibliography} % @@ -3485,7 +3509,13 @@ % %\begin{History} % -%\VersionDate{\expandafter\@gobble\fileversion}{\filedate} +%\Version{\expandafter\@gobble\fileversion}{\filedate} +% \item New command \cs{DeclareMicrotypeFilePrefix} to change the prefix of the +% configuration files \refsection{\ref{sub:config-file}} +% \item New protrusion patch |verbatim| to switch off protrusion +% and expansion in |verbatim| environments \refsection{\ref{sec:pedantic}} +% +%\VersionDate{3.0f}{2022/06/23} % %\VersionDate{3.0e}{2022/06/20} % @@ -3740,8 +3770,8 @@ %^^A be loaded at any time) %^^A \item \cs{microtypesetup} now sets the correct level of protrusion %^^A \refsection{\ref{sub:options-cmd}} -% \item New option: `\opt{final}' -% \refsection{\ref{sub:options-misc}} +%^^A \item New option: `\opt{final}' +%^^A \refsection{\ref{sub:options-misc}} % %\VersionDate{1.3}{2004/10/27} % @@ -3847,8 +3877,9 @@ % \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} +% \splittopskip,\string,\the,\tolerance,\tracingmacros,\unhbox,\unkern,\unskip, +% \unvbox,\uppercase,\vbadness,\vbox,\vfuzz,\vrule,\vsplit,\vss,\wd,\widowpenalty, +% \write,\xdef} %^^A\DoNotIndex{\font,\fontdimen,\fontname,\nullfont,\sfcode,\spacefactor, %^^A \spaceskip,\xspaceskip} ^^A tex %\DoNotIndex{\currentgrouplevel,\currentgrouptype,\currentiflevel,\detokenize, @@ -3878,30 +3909,42 @@ % \@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,\bfseries,\documentclass,\dotfill,\fbox,\fboxrule,\fboxsep,\fmtversion, +% \strip@prefix,\strip@pt,\@text@composite,\tw@,\@verbatim,\z@,\z@skip,\zap@space, +% \active,\bfseries,\documentclass,\dotfill,\em,\emph,\fbox,\fboxrule,\fboxsep,\fmtversion, % \fontseriesforce,\fontshapeforce,\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,\normalshape,\normalsize,\numberline,\obeylines, -% \par,\parbox,\providecommand,\quad,\raggedright,\renewcommand,\rmfamily,\scalebox, -% \sffamily,\scriptsize,\scshape,\slshape,\small,\space,\sscshape,\strut,\swshape, -% \textwidth,\texttt,\tiny,\tracingnone,\ttfamily,\upshape,\ulcshape,\usefont,\tiny, -% \AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,\CurrentOption,\DeclareOption, -% \DeclareRobustCommand,\IfFileExists,\IfFormatAtLeastTF,\InputIfFileExists,\MessageBreak, -% \PackageError,\PackageInfo,\PackageWarning,\PassOptionsToPackage,\ProcessOptions, -% \RawNoindent,\RequirePackage,\UnicodeEncodingName} +% \LARGE,\leavevmode,\llap,\makeatletter,\makebox,\marginparsep,\mathrm,\mbox,\mdseries, +% \medskip,\newbox,\newcommand,\newcount,\newdimen,\newif,\newline,\newskip,\newtoks, +% \nobreak,\nonfrenchspacing,\normalbaselineskip,\normalshape,\normalsize,\numberline, +% \obeylines,\par,\parbox,\providecommand,\quad,\raggedright,\renewcommand,\rmfamily, +% \scalebox,\sffamily,\scriptsize,\scshape,\slshape,\small,\space,\sscshape,\strut,\swshape, +% \textbf,\textit,\textmd,\textnormal,\textrm,\textsc,\textsf,\textsl,\textssc,\textsw, +% \textulc,\textup,\textwidth,\texttt,\tiny,\tracingnone,\ttfamily,\upshape,\ulcshape, +% \usefont,\tiny,\AddToHook,\AtBeginDocument,\AtEndOfPackage,\CheckCommand,\CurrentOption, +% \DeclareOption,\DeclareRobustCommand,\IfFileExists,\IfFormatAtLeastTF,\InputIfFileExists, +% \MakeLowercase,\MakeUppercase,\MakeTitlecase,\MessageBreak,\PackageError,\PackageInfo, +% \PackageWarning,\PassOptionsToPackage,\ProcessOptions,\RawNoindent,\RequirePackage, +% \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{\alltt} ^^A alltt +%\DoNotIndex{\eqref,\tagform@} ^^A amsmath %\DoNotIndex{\foreign@language,\languagename,\select@language,\shorthandoff} ^^A babel %\DoNotIndex{\percentsign} ^^A babel/spanish,galician,mexican -%\DoNotIndex{\polyglossia@language@switched} ^^A polyglossia +%\DoNotIndex{\beamer@@callorigitem,\beamer@callorigitem, +% \beamer@framefootnotetext} ^^A beamer %\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{\csqQQ,\csq@bqgroup,\csq@eqgroup,\@disablequotes, +% \enquote,\foreignquote,\foreigntextquote,\foreigntextcquote, +% \hyphenquote,\hyphentextquote,\hyphentextcquote,\textquote,\textcquote} ^^A csquotes +%\DoNotIndex{\meta} ^^A doc +%\DoNotIndex{\apptocmd,\gappto,\ifdefmacro,\ifdefparam,\patchcmd} ^^A etoolbox +%\DoNotIndex{\txfigures,\lnfigures,\tbfigures,\prfigures,\fontfigurestyle, +% \fontfigurealignment,\fontbasefamily,\figureversion,\textfigures, +% \liningfigures,\tabularfigures,\proportionalfigures} ^^A fontaxes %\DoNotIndex{\hyper@@anchor,\hyper@nopatch@footnote,\Hy@footnote@currentHref, % \ifHy@hyperfootnotes,\ifHy@implicit,\pdfstringdefDisableCommands, % \pdfstringdefWarn} ^^A hyperref @@ -3914,30 +3957,41 @@ %\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{\cs,\marg,\oarg,\parg} ^^A ltxdoc %\DoNotIndex{\newluafunction} ^^A luatexbase +%\DoNotIndex{\tistyle,\ltstyle,\ofstyle,\altstyle,\regstyle,\embossstyle, +% \ornamentalstyle,\qtstyle,\shstyle,\tmstyle,\tvstyle,\swashstyle, +% \lnstyle,\osstyle,\instyle,\sustyle,\lstyle,\ostyle,\pstyle,\tstyle, +% \plstyle,\postyle,\tlstyle,\tostyle,\scolshape,\olshape,\sishape,\ushape, +% \scushape,\uishape,\rishape,\dfshape,\swstyle,\nwwidth,\cdwidth,\ecwidth, +% \ucwidth,\etwidth,\epwidth,\exwidth,\uxwidth,\regwidth,\mbweight,\dbweight, +% \sbweight,\ebweight,\ubweight,\lgweight,\elweight,\ulweight, +% \textti,\textlt,\textof,\textalt,\textreg,\emboss,\textorn,\ornament, +% \textqt,\textsh,\texttm,\texttv,\textswash,\textln,\textos,\textin,\textsu, +% \textl,\texto,\textp,\textt,\textpl,\textpo,\texttl,\textto,\textol,\textsi, +% \textu,\textscu,\textui,\textri,\textdf,\textnw,\textcd,\textec,\textuc, +% \textet,\textep,\textex,\textux,\textrw,\textmb,\textdb,\textsb,\texteb, +% \textub,\textlg,\textel,\textul} ^^A nfssext-cfr %\DoNotIndex{\pdf@escapestring} ^^A pdftexcmds %\DoNotIndex{\py@macron} ^^A pinyin +%\DoNotIndex{\polyglossia@language@switched} ^^A polyglossia +%\DoNotIndex{\@topic@item} ^^A simplecv %\DoNotIndex{\SOUL@,\SOUL@doword,\soulregister} ^^A soul %\DoNotIndex{\tikz@expandcount} ^^A tikz %\DoNotIndex{\conditionally@traceoff} ^^A trace %\DoNotIndex{\@xspace,\@xspace@firsttrue} ^^A xspace -%\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{\frakfamily,\gothfamily,\swabfamily,\textfrak,\textgoth,\textswab}^^A yfonts %\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{\KOMAClassName,\setuptoc,\unsettoc,\scr@saved@footnotetext} ^^A koma (tocbasic) %\DoNotIndex{\theequationdis,\theIEEEsubequationdis} ^^A IEEEtran %\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,\DeclareMicroTypeAlias,\DeclareMicroTypeSet, -% \LoadMicroTypeFile,\UseMicroTypeSet,\MicroType@Hook} ^^A microtype +% \LoadMicroTypeFile,\DeclareMicrotypeFilePrefix,\UseMicroTypeSet,\MicroType@Hook}^^A microtype % % ^^A ------------------------------------------------------------------------- % @@ -4069,6 +4123,7 @@ \newcommand*\DeclareMicrotypeVariants[1]{} \newcommand*\DeclareMicrotypeAlias[2]{} \newcommand*\LoadMicrotypeFile[1]{} +\newcommand*\DeclareMicrotypeFilePrefix[1]{} \newcommand*\DeclareMicrotypeBabelHook[2]{} \newcommand*\microtypesetup[1]{} \newcommand*\microtypecontext[1]{} @@ -4102,6 +4157,7 @@ \@onlypreamble\DisableLigatures \@onlypreamble\DeclareMicrotypeVariants \@onlypreamble\DeclareMicrotypeBabelHook +\@onlypreamble\DeclareMicrotypeFilePrefix % \end{macrocode} % Don't load \letterspace. % \begin{macrocode} @@ -6378,10 +6434,12 @@ time will almost certainly lead to undesired results. Have your choice!}% \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. +% Sometimes you just want to silence it when debugging a document.\footnote{ +% Cf. \url{https://www.youtube.com/watch?v=7FQLnggVgDE&t=38m24s}} +% \index{Mittelbach=\textit {Frank Mittelbach} (contributor)|hyperpage} % \begin{macrocode} - %\gdef\MT@setupfont@hook{\tracingnone - % \MT@info{Silently doing my `magic' (Mittelbach) for font\MessageBreak\MT@@font}}% + %\gdef\MT@setupfont@hook{\ifnum\tracingmacros>\z@\tracingnone + % \MT@info{->Silently doing my `magic' (Mittelbach) for font\MessageBreak->\MT@@font}\fi}% \MT@if@false \MT@with@babel@and@T{spanish} \MT@if@true \MT@with@babel@and@T{galician}\MT@if@true @@ -6566,7 +6624,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \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}} +\def\MT@patch@undef#1{\MT@warning{Patch `#1' undefined.\MessageBreak Cannot apply it}} \def\MT@patch@info@undo#1{\MT@info{Reverting patch `#1'}} % \end{macrocode} %\end{macro} @@ -6579,12 +6637,18 @@ time will almost certainly lead to undesired results. Have your choice!}% % Define a patch and add it to the list of patches. % The third argument may contain more revert commands, but will % mostly be empty. +%\changes{v3.1}{2022/09/26}{define patches globally} +%\changes{v3.1}{2022/09/26}{check if patch defined} % \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}% + \MT@ifdefined@n@TF{MT@patch@@#1}{% + \MT@warning{Patch `#1' already defined.\MessageBreak Cannot define it}% + }{% + \g@addto@macro\MT@patches@def{,#1}% + \MT@gdef@n{MT@patch@@#1}{#2}% + \MT@gdef@n{MT@patch@undo@@#1}{#3}% + }% } % \end{macrocode} %\end{macro} @@ -6599,8 +6663,12 @@ time will almost certainly lead to undesired results. Have your choice!}% \let\MT@redefined@patches\@empty \def\MT@redefine@patch#1#2#3{% \g@addto@macro\MT@redefined@patches{% - \MT@def@n{MT@patch@@#1}{#2}% - \MT@def@n{MT@patch@undo@@#1}{#3}% + \MT@ifdefined@n@TF{MT@patch@@#1}{% + \MT@gdef@n{MT@patch@@#1}{#2}% + \MT@gdef@n{MT@patch@undo@@#1}{#3}% + }{% + \MT@warning{Patch `#1' undefined.\MessageBreak Cannot redefine it}% + }% }% } % \end{macrocode} @@ -6869,11 +6937,13 @@ time will almost certainly lead to undesired results. Have your choice!}% \MT@exp@cs\MT@patch@patch{beamerx@\string\@mpfootnotetext} {\ignorespaces}{\ignorespaces\leftprotrusion}} % \end{macrocode} -% \item the <\cls{KOMA}> classes (which load \pkg{scrkbase}) +% \item the <\cls{KOMA}> classes %\changes{v3.0a}{2021/12/02}{fix protrusion patch \texttt{footnote} with <\cls{KOMA}> classes % (reported by \contributor MisterFiLou <@\at @>) \githubissue{2}} +%\changes{v3.1}{2022/08/03}{fix test for <\cls{KOMA}> classes in protrusion patch \texttt{footnote} +% (also reported by \contributor David Purton <@\at @>) \githubissue{26}} % \begin{macrocode} - {\@ifpackageloaded{scrkbase} + {\MT@ifdefined@c@TF\KOMAClassName {\MT@patch@patch\scr@saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}% % \end{macrocode} % \item the base classes @@ -6883,13 +6953,33 @@ time will almost certainly lead to undesired results. Have your choice!}% }{}% % \end{macrocode} % \end{itemize} +% \item [|verbatim|] disable all microtypographic extensions in +% verbatim blocks. (This could have been a nice opportunity +% to use the new \LaTeX\ hook management, however, the hook +% here is executed too early -- namely, before the |\par| in +% \cmd\@verbatim, which may result in spilling the +% microtypographic settings to the preceding paragraph -- so +% we're resorting to patching, again.) +%\changes{v3.1}{2022/09/29}{new protrusion patch \texttt{verbatim}} +% \begin{itemize} +% \item Appending to \cmd\@verbatim\ works for, at least, the standard +% classes, \pkg{verbatim} (and \cls{memoir}); the implementations +% in \pkg{fancvrb} and \pkg{listings} don't allow protrusion anyway. +% \begin{macrocode} + \MT@define@patch{verbatim}{% + \MT@append@patch\@verbatim{\microtypesetup{activate=false}}% +% \end{macrocode} +% \item package \pkg{alltt} +% \begin{macrocode} + \MT@with@package@T{alltt}{\MT@append@patch\alltt{\microtypesetup{activate=false}}}% + }{} +% \end{macrocode} +% \end{itemize} +%\end{description} % Finally, execute any redefinitions. % \begin{macrocode} \MT@redefined@patches }} -% \end{macrocode} -%\end{description} -% \begin{macrocode} % % % \end{macrocode} @@ -7142,8 +7232,8 @@ time will almost certainly lead to undesired results. Have your choice!}% % won't work, and we could skip the settings (for example, the \pkg{dsfont} % fonts don't specify this dimension; this is probably a bug -- the \pkg{fourier} % and \pkg{newpx}/\pkg{newtx} packages have been fixed in the meantime). -% However, we can fix it ourselves -- only tracking still doesn't work (it seems -% that \cmd\letterspacefont\ uses the \fontdim6 from the original font). +% However, we can fix it ourselves (and since \pdftex\ 1.40.23, this also works +% for \cmd\letterspacefont). ^^A https://mailman.ntg.nl/pipermail/ntg-pdftex/2021-June/004335.html % \xetex\ doesn't provide an equivalent to \cmd\pdffontsize, so we use the % nominal size instead. % \begin{macrocode} @@ -8006,10 +8096,11 @@ time will almost certainly lead to undesired results. Have your choice!}% %\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. +% Add |charwidth(|\meta{inheriting char}|)-charwidth(|\meta{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> %\def\MT@set@pr@prefixes#1{\MT@set@pr@prefixes@#1} @@ -8107,6 +8198,9 @@ time will almost certainly lead to undesired results. Have your choice!}% } % \end{macrocode} %\end{macro} +% +%\subsubsection{Manual protrusion}\label{ssub:setup-protcmd} +% %\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 @@ -8125,7 +8219,6 @@ 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. @@ -8140,25 +8233,46 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \DeclareRobustCommand\leftprotrusion{% \MT@toks{}% - \MT@prot@false + \MT@prot@toks{}% + \let\MT@prot@l\MT@prot@l@ + \let\MT@maybe@textcmd\@firstofone \MT@prot@get@firstgroup } -\newif\ifMT@prot@ % \end{macrocode} %\end{macro} -%\end{macro} -%\begin{macro}{\MT@prot@l} +%\begin{macro}{\MT@prot@l@} %\changes{v3.0b}{2021/12/05}{make \cmd\long\ again % (reported by \contributor Akira Yokosawa <@\at @>) \githubissue{3}} %\changes{v3.0c}{2022/01/14}{next try at removing \cmd\long} % This probably doesn't need to be \cmd\long\ any longer. % \begin{macrocode} -\def\MT@prot@l#1{% +\def\MT@prot@l@#1{% \MT@get@prot{#1}{left}% #1% } % \end{macrocode} %\end{macro} +%\begin{macro}{\MT@prot@toks} +%\begin{macro}{\MT@prot@l@tc} +%\changes{v3.1}{2023/03/06}{new macro: for text commands} +%\begin{macro}{\MT@gobble@to@nil} +% If \cs{leftprotrusion} is followed by a text command, +% we trial-typeset only the first glyph, then actually typeset +% the whole argument, which we've saved in \cs{MT@prot@toks}, +% and finally gobble anything that might still be left in the +% input stream (see \cs{MT@prot@check@F} below). +% \begin{macrocode} +\newtoks\MT@prot@toks +\def\MT@prot@l@tc#1{% + \MT@get@prot{\MT@maybe@textcmd{#1}}{left}% + \the\MT@prot@toks + \MT@gobble@to@nil +} +\def\MT@gobble@to@nil#1\MT@nil{} +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} %\begin{macro}{\rightprotrusion} %\changes{v3.0}{2021/05/15}{new command} %\begin{macro}{\MT@prot@r} @@ -8196,7 +8310,7 @@ time will almost certainly lead to undesired results. Have your choice!}% %\begin{macro}{\MT@prot@hook} % 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 +%\changes{v3.0c}{2022/01/06}{compatibility with \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 dedicated command to end \pkg{csquotes}'s group (because we actually typeset @@ -8208,7 +8322,10 @@ time will almost certainly lead to undesired results. Have your choice!}% %\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. +% In our case, fortunately, we really don't want to trigger the hooks.\footnote{ +% Well, in some cases we do, but this indeed `needs further analysis' +% (cf. \url{https://github.com/latex3/latex2e/issues/880}).} +%\todo{fix use of \cmd\RawNoindent} % 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} @@ -8330,9 +8447,9 @@ 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{\the\MT@toks##1##2}}% + \def\MT@temp*##1##2{\MT@exp@one@n\MT@prot@l{\the\MT@toks##1##2}}% \else - \def\MT@temp*##1{\MT@prot@l{\the\MT@toks##1}}% + \def\MT@temp*##1{\MT@exp@one@n\MT@prot@l{\the\MT@toks##1}}% \fi }% } @@ -8343,7 +8460,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % (reported by \contributor Torsten Schuetze )} % ^^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@firsttoken} at the +% If we have a group, we inject \cs{MT@prot@get@firstgroup} again 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. @@ -8353,31 +8470,37 @@ time will almost certainly lead to undesired results. Have your choice!}% %\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} +%\changes{v3.1}{2023/03/06}{allow multiple groups} % \begin{macrocode} -\def\MT@prot@addgroup{\bgroup\afterassignment\MT@prot@get@firsttoken\let\MT@temp= } +\def\MT@prot@addgroup{\bgroup\afterassignment\MT@prot@get@firstgroup\let\MT@temp= } % \end{macrocode} %\end{macro} %\begin{macro}{\MT@prot@get@firstgroup} +%\begin{macro}{\MT@prot@get@firstgroup@tc} %\begin{macro}{\MT@prot@get@firsttoken} %\begin{macro}{\MT@prot@get@nexttoken} % Scan token by token. % \begin{macrocode} \def\MT@prot@get@firstgroup{\futurelet\MT@prot@next\MT@prot@get@first@group} +\def\MT@prot@get@firstgroup@tc{\futurelet\MT@prot@next\MT@prot@get@first@group@tc} \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} +%\end{macro} %\begin{macro}{\MT@prot@check} +%\changes{v3.1}{2022/12/17}{allow replacement command} %\begin{macro}{\MT@prot@check@} % We map through a list of commands that should be copied into the toks. +% \meta{\#3} will be \cmd\relax\ by default, but can also indicate +% a replacement command. % \begin{macrocode} -\def\MT@prot@check#1{\MT@prot@check@#1} -\def\MT@prot@check@#1#2{% +\def\MT@prot@check#1{\MT@prot@check@#1\relax\@nil} +\def\MT@prot@check@#1#2#3\@nil{% \ifx\MT@prot@next#2% - \MT@prot@true - \csname MT@prot@check@#1\endcsname + \csname MT@prot@check@#1\endcsname #3% \let\MT@prot@ifmacro\@gobble \expandafter\MT@tlist@break \fi @@ -8385,51 +8508,142 @@ time will almost certainly lead to undesired results. Have your choice!}% % \end{macrocode} %\end{macro} %\end{macro} +% Beware that the following nomenclature is rather arcane. +%\begin{itemize} +% \item %\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}% + \def\MT@temp*##1{\MT@prot@get@firstgroup}% } % \end{macrocode} %\end{macro} +% \item %\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}% + \def\MT@temp*##1{\MT@toks\expandafter{\the\MT@toks##1}\MT@prot@get@firstgroup}% } % \end{macrocode} %\end{macro} +% \item %\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}% + \def\MT@temp*##1##2{\MT@toks\expandafter{\the\MT@toks##1{##2}}\MT@prot@get@firstgroup}% } % \end{macrocode} %\end{macro} +% \item %\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}% + \def\MT@temp*##1##2##3{\MT@toks\expandafter{\the\MT@toks##1{##2}{##3}}\MT@prot@get@firstgroup}% +} +% \end{macrocode} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@E} +%\changes{v3.1}{2022/11/29}{new macro: take care of commands that enclose their argument} +% This is for commands that \textbf{E}nclose their argument in something, \eg, in braces, +% and which we trial-typeset without any contents. +% \begin{macrocode} +\def\MT@prot@check@E{% + \def\MT@temp*##1{\MT@prot@l{##1}}% +} +% \end{macrocode} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@e} +%\changes{v3.1}{2022/11/29}{new macro: take care of starred commands that enclose their argument} +% Same for starred commands (the main candidate here is \pkg{csquotes}'s \cmd\enquote). +% \begin{macrocode} +\def\MT@prot@check@e{% + \def\MT@temp*##1{\@ifstar{\MT@prot@l{##1*}}{\MT@prot@l{##1}}}% +} +% \end{macrocode} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@eX} +%\changes{v3.1}{2022/12/28}{new macro: replace enclosing commands} +% Here we replace the `integrated interface' (\pkg{csquotes}) with the regular one. +% \begin{macrocode} +\def\MT@prot@check@eX#1{% + \def\MT@temp*##1{\@ifstar + {\MT@get@prot{#1*}{left}##1*} + {\MT@get@prot{#1}{left}##1}}} +% \end{macrocode} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@l} +%\changes{v3.1}{2022/12/26}{new macro: for commands that enclose their second argument} +%\begin{macro}{\MT@prot@check@l@} +% \pkg{csquotes} provides a couple of commands for quotations in foreign +% \textbf{l}anguages (lowercase, because it may be starred), whose first argument +% (the language) we also have to evaluate before trial typesetting. +% \begin{macrocode} +\def\MT@prot@check@l{% + \def\MT@temp*##1{\@ifstar{\MT@prot@check@l@{##1*}}{\MT@prot@check@l@{##1}}}} +\def\MT@prot@check@l@#1#2{\MT@prot@l{#1{#2}}} +% \end{macrocode} +%\end{macro} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@lX} +%\changes{v3.1}{2022/12/28}{new macro: replace language-switching enclosing commands} +%\begin{macro}{\MT@prot@check@lX@} +% Another macro for \pkg{csquotes} commands: replace integrated language-switching +% commands with their regular variants. +% \begin{macrocode} +\def\MT@prot@check@lX#1{% + \def\MT@temp*##1{\@ifstar + {\def\MT@temp{##1*}\MT@prot@check@lX@{#1*}} + {\def\MT@temp{##1}\MT@prot@check@lX@{#1}}}} +\def\MT@prot@check@lX@#1#2{% + \MT@get@prot{#1{#2}}{left}\MT@temp{#2}} +% \end{macrocode} +%\end{macro} +%\end{macro} +% \item +%\begin{macro}{\MT@prot@check@F} +%\changes{v3.1}{2022/03/06}{new macro: for text commands} +% Here we deal with \textbf{F}ont switching commands (\ie, text commands, +% which take an argument). +% We (a) remember the text command, (b) save the full text, +% and then (c) continue inspecting the contents of the argument. +% Nested text commands still don't work. +% \begin{macrocode} +\def\MT@prot@check@F{% + \ifx\MT@prot@l\MT@prot@l@tc + \def\MT@temp*{\MT@exp@one@n\MT@prot@l{\the\MT@toks}}% + \else + \let\MT@prot@l\MT@prot@l@tc + \def\MT@temp*##1##2{% + \let\MT@maybe@textcmd##1% + \MT@prot@toks{##1{##2}}% + \MT@prot@get@firstgroup@tc##2\MT@nil}% + \fi } % \end{macrocode} %\end{macro} +%\end{itemize} %\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} %\changes{v3.0f}{2022/06/22}{add \microtype's 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). +%\changes{v3.1}{2023/01/07}{add \cmd\em} +%\changes{v3.1}{2023/03/06}{add \cmd\MakeUppercase\ and friends} +% And here's the list of commands that we can deal with. % \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\upshape}{S\itshape}{S\slshape}{S\scshape}{S\em}% {S\normalfont}{S\selectfont}% {S\lsstyle}% {S\tiny}{S\scriptsize}{S\footnotesize}{S\small}{S\normalsize}% @@ -8437,22 +8651,102 @@ time will almost certainly lead to undesired results. Have your choice!}% {O\fontencoding}{O\fontfamily}{O\fontseries}{O\fontshape}% {O\microtypesetup}{O\microtypecontext}% {T\fontsize}% + {F\textrm}{F\textsf}{F\texttt}{F\textnormal}% + {F\textbf}{F\textmd}{F\textit}{F\textsl}{F\textsc}{F\textup}{F\emph}% + {F\MakeUppercase}{F\MakeLowercase}% } % \end{macrocode} -% \LaTeX\ 2020/02/02 introduced some more commands. -%\changes{v3.0f}{2022/06/22}{add new NFSS commands} +% \LaTeX\ 2020/02/02 introduced some more text commands +%\changes{v3.0f}{2022/06/22}{add new commands} +% (adopted from \pkg{fontaxes}, which provides some more, see below). +%\changes{v3.1}{2023/01/08}{add \pkg{fontaxes} commands} % \begin{macrocode} \IfFormatAtLeastTF{2020/02/02} {\g@addto@macro\MT@prot@check@cmds{% {S\swshape}{S\ulcshape}{S\sscshape}{S\normalshape}% - {O\fontseriesforce}{O\fontshapeforce}}}{} -% \end{macrocode} -% If \pkg{yfonts} is loaded, we add the relevant commands (again, only those that -% don't take an argument). -% \begin{macrocode} + {F\textulc}{F\textsw}{F\textssc}% + {O\fontseriesforce}{O\fontshapeforce}}} + \relax +\IfFormatAtLeastTF{2022/11/01} + {\g@addto@macro\MT@prot@check@cmds{{F\MakeTitlecase}}}\relax +% \end{macrocode} +% The \cls{ltxdoc} class and the \pkg{doc} package provide some abbreviations. +% Unfortunately, the \cmd\cmd\ command doesn't work. +%\changes{v3.1}{2022/12/04}{add \cls{ltxdoc} and \pkg{doc} abbreviations} +% \begin{macrocode} +\@ifclassloaded{ltxdoc} + {\g@addto@macro\MT@prot@check@cmds{{E\enquote}{E\marg}{E\oarg}{E\parg}{E\cs}}}\relax \MT@addto@setup{% + \MT@with@package@T{doc} + {\g@addto@macro\MT@prot@check@cmds{{E\meta}}}% +% \end{macrocode} +% The additional \pkg{fontaxes} commands. +% \begin{macrocode} + \MT@with@package@T{fontaxes} + {\g@addto@macro\MT@prot@check@cmds{% + {S\txfigures}{S\lnfigures}{S\tbfigures}{S\prfigures}% + {O\fontfigurestyle}{O\fontfigurealignment}{O\fontbasefamily}% + {O\figureversion}% + {F\textsw}{F\textssc}{F\textulc}% + {F\textfigures}{F\liningfigures}{F\tabularfigures}{F\proportionalfigures}}% + \IfFormatAtLeastTF{2020/02/02}\relax + {\g@addto@macro\MT@prot@check@cmds{% + {S\swshape}{S\ulcshape}{S\sscshape}% + {F\textulc}{F\textsw}{F\textssc}}}} +% \end{macrocode} +% The \pkg{nfssext-cfr} package (an extension of the \pkg{nfssext} package, +% which is part of Philipp Lehman's \pkg{fontinstallationguide} but was never +% publicised separately as far as I can tell) adds many more commands on top +% of the . +%\changes{v3.1}{2023/01/16}{add \pkg{nfssext-cfr} commands} +% \begin{macrocode} + \MT@with@package@T{nfssext-cfr} + {\g@addto@macro\MT@prot@check@cmds{% + {S\tistyle}{S\ltstyle}{S\ofstyle}{S\altstyle}{S\regstyle}{S\embossstyle}% + {S\ornamentalstyle}{S\qtstyle}{S\shstyle}{S\tmstyle}{S\tvstyle}{S\swashstyle}% + {S\lnstyle}{S\osstyle}{S\instyle}{S\sustyle}{S\lstyle}{S\ostyle}% + {S\pstyle}{S\tstyle}{S\plstyle}{S\postyle}{S\tlstyle}{S\tostyle}% + {S\scolshape}{S\olshape}{S\sishape}{S\ushape}{S\scushape}% + {S\uishape}{S\rishape}{S\dfshape}{S\swstyle}% + {S\nwwidth}{S\cdwidth}{S\ecwidth}{S\ucwidth}% + {S\etwidth}{S\epwidth}{S\exwidth}{S\uxwidth}{S\regwidth}% + {S\mbweight}{S\dbweight}{S\sbweight}{S\ebweight}% + {S\ubweight}{S\lgweight}{S\elweight}{S\ulweight}% + {F\textti}{F\textlt}{F\textof}{F\textalt}{F\textreg}{F\emboss}% + {F\textorn}{O\ornament}{F\textqt}{F\textsh}{F\texttm}{F\texttv}{F\textswash}% + {F\textln}{F\textos}{F\textin}{F\textsu}{F\textl}{F\texto}% + {F\textp}{F\textt}{F\textpl}{F\textpo}{F\texttl}{F\textto}% + {F\textol}{F\textsi}{F\textu}{F\textscu}% + {F\textui}{F\textri}{F\textdf}% + {F\textnw}{F\textcd}{F\textec}{F\textuc}% + {F\textet}{F\textep}{F\textex}{F\textux}{F\textrw}% + {F\textmb}{F\textdb}{F\textsb}{F\texteb}% + {F\textub}{F\textlg}{F\textel}{F\textul}}% + \IfFormatAtLeastTF{2020/02/02}\relax + {\g@addto@macro\MT@prot@check@cmds{{S\swshape}{F\textsw}}}} +% \end{macrocode} +% If \pkg{yfonts} is loaded, we add the relevant commands. +% \begin{macrocode} \MT@with@package@T{yfonts} - {\g@addto@macro\MT@prot@check@cmds{{S\frakfamily}{S\swabfamily}{S\gothfamily}}}% + {\g@addto@macro\MT@prot@check@cmds{% + {S\frakfamily}{S\swabfamily}{S\gothfamily}% + {F\textfrak}{F\textswab}{F\textgoth}}}% +% \end{macrocode} +% \pkg{csquotes}'s \cmd\enquote\ command. +% It would take precedence over the one provided by \cls{ltxdoc}. +%\changes{v3.1}{2022/11/29}{add \pkg{csquotes}'s commands +% (reported by \contributor Shen Zhou Hong <@\at @>) +% \githubissue{25}} +% \begin{macrocode} + \MT@with@package@T{csquotes} + {\@ifclassloaded{ltxdoc} + {\patchcmd\MT@prot@check@cmds{E\enquote}{e\enquote}\relax\relax} + {\g@addto@macro\MT@prot@check@cmds{{e\enquote}}}% + \g@addto@macro\MT@prot@check@cmds{{e\textquote}% + {l\foreignquote}{l\hyphenquote}{l\foreigntextquote}{l\hyphentextquote}% + {{eX}\textcquote\textquote}% + {{lX}\foreigntextcquote\foreigntextquote}% + {{lX}\hyphentextcquote\hyphentextquote}}}% } % \end{macrocode} %\end{macro} @@ -8470,13 +8764,30 @@ time will almost certainly lead to undesired results. Have your choice!}% } % \end{macrocode} %\end{macro} +%\begin{macro}{\MT@prot@get@first@group@tc} +% The variant for text commands (in case they start with another group). +% \begin{macrocode} +\def\MT@prot@get@first@group@tc{% + \MT@prot@ifcat\bgroup{% + \def\MT@temp*##1##2\MT@nil{\MT@ifempty{##1}\relax + {{\MT@prot@get@firstgroup@tc##1\MT@nil}}}% + }{% + \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} +%\changes{v3.1}{2023/03/06}{expand toks once} % 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}% + \def\MT@temp*{\MT@exp@one@n\MT@ifempty{\the\MT@toks} + {\MT@exp@one@n\MT@ifempty{\the\MT@prot@toks}\relax{\the\MT@prot@toks\MT@gobble@to@nil}} + {\MT@exp@one@n\MT@prot@l{\the\MT@toks}}}% \MT@prot@ifcat{a}{% \def\MT@temp*{\MT@prot@addtoken@first}% }{% @@ -8487,7 +8798,7 @@ time will almost certainly lead to undesired results. Have your choice!}% % a space character, \dots % \begin{macrocode} \MT@prot@ifx\@sptoken{% - \def\MT@temp* {\MT@prot@get@firsttoken}% + \def\MT@temp* {\MT@prot@get@firstgroup}% }{% % \end{macrocode} % commands, \dots @@ -8499,20 +8810,21 @@ time will almost certainly lead to undesired results. Have your choice!}% % \begin{macrocode} \MT@prot@ifmacro{% \MT@prot@iffirstcmd\UTFviii@two@octets{% - \def\MT@temp*##1##2{\MT@prot@l{\the\MT@toks##1##2}}% + \def\MT@temp*##1##2{\MT@exp@one@n\MT@prot@l{\the\MT@toks##1##2}}% }{% \MT@prot@iffirstcmd\UTFviii@three@octets{% - \def\MT@temp*##1##2##3{\MT@prot@l{\the\MT@toks##1##2##3}}% + \def\MT@temp*##1##2##3{\MT@exp@one@n\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}}% + \def\MT@temp*##1##2##3##4{\MT@exp@one@n\MT@prot@l{\the\MT@toks##1##2##3##4}}% }{% % \end{macrocode} -% (this is for \pkg{csquotes}) +% (this is for chars made active by \pkg{csquotes}, via \cmd\MakeAutoQuote\ or +% \cmd\MakeOuterQuote) % \begin{macrocode} - \MT@prot@iffirstcmd\csqQQ{\def\MT@temp*##1{\MT@prot@l{\the\MT@toks##1}}}{% + \MT@prot@iffirstcmd\csqQQ{\def\MT@temp*##1{\MT@exp@one@n\MT@prot@l{\the\MT@toks##1}}}{% % \end{macrocode} -% or, finally, a command. +% or, finally, a command. % \begin{macrocode} \MT@prot@iflicrcmd }% @@ -8543,7 +8855,7 @@ time will almost certainly lead to undesired results. Have your choice!}% \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}}% + \def\MT@temp*{\MT@exp@one@n\MT@prot@l{\the\MT@toks}}% }% }% \MT@temp*% @@ -8559,12 +8871,18 @@ time will almost certainly lead to undesired results. Have your choice!}% %<*pdf-|lua-|xe-> \def\MT@prot@addtoken@next#1{% \MT@toks\expandafter{\the\MT@toks#1}% - \setbox\MT@tempbox\hbox{\the\MT@toks + \setbox\MT@tempbox\hbox{% +% \end{macrocode} +% We disable italic correction, which would prevent us from +% seeing the ligature (with text commands). +% \begin{macrocode} + \let\maybe@ic\relax + \MT@exp@one@n\MT@maybe@textcmd{\the\MT@toks}% % \relax % }\setbox\MT@tempbox\hbox{\unhbox\MT@tempbox \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}% \MT@prot@get@nexttoken - {\MT@prot@l{\the\MT@toks}}% + {\MT@exp@one@n\MT@prot@l{\the\MT@toks}}% } % % \end{macrocode} @@ -10185,6 +10503,7 @@ end % font family has already been loaded} % Micro-typographic settings may be written into a file |mt-|\meta{font family}|.cfg|. %\changes{v1.8}{2005/04/16}{no longer wrap names in commands} +%\changes{v3.1}{2023/02/13}{simplify} %\begin{macro}{\MT@file@list} % We must also record whether we've already loaded the file. % \begin{macrocode} @@ -10204,23 +10523,20 @@ end \MT@begin@catcodes \let\MT@begin@catcodes\relax \let\MT@end@catcodes\relax - \InputIfFileExists{mt-#1.cfg}{% - \edef\MT@curr@file{mt-#1.cfg}% + \MT@xadd\MT@file@list{#1,}% + \InputIfFileExists{\MT@cfg@prefix-#1.cfg}{% + \edef\MT@curr@file{\MT@cfg@prefix-#1.cfg}% \MT@vinfo{... Loading configuration file \MT@curr@file}% - \MT@xadd\MT@file@list{#1,}% }{% \MT@get@basefamily#1\@empty\@empty\@empty\@nil \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list - \ifMT@inlist@ - \MT@xadd\MT@file@list{#1,}% - \else - \InputIfFileExists{mt-\@tempa.cfg}{% - \edef\MT@curr@file{mt-\@tempa.cfg}% + \ifMT@inlist@ \else + \InputIfFileExists{\MT@cfg@prefix-\@tempa.cfg}{% + \edef\MT@curr@file{\MT@cfg@prefix-\@tempa.cfg}% \MT@vinfo{... Loading configuration file \MT@curr@file}% - \MT@xadd\MT@file@list{\@tempa,#1,}% + \MT@xadd\MT@file@list{\@tempa,}% }{% - \MT@vinfo{... No configuration file mt-#1.cfg}% - \MT@xadd\MT@file@list{#1,}% + \MT@vinfo{... No configuration file \MT@cfg@prefix-#1.cfg}% }% \fi }% @@ -11601,6 +11917,7 @@ end % } %}\relax +% %<*package> % \end{macrocode} %\end{macro} @@ -11646,6 +11963,7 @@ end \expandafter\MT@rem@from@clist\MT@font\MT@font@list \fi } +% % \end{macrocode} %\end{macro} % @@ -11653,9 +11971,18 @@ end % % Here are the variants for context-sensitive setup. %\begin{macro}{\MT@active@features} -% The activated features are stored in this command. +% The activated features are stored in a command. +%\changes{v3.1}{2022/07/24}{always activate contexts for tracking} +% We always allow contexts for tracking, because \cmd\textls\ may +% be used without activating the feature. % \begin{macrocode} -\let\MT@active@features\@empty +%<*pdf-|lua-|xe-> +%\MT@requires@pdftex6 +%\MT@requires@luatex3 +% {\def\MT@active@features{,tr}}{% + \let\MT@active@features\@empty +% } +% % \end{macrocode} %\end{macro} %\begin{macro}{\MT@check@font@cx} @@ -11666,6 +11993,7 @@ end % This should be more efficient than book-keeping the fonts in lists associated % with the combination of contexts, as we've done it before. % \begin{macrocode} +%<*package> \def\MT@check@font@cx{% \MT@if@true \MT@map@clist@c\MT@active@features{% @@ -12493,6 +12821,9 @@ end } % \end{macrocode} %\end{macro} +% +%\subsubsection{Configuration file management} +% %\begin{macro}{\LoadMicrotypeFile} %\changes{v1.7}{2005/03/22}{new command (suggested by % \contributor Andreas B\"uhmann )} @@ -12505,24 +12836,36 @@ end \@onelevel@sanitize\@tempa \MT@exp@one@n\MT@in@clist\@tempa\MT@file@list \ifMT@inlist@ - \MT@vinfo{... Configuration file mt-\@tempa.cfg already loaded}% + \MT@vinfo{... Configuration file \MT@cfg@prefix-\@tempa.cfg already loaded}% \else \MT@xadd\MT@file@list{\@tempa,}% \MT@begin@catcodes - \InputIfFileExists{mt-\@tempa.cfg}{% - \edef\MT@curr@file{mt-\@tempa.cfg}% + \InputIfFileExists{\MT@cfg@prefix-\@tempa.cfg}{% + \edef\MT@curr@file{\MT@cfg@prefix-\@tempa.cfg}% \MT@vinfo{... Loading configuration file \MT@curr@file}% }{% - \MT@warning{Configuration file mt-\@tempa.cfg\MessageBreak + \MT@warning{Configuration file \MT@cfg@prefix-\@tempa.cfg\MessageBreak does not exist}% }% \MT@end@catcodes \fi } +% \end{macrocode} +%\end{macro} +%\begin{macro}{\MT@cfg@prefix} +%\begin{macro}{\DeclareMicrotypeFilePrefix} +%\changes{v3.1}{2023/03/01}{new command (suggested by +% \contributor rallg <@\at @>) \githubissue{28}} +% The configuration files' prefix may be customised. +% \begin{macrocode} +\def\MT@cfg@prefix{mt} +\def\DeclareMicrotypeFilePrefix#1{% + \def\MT@cfg@prefix{#1}% +} % -% % \end{macrocode} %\end{macro} +%\end{macro} % %\subsubsection{Disabling ligatures} % @@ -14802,7 +15145,6 @@ end %\MT@requires@luatex3{% \def\MT@setup@tracking{% \ifMT@tracking - \edef\MT@active@features{\MT@active@features,tr}% \MT@info@nl{Tracking enabled}% \MT@check@active@set{tr}% % \end{macrocode} @@ -19984,7 +20326,7 @@ This is the current font stretched by 5\%, normal, and shrunk by 5\%: % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \CheckSum{12598} +% \CheckSum{12962} % % \Finale % @@ -20034,6 +20376,7 @@ lualatex microtype-utf.dtx # - Latin Modern Roman (OpenType) # - Charis SIL (OpenType) # - EB Garamond (OpenType) +# - New Computer Modern (OpenType) # - TeX Gyre Pagella (OpenType) ] # (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 diff --git a/Master/texmf-dist/source/latex/microtype/microtype.ins b/Master/texmf-dist/source/latex/microtype/microtype.ins index 0efb05765f2..ed10e200080 100644 --- a/Master/texmf-dist/source/latex/microtype/microtype.ins +++ b/Master/texmf-dist/source/latex/microtype/microtype.ins @@ -10,7 +10,7 @@ The `microtype' package Subliminal refinements towards typographical perfection - Copyright (c) 2004--2022 R Schlicht + Copyright (c) 2004--2023 R Schlicht This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at -- cgit v1.2.3