texlive[73113] Master/texmf-dist: microtype (13dec24)
commits+karl at tug.org
commits+karl at tug.org
Fri Dec 13 23:37:36 CET 2024
Revision: 73113
https://tug.org/svn/texlive?view=revision&revision=73113
Author: karl
Date: 2024-12-13 23:37:36 +0100 (Fri, 13 Dec 2024)
Log Message:
-----------
microtype (13dec24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/microtype/README.md
trunk/Master/texmf-dist/doc/latex/microtype/microtype-code.pdf
trunk/Master/texmf-dist/doc/latex/microtype/microtype.pdf
trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx
trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx
trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty
trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def
trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def
trunk/Master/texmf-dist/tex/latex/microtype/microtype-show.sty
trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def
trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg
trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua
trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty
Modified: trunk/Master/texmf-dist/doc/latex/microtype/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/microtype/README.md 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/doc/latex/microtype/README.md 2024-12-13 22:37:36 UTC (rev 73113)
@@ -4,7 +4,7 @@
**Subliminal refinements towards typographical perfection**
- (v3.1b -- 2024/03/29)
+ (v3.2 -- 2024/12/12)
Overview
@@ -11,11 +11,11 @@
--------
The `microtype` package provides a LaTeX interface to the micro-typographic
-extensions that were introduced by pdfTeX and have since also propagated to
-LuaTeX and XeTeX: most prominently, character protrusion and font expansion,
-furthermore the adjustment of interword spacing and additional kerning, as
-well as hyphenatable letterspacing (tracking) and the possibility to disable
-all or selected ligatures.
+extensions that were introduced by pdfTeX and some of which have since also
+propagated to LuaTeX and XeTeX: most prominently, character protrusion and
+font expansion, furthermore the adjustment of interword spacing and additional
+kerning, as well as hyphenatable letterspacing (tracking) and the possibility
+to disable all or selected ligatures.
These features may be applied to customisable sets of fonts, and all
micro-typographic aspects of the fonts can be configured in a straight-forward
@@ -27,7 +27,8 @@
enable protrusion and expansion if they can safely be assumed to work.
Disabling ligatures requires pdfTeX (at least version 1.30) or LuaTeX, while
the adjustment of interword spacing and of kerning only works with pdfTeX
-(at least 1.40). Letterspacing is available with pdfTeX (1.40) or LuaTeX (0.62).*
+(at least 1.40). Letterspacing is available with pdfTeX (1.40), LuaTeX (0.62)
+or XeTeX.*
The alternative package `letterspace`, which also works with plain TeX,
provides the user commands for letterspacing only, omitting support for all
Modified: trunk/Master/texmf-dist/doc/latex/microtype/microtype-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/microtype/microtype.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/source/latex/microtype/microtype-utf.dtx 2024-12-13 22:37:36 UTC (rev 73113)
@@ -27,7 +27,7 @@
\ProvidesFile
%</!EBGaramond>
%<*driver>
- {\jobname.dtx}[2024/03/29 v3.1b]
+ {\jobname.dtx}[2024/12/12 v3.2]
%</driver>
%<CharisSIL> {mt-CharisSIL.cfg}[2017/07/07 v1.1 microtype config. file: Charis SIL (RS)]
%<LatinModernRoman> {mt-LatinModernRoman.cfg}[2021/02/21 v1.1 microtype config. file: Latin Modern Roman (RS)]
Modified: trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/source/latex/microtype/microtype.dtx 2024-12-13 22:37:36 UTC (rev 73113)
@@ -37,7 +37,7 @@
%<lua-> {microtype-luatex.def}
%<xe-> {microtype-xetex.def}
%<*package|letterspace|m-t|pdf-|lua-|xe-|show>
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
%<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.1b",
-%<luafile> date = "2024/03/29",
+%<luafile> version = "3.2",
+%<luafile> date = "2024/12/12",
%<luafile> description = "microtype module.",
%<luafile> author = "E. Roux, R. Schlicht and P. Gesang",
%<luafile> copyright = "E. Roux, R. Schlicht and P. Gesang",
@@ -942,11 +942,11 @@
%\begin{abstract}
%\noindent
% The \microtype\ package provides a \LaTeX\ interface to the micro-typographic
-% extensions that were introduced by \pdftex\ and have since also propagated to
-% \luatex\ and \xetex: most prominently, character protrusion and font expansion,
-% furthermore the adjustment of interword spacing and additional kerning, as
-% well as hyphenatable letterspacing (tracking) and the possibility to disable
-% all or selected ligatures.
+% extensions that were introduced by \pdftex\ and some of which have since also
+% propagated to \luatex\ and \xetex: most prominently, character protrusion and
+% font expansion, furthermore the adjustment of interword spacing and additional
+% kerning, as well as hyphenatable letterspacing (tracking) and the possibility
+% to disable all or selected ligatures.
% These features may be applied to customisable sets of fonts, and all
% micro-typographic aspects of the fonts can be configured in a straight-forward
% and flexible way. Settings for various fonts are provided.
@@ -959,7 +959,7 @@
% be assumed to work.
% Disabling ligatures requires \pdftex\ ($\geq$\,1.30) or \luatex, while the
% adjustment of interword spacing and of kerning only works with \pdftex\ ($\geq$\,1.40).
-% Letterspacing is available with \pdftex\ ($\geq$\,1.40) or \luatex\ ($\geq$\,0.62).
+% Letterspacing is available with \pdftex\ ($\geq$\,1.40), \luatex\ ($\geq$\,0.62) or \xetex.
%
% The alternative package \letterspace, which also works with plain \TeX,
% provides the user commands for letterspacing only, omitting support for all
@@ -1196,11 +1196,10 @@
%\Describe{Option}{tracking}{true,!false,:font set name}
% This option will systematically change the tracking of the fonts specified in
% the active font set (by default, all small capitals).
-% It is not available with \xetex\ (you may use the `|LetterSpace|'
-% option of the \cite{fontspec} package instead).
% With \pdftex, it is only available in <PDF> mode.
%
-%\medskip
+%^^A\medskip
+%\pagebreak ^^A layout
%\Describe{Option}{kerning}{true,!false,:font set name}
%\DescribeOption{spacing}
% These features do not unconditionally improve the quality of the typeset text:
@@ -1257,7 +1256,7 @@
%\cmidrule(r){1-3}
% \let\textoractual\@firstoftwo ^^A why?
% \xetex
-% & $\geq$ 0.9997 & <PDF> & ! & _ & _ & _ & _ & _\\
+% & $\geq$ 0.9997 & <PDF> & ! & _ & _ & ? & _ & _\\
%\addlinespace[2pt]
%\bottomrule
%\end{tabular}^^A
@@ -1288,7 +1287,7 @@
% {Character protrusion \requires{\pdftex~0.14f,\luatex~0.30,\xetex~0.9997}}
% \label{sub:options-protrusion}
%
-%\Describe{Option}{factor}{:integer}[1000]
+%\Describe{Option}{factor}{:integer}[\MT at factor@default]
% Using this option, you can globally increase or decrease the amount by which
% the characters will be protruded. While a value of 1000 means that the full
% protrusion as specified in the configuration (see section~\ref{sub:protrusion})
@@ -1350,7 +1349,7 @@
% themselves, which may or may not be desired.
%
%\medskip
-%\Describe{Option}{stretch}{:integer}[20]
+%\Describe{Option}{stretch}{:integer}[\MT at stretch@default]
%\DescribeOption{shrink}
% You may specify the stretchability and shrinkability of a font, \ie, the
% maximum amount that a font may be stretched or shrunk. The numbers will be
@@ -1388,10 +1387,10 @@
%
%
%\subsection[Tracking]
-% {Tracking \requires{\pdftex~1.40,\luatex~0.62}}
+% {Tracking \requires{\pdftex~1.40,\luatex~0.62,\xetex~0.9997}}
% \label{sub:options-tracking}
%
-%\Describe{Option}{letterspace}{:integer}[100]
+%\Describe{Option}{letterspace}{:integer}[\MT at letterspace@default]
% This option changes the default amount for tracking (see section~\ref{sub:tracking})
% resp. letterspacing (see section~\ref{sec:lettersp}). The amount is specified
% in thousandths of \EM{1}; admissible values are in the range of \textminus1000
@@ -1962,7 +1961,7 @@
%
%
%\subsection[Tracking]
-% {Tracking \requires{\pdftex~1.40,\luatex~0.62}}
+% {Tracking \requires{\pdftex~1.40,\luatex~0.62,\xetex~0.9997}}
% \label{sub:tracking}
%
%\Describe{Macro}{\SetTracking}{?options,set of fonts,tracking amount}
@@ -2021,8 +2020,8 @@
% by default equal to the current letterspace amount. To remove kerning on
% both sides, you would write `|outer kerning={0,0}|'.
% \item[\key{no ligatures}]
-% By default, ligatures in letterspaced fonts will be
-% constructed as usual, which may be advisable when changing the
+% In the absence of this option, ligatures in letterspaced fonts would
+% be constructed as usual, which may be advisable when changing the
% tracking by only a small amount. For larger letterspacing amounts, on
% the other hand, the normal letter space within ligatures would have
% displeasing \textls[150]{e\lslig{ff}ects}.
@@ -2029,19 +2028,32 @@
% This key expects a comma-separated list of characters for which
% ligatures should be disabled; only the character that begins a ligature
% must be specified.
-% If the key is given without a value, \emph{all} ligatures of the font
-% will be disabled. With \pdftex, this is not recommended, however,
+% If the key is given without a value (or with the value `|all|'),
+% \emph{all} ligatures of the font will be disabled.
+% (With \pdftex, this is not recommended, however,
% since it entails that kerning will be switched off, too. With \luatex,
-% there is no such limitation.
-% The default settings disable ligatures for the character `|f|' only,
-% \ie, `ff', `fi', ffi', etc.\footnote{
-% With \pdftex\ versions older than 1.40.4, \emph{all} ligatures, and
-% hence all kerning, will be disabled. It is therefore recommended to
-% use at least version 1.40.4.}
+% there is no such limitation.)
+% Given the value `|none|', none of the ligatures will be disabled,
+% or, put positively, all of the font's ligatures will stay intact.
+% The default settings (in \file{microtype.cfg}) disable ligatures
+% for the character `|f|' only, \ie, `ff', `fi', ffi', etc.
+% ^^A\footnote{
+% ^^A With \pdftex\ versions older than 1.40.4, \emph{all} ligatures, and
+% ^^A hence all kerning, will be disabled. It is therefore recommended to
+% ^^A use at least version 1.40.4.}
% In exceptional situations, you can manually break up a ligature by
% inserting `|{\kern0pt}|' resp. \pkg{babel}'s \verb="|=
% shortcut, or protect it by enclosing it in \cs{lslig} (see
% section~\ref{sec:lettersp}).
+% \xetex\ does not allow disabling ligatures selectively, or generally,
+% for that matter.
+% \item[\key{features}] What it does allow, though, is enabling or disabling
+% OpenType font features pertaining to ligatures. With \xetex\ or \luatex,
+% the |features| key accepts any number of \pkg{fontspec} options for the
+% `Ligatures' font feature, \eg, |NoCommon|, |Rare|, |RequiredOff| or
+% |ResetAll| (see the \cite{fontspec} documentation for details).
+% With \luatex, the |features| and the |no ligatures| keys
+% may even be combined, where the latter will take precedence.
%\end{options}
%
%\ifx\lssample\undefined
@@ -2112,8 +2124,9 @@
%
%\medskip\noindent
% Letterspaced fonts for which settings don't exist will be spaced out by the
-% default of \EM{0.1} (adjustable with the package option \opt{letterspace}, see
-% section~\ref{sub:options-misc}). Suppose your editor wants you to shorten
+% default of \EM{\fpeval{\MT at letterspace@default/1000}}
+% (adjustable with the package option \opt{letterspace}, see
+% section~\ref{sub:options-tracking}). Suppose your editor wants you to shorten
% your 1000-pages chef-d'\oe uvre by a handful of pages, you could load
% \microtype\ with (fingers crossed):
%\begin{verbatim}
@@ -2167,6 +2180,7 @@
% \par
% For example, you can find the following settings, intended to be used
% for documents written in French, in the main configuration file:
+%\pagebreak ^^A layout
%\begin{verbatim}[deletekeywords={[1]{unit}}]
%\SetExtraKerning
% [ name = french-default,
@@ -2322,7 +2336,6 @@
% same time, whereas lists prefixed with `|(l)|' or `|(r)|' and those prefixed with
% `|(lr)|' are mutually exclusive.
% For all other features except protrusion, these prefixed lists will be ignored.
-%\looseness=-1 ^^A layout
%
%
%\subsection{Configuration files}\label{sub:config-file}
@@ -2512,14 +2525,17 @@
% section~\ref{sub:hook}.}
% This command will load the file `|mt-|\meta{font name}|.cfg|'.
%
+%\enlargethispage{\baselineskip} ^^A layout
%\medskip
%\Describe{Macro}{\DeclareMicrotypeFilePrefix}{prefix}
-% Or, in fact, it will load the file `\meta{prefix}|-|\meta{file name}|.cfg|'.
+% Or, in fact, it will load the file `\meta{prefix}|-|\meta{font 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}
+%\section[Context-sensitive setup]
+% {Context-sensitive setup\requires{\pdftex~1.40,\luatex~0.30}}
+% \label{sec:context}
%
% The \microtype\ package also allows applying different micro-typographic
% settings to the fonts depending on the context in which they occur. This
@@ -2620,7 +2636,7 @@
%
%
%\section[Letterspacing revisited]
-% {Letterspacing revisited \requires{\pdftex~1.40,\luatex~0.62}}
+% {Letterspacing revisited \requires{\pdftex~1.40,\luatex~0.62,\xetex~0.9997}}
% \label{sec:lettersp} ^^A [also referenced in microtype.ins]
%
%\Describe{Macro}{\textls}{?amount,general text}
@@ -2643,7 +2659,8 @@
% The starred version of \cs{textls} does not add any
% extra kerning before or after the text, which may be useful, \eg, for section
% titles. By default, each character will be spaced out by
-% \EM{100/1000}\,=\,\EM{0.1}; this amount may be altered in the optional
+% \EM{\MT at letterspace@default/1000}\,=\,\EM{\fpeval{\MT at letterspace@default/1000}};
+% this amount may be altered in the optional
% argument to \cs{textls}, using the \cs{SetTracking} command, or globally with
% the \opt{letterspace} package option, with decreasing significance in this
% order.
@@ -2700,6 +2717,7 @@
% (which does not support package options) simply \cmd\input\ \file{letterspace.sty}.
%
%
+%\pagebreak ^^A layout
%\section[Disabling ligatures]
% {Disabling ligatures \requires{\pdftex~1.30,\luatex~0.30}}
% \label{sec:disable-ligatures}
@@ -2800,7 +2818,7 @@
%\begin{verbatim}[belowskip=-\smallskipamount]
%\newtagform{mytag}[\textbf]{\leftprotrusion{(}}{\rightprotrusion{)}}
%\end{verbatim}^^A
-% \MTsupp{\pkg{amsmath}, \cls{IEEEtran}}
+% \MTsupp{\pkg{amsmath}, \cls{IEEEtran}, \pkg{showkeys}}
%\endlist\endgroup
%
%\medskip\noindent
@@ -3076,7 +3094,7 @@
%
% \item
%\begin{verbatim}[deletekeywords={[1]{patch}}]
-%Package microtype Warning: Unable to apply patch `<eqnum>' on input line <29>.
+%Package microtype Warning: Unable to apply patch `<footnote>' on input line <29>.
%\end{verbatim}
%\changes{v3.1}{2022/09/15}{add hint about protrusion patch warnings}
% As described in chapter~\ref{sec:pedantic} above, \microtype\ tries to patch a number
@@ -3087,7 +3105,7 @@
% 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}}
+%\microtypesetup{nopatch=footnote}
%\end{verbatim}
%
% \item
@@ -3129,6 +3147,7 @@
% distributions, this can be changed in the file \file{updmap.cfg} by setting
% |pdftexDownloadBase14| to |true|.
%
+%\pagebreak ^^A layout
% \item
%\begin{verbatim}
%Warning: pdflatex (file <ecrm1000+20>): Font <ecrm1000+20 at 1200> not found
@@ -3194,7 +3213,7 @@
%
% This package would be pointless if
% \contributor H\`an \thanhthe{} Th\`anh <thanh\at pdftex.org>
-% hadn't created the \pdftex\ programme in the first place, which introduced
+% hadn't created the \pdftex\ program in the first place, which introduced
% the micro-typographic extensions and made them available to the \TeX\ world.
% Furthermore, I thank him for helping me to improve this package, and not
% least for promoting it in \cite{ThanhPracTeX}, \cite{ThanhEuroTeX07} and ^^A comma, to avoid the Three Ands Falls
@@ -3319,6 +3338,7 @@
% `\contributor Henning <@\at @>', ^^A https://tex.stackexchange.com/users/64603/henning
% \contributor Ronnie Marksch <Ronnie.Marksch\at yahoo.de>,
% \contributor David Carlisle <d.p.carlisle\at gmail.com>,
+% `\contributor web-stranger <@\at @>', ^^A https://tex.stackexchange.com/users/75134/web-stranger
% `\contributor Max <@\at @>', ^^A https://tex.stackexchange.com/users/16809/max
% `\contributor HcN <@\at @>', ^^A https://tex.stackexchange.com/users/87090/hcn
% \contributor Will Robertson <will\at wspr.io>,
@@ -3378,9 +3398,17 @@
% `\contributor simon-codes-something <@\at @>', ^^A https://github.com/simon-codes-something
% `\contributor scholnik <@\at @>', ^^A https://github.com/scholnik
% \contributor Ulrich Schwarz <@\at @>, ^^A https://tex.stackexchange.com/users/1860/ulrich-schwarz
-% \contributor Bruno Victal <mirai\at makinata.eu>
+% \contributor Bruno Victal <mirai\at makinata.eu>,
+% \contributor Linas Stonys <lstonys\at vtex.lt>,
+% `\contributor user202729 <@\at @>', ^^A https://tex.stackexchange.com/users/250119/user202729
+% \contributor Oliver Beery <@\at @>, ^^A https://github.com/beeryoliver
+% \contributor Bernhard Fisseni <@\at @>, ^^A https://github.com/teoric
+% \contributor Aleksandr Petrosyan <@\at @>, ^^A https://github.com/appetrosyan
+% \contributor Didier Verna <@\at @>, ^^A https://tex.stackexchange.com/users/24506/didier-verna
+% `\contributor nowox <@\at @>', ^^A https://tex.stackexchange.com/users/85416/nowox
+% `\contributor hpvd <@\at @>' ^^A https://github.com/hpvd
% and
-% \contributor Linas Stonys <lstonys\at vtex.lt>.
+% \contributor Mark Collins <@\at @>. ^^A https://github.com/Marcool04
%
%\iffalse
%\section{History of micro-typography} ^^A some time ...
@@ -3449,9 +3477,10 @@
% (Online at \url{https://www.tug.org/TUGboat/Articles/tb29-1/tb91thanh-fonts.pdf})
%
% \bibitem[\pdftex\ manual]{pdftexman}
-% \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, Karl Berry,
+%^^A \thanh, Sebastian Rahtz, Hans Hagen, Hartmut Henkel, Pawe\l\ Jackowski, Martin Schr\"oder, Karl Berry,
+% \thanh\ and others,
% \emph{The \pdftex\ user manual},
-% 28~February 2023.
+% 22~February 2024.
% (\ctanurl{systems/doc/pdftex/manual/pdftex-a.pdf})
%
% \bibitem[Fontname]{fontname}
@@ -3461,19 +3490,19 @@
%
% \bibitem[\LaTeXe\ font selection]{fntguide}
% \LaTeX\ Project Team, \emph{\LaTeXe\ font selection},
-% October 2023.
+% September 2024.
% (\ctanurl{macros/latex/base/fntguide.pdf})
%
% \bibitem[\pkg{fontspec}]{fontspec}
% Will Robertson,
% \emph{The \pkg{fontspec} package: Font selection for \xe\LaTeX\ and Lua\LaTeX},
-% 15~January 2022.
+% 11~May 2024.
% (\ctanpkgurl{fontspec})
%
% \bibitem[\pkg{luaotfload}]{luaotfload}
% \LaTeX3 Project, \'Elie Roux, Khaled Hosny, Philipp Gesang, Ulrike Fischer, Marcel Kr\"uger,
% \emph{The \pkg{luaotfload} package},
-% 31~August 2023.
+% 14~February 2024.
% (\ctanpkgurl{luaotfload})
%
% \bibitem[\pkg{pdfcprot}]{pdfcprot}
@@ -3521,8 +3550,18 @@
%
%\begin{History}
%
-%\VersionDate{\expandafter\@gobble\fileversion}{\filedate}
+%\Version{\expandafter\@gobble\fileversion}{\filedate}
+% \item Support for tracking/letterspacing with \xetex\
+% \refsection{\ref{sub:options-microtype}, \ref{sub:tracking}, \ref{sec:lettersp}}
+% \item New default for letterspacing: \MT at letterspace@default\space \refsection{\ref{sub:options-tracking}}
+% \item New key `\texttt{features}' for \cs{SetTracking} to enable\slash disable
+% \pkg{fontspec} `Ligatures' features (\luatex/\xetex\ only)
+% \refsection{\ref{sub:tracking}}
+% \item New values `|none|' and `|all|' for the `|no ligatures|' key of
+% \cs{SetTracking} \refsection{\ref{sub:tracking}}
%
+%\VersionDate{3.1b}{2024/03/29}
+%
%\VersionDate{3.1a}{2023/03/13}
%
%\Version{3.1}{2023/03/06}
@@ -3957,7 +3996,7 @@
% \enquote,\foreignquote,\foreigntextquote,\foreigntextcquote,
% \hyphenquote,\hyphentextquote,\hyphentextcquote,\textquote,\textcquote} ^^A csquotes
%\DoNotIndex{\meta} ^^A doc
-%\DoNotIndex{\apptocmd,\gappto,\ifdefmacro,\ifdefparam,\patchcmd} ^^A etoolbox
+%\DoNotIndex{\apptocmd,\gappto,\ifdefdimen,\ifdefmacro,\ifdefparam,\patchcmd}^^A etoolbox
%\DoNotIndex{\txfigures,\lnfigures,\tbfigures,\prfigures,\fontfigurestyle,
% \fontfigurealignment,\fontbasefamily,\figureversion,\textfigures,
% \liningfigures,\tabularfigures,\proportionalfigures} ^^A fontaxes
@@ -3995,6 +4034,7 @@
%\DoNotIndex{\SOUL@,\SOUL at doword,\soulregister} ^^A soul
%\DoNotIndex{\tikz at expandcount} ^^A tikz
%\DoNotIndex{\conditionally at traceoff} ^^A trace
+%\DoNotIndex{\@vwid at sift,\sift at deathcycles,\@vwid at resetb,\@vwid at loff,\@vwid at measure}^^A varwidth
%\DoNotIndex{\@xspace,\@xspace at firsttrue} ^^A xspace
%\DoNotIndex{\frakfamily,\gothfamily,\swabfamily,\textfrak,\textgoth,\textswab}^^A yfonts
%\DoNotIndex{\booknumberline,\chapternumberline,\foottextfont,\partnumberline,
@@ -4007,7 +4047,7 @@
% \ifMT at inannot,\MT at inannottrue,\MT at inannotfalse,\MT at addto@annot,\MT at pdf@annot,
% \MT at show@pdfannot,\iftracingmicrotypeinpdfall,\tracingmicrotypeinpdfalltrue,
% \tracingmicrotypeinpdfallfalse,\DeclareMicroTypeAlias,\DeclareMicroTypeSet,
-% \LoadMicroTypeFile,\DeclareMicrotypeFilePrefix,\UseMicroTypeSet,\MicroType at Hook}^^A microtype
+% \LoadMicroTypeFile,\UseMicroTypeSet,\MicroType at Hook} ^^A microtype
%
% ^^A -------------------------------------------------------------------------
%
@@ -5053,7 +5093,6 @@
\MessageBreak I will quit now}
\MT at clear@options
\endinput\fi
-%</package|letterspace>
% \end{macrocode}
% Still there? Then we can begin:
% We need the \pkg{keyval} package, including the `new' \cmd\KV@@sp at def\
@@ -5062,7 +5101,6 @@
% For the \opt{patch} option, we use \pkg{etoolbox}, which requires \etex.
%\changes{v3.0}{2021/05/17}{require package \pkg{etoolbox} (for \opt{patch} option)}
% \begin{macrocode}
-%<*package|letterspace>
\RequirePackage{keyval}[1997/11/10]
%<*package>
^^X\RequirePackage{etoolbox}
@@ -5226,10 +5264,12 @@
%\begin{macro}{\MT at letterspace}
%\begin{macro}{\MT at letterspace@default}
% Default value for letterspacing (in thousandths of \EM{1}).
+%\changes{v3.2}{2024/10/11}{new default for letterspacing: \MT at letterspace@default\space
+% (following a report by \contributor Mark Collins <@\at @>) \githubissue{41}}
% \begin{macrocode}
%</package>
\let\MT at letterspace\m at ne
-\def\MT at letterspace@default{100}
+\def\MT at letterspace@default{50}
%<*package>
% \end{macrocode}
%\end{macro}
@@ -5484,9 +5524,9 @@
%\begin{macro}{\MT at if@expanding at F@}
% The following voodoo is based on a trick by \contributor Ulrich Schwarz <@\at @>.\footnote{Cf. \url{https://tex.stackexchange.com/a/29188/7674}}
% \begin{macrocode}
+%<*package>
\def\MT at if@expanding at F{\let\MT at if@expanding at F@\MT at if@expanding at F@\@firstofone}
\def\MT at if@expanding at F@#1#2#3{\relax\relax}
-%<*package>
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -5921,20 +5961,31 @@
% \end{macrocode}
%\end{macro}
%\changes{v2.6a}{2016/05/03}{fixes for \letterspace\ package with \luatex}
-%\begin{macro}{\MT at if@luaotf at font}
+%\begin{macro}{\MT at if@opentype at font}
%\changes{v2.8}{2019/11/27}{use \texttt{lua} function}
-% For fonts loaded by \pkg{luaotfload} we query the font's table.
+%\changes{v3.2}{2024/05/13}{version for \xetex}
+% For fonts loaded by \pkg{luaotfload} we query the font's table,
+% for \xetex, the font type. (`opentype' here stands for non-legacy.)
% \begin{macrocode}
-%<letterspace>\MT at pdf@or at lua{\let\MT at if@luaotf at font\@secondoftwo}{
+%<letterspace>\MT at pdf@or at lua{\let\MT at if@opentype at font\@secondoftwo}{
%<*lua-|letterspace>
-\def\MT at if@luaotf at font{\csname\MT at lua{%
- microtype.if_luaotf_font()
+\def\MT at if@opentype at font{\csname\MT at lua{%
+ microtype.if_opentype_font()
}\endcsname
}
%</lua-|letterspace>
+%<*xe->
+\def\MT at if@opentype at font{%
+ \ifnum\XeTeXfonttype\font at name=\z@
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}
+%</xe->
%<letterspace>}
%<*luafile>
-local function if_luaotf_font()
+local function if_opentype_font()
local thefont = font.getfont(font.current())
if thefont and ( thefont.format == "opentype" or thefont.format == "truetype" )
then tex.write("@firstoftwo")
@@ -5941,7 +5992,7 @@
else tex.write("@secondoftwo")
end
end
-microtype.if_luaotf_font = if_luaotf_font
+microtype.if_opentype_font = if_opentype_font
%</luafile>
% \end{macrocode}
@@ -5961,7 +6012,7 @@
% \begin{macrocode}
%<*lua->
\def\MT at do@font#1{%
- \MT at if@luaotf at font{%
+ \MT at if@opentype at font{%
\def\MT at dofont@function{#1}%
\MT at lua{microtype.do_font()}%
}{\MT at while@num\z@\@cclvi{#1}}%
@@ -6003,7 +6054,6 @@
\ifnum\@tempcnta < \XeTeXlastfontchar\MT at font \MT at repeat
}
%</xe->
-%<*package>
% \end{macrocode}
%\end{macro}
%\changes{v1.4}{2004/11/12}{use one instead of five counters}
@@ -6013,6 +6063,7 @@
%\changes{v1.7}{2005/03/07}{use \etex's \cmd\numexpr\ if available}
% The \etex\ way is slightly faster.
% \begin{macrocode}
+%<*package>
\newcount\MT at count
\def\MT at increment#1{%
^^X \edef#1{\number\numexpr #1 + 1\relax}%
@@ -6177,6 +6228,7 @@
Expect lots of warnings and some malfunctions.\MessageBreak
You might want to use a proper class instead}%
}\relax
+%</package>
% \end{macrocode}
%\begin{macro}{\MT at setup@}
%\changes{v1.9a}{2005/11/21}{defer setup until the end of the preamble}
@@ -6189,7 +6241,6 @@
% advantages: \cs{microtypesetup} can be used to change options later on in the
% preamble, and fonts don't have to be set up before \microtype.
% \begin{macrocode}
-%</package>
%<*package|letterspace>
%<plain>\MT at requires@latex1{
\let\MT at setup@\@empty
@@ -6211,7 +6262,6 @@
% \begin{macrocode}
\def\MT at with@package at T#1{\@ifpackageloaded{#1}\@firstofone\@gobble}
%</package|letterspace>
-%<*package>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at with@babel at and@T}
@@ -6220,6 +6270,7 @@
%\changes{v3.1b}{2023/03/24}{don't use \cmd\@pkgextension\ (was \cmd\@onlypreamble d in older \LaTeX\ versions)}
% \LaTeX's \cmd\@ifpackagewith\ ignores the class options.
% \begin{macrocode}
+%<*package>
\def\MT at with@babel at and@T#1{%
\MT at ifdefined@n at T{opt at babel.sty}{%
\@expandtwoargs\MT at in@clist{#1}
@@ -6227,6 +6278,7 @@
\ifMT at inlist@\expandafter\@secondoftwo\else\expandafter\@firstofone\fi
}\@gobble
}
+%</package>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at ledmac@setup}
@@ -6258,9 +6310,8 @@
%\changes{v2.6}{2015/08/10}{support for \pkg{reledmac}}^^A
% The successor packages \pkg{eledmac} and \pkg{reledmac} are also supported.
% \begin{macrocode}
-%</package>
+%<*pdf-|lua-|xe->
%<pdf->\MT at requires@pdftex5{
-%<*pdf-|lua-|xe->
\def\MT at ledmac@setup{%
\ifMT at protrusion
\MT at ifdefined@c at TF\l at dunhbox@line{%
@@ -6289,7 +6340,6 @@
}%
\fi
}
-%</pdf-|lua-|xe->
%<*pdf->
}{
\def\MT at ledmac@setup{%
@@ -6302,7 +6352,48 @@
\fi
}
}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at varwidth@setup}
+% Likewise, the \pkg{varwidth} package de- and reassembles \cmd\vbox es
+% line by line, in the course of which margin kerns will get lost.
+% We patch the relevant commands to record and reinsert the margin kerns.
+%\changes{v3.2}{2024/05/03}{patch \pkg{varwidth} to allow for margin kerning
+% (reported by `\contributor web-stranger <@\at @>')}
+% ^^A https://tex.stackexchange.com/questions/245798/microtype-raggedright-and-varwidth-doesnt-work-well-with-each-other
+% \begin{macrocode}
+\MT at requires@pdftex5{
%</pdf->
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+^^Q \MT at warning@nl{Cannot patch varwidth without etex extensions}%
+^^X \MT at info@nl{Patching varwidth to enable character protrusion}%
+^^X \newdimen\MT at vwid@leftmargin
+^^X \newdimen\MT at vwid@rightmargin
+^^X \patchcmd\@vwid at sift{\sift at deathcycles\z@}
+^^X {\MT at vwid@leftmargin\leftmarginkern\z@
+^^X \MT at vwid@rightmargin\rightmarginkern\z@ \sift at deathcycles\z@}{}{}%
+^^X \patchcmd\@vwid at resetb{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+^^X \patchcmd\@vwid at measure{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+ \fi
+ }
+%<*pdf->
+}{
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+ \MT at warning@nl{%
+ The pdftex version you are using does not allow\MessageBreak
+ character protrusion in varwidth environments.\MessageBreak
+ Upgrade pdftex to version 1.30 or later}%
+ \fi
+ }
+}
+%</pdf->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
% The \pkg{shapepar} package (v2.2) fixes this in a similar manner by itself,
@@ -6456,6 +6547,7 @@
\MT at with@package at T {ledmac}\MT at ledmac@setup
\MT at with@package at T {eledmac}\MT at ledmac@setup
\MT at with@package at T{reledmac}\MT at ledmac@setup
+ \MT at with@package at T{varwidth}\MT at varwidth@setup
\MT at with@package at T{xunicode}\MT at xunicodetrue
\MT at with@package at T{fontspec}\MT at fontspectrue
% \end{macrocode}
@@ -6643,7 +6735,7 @@
}%
%</package>
}
-%<*package>
+%</package|letterspace>
% \end{macrocode}
%
%\subsubsection{Protrusion patches}
@@ -6655,6 +6747,7 @@
%\begin{macro}{\MT at patch@info at undo}
% We have to patch some macros to get protrusion right.
% \begin{macrocode}
+%<*package>
\newif\ifMT at patch@ok
\def\MT at patch@info#1{\MT at info{Applying patch `#1'}}
\def\MT at patch@warn#1{\MT at warning{Unable to apply patch `#1'}}
@@ -6873,6 +6966,7 @@
%\changes{v3.0}{2021/05/21}{protrusion patch for equation numbers
% (provided by \contributor Holger Gerhardt <holger.gerhardt\at uni-bonn.de>)}
%\changes{v3.0a}{2021/11/22}{protrusion patch \texttt{eqnum} for \cls{IEEEtran}}
+%\changes{v3.2}{2024/12/12}{protrusion patch \texttt{eqnum}: fix for \pkg{showkeys}}
% \begin{itemize}
% \item \cls{IEEEtran}
% \begin{macrocode}
@@ -6885,11 +6979,16 @@
{}%
% \end{macrocode}
% \item \cmd\eqref\ (\pkg{amsmath}) relies on \cmd\tagform@, so we have to have it
-% use the original definition.
+% use the original definition. The \pkg{showkeys} package also modifies this
+% command, as well as \cmd\@eqnnum\space (below); we don't test for the package
+% itself but the relevant command, which is only redefined <ABD>.
% \begin{macrocode}
\@ifpackageloaded{amsmath}
- {\MT at patch@patch\tagform@{(}{\leftprotrusion{(}}%
- \MT at patch@patch\tagform@{)}{\rightprotrusion{)}}%
+ {\MT at ifdefined@c at TF\SK at tagform@
+ {\MT at patch@patch\SK at tagform@{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\SK at tagform@{)}{\rightprotrusion{)}}}%
+ {\MT at patch@patch\tagform@{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\tagform@{)}{\rightprotrusion{)}}}%
% \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\
@@ -6909,6 +7008,7 @@
%\changes{v3.0c}{2021/12/30}{info that protrusion patch \texttt{eqnum} may not be effective with \pkg{mathtools}
% (reported by \contributor user182849 <@\at @>)}
% ^^A https://tex.stackexchange.com/questions/628090/usetagform-incompatible-with-microtype/
+%\changes{v3.2}{2024/12/12}{protrusion patch \texttt{eqnum}: fix for \cls{IEEEtran}}
% \begin{macrocode}
\MT at with@package at T{mathtools}{%
\ifMT at patch@ok\else \MT at patch@oktrue
@@ -6918,8 +7018,12 @@
`\@backslashchar rightprotrusion' as\MessageBreak
appropriate in mathtools's `\@backslashchar newtagform' command}%
\fi}}
- {\MT at patch@patch\@eqnnum{(}{\leftprotrusion{(}}%
- \MT at patch@patch\@eqnnum{)}{\rightprotrusion{)}}}%
+ {\@ifclassloaded{IEEEtran}{}
+ {\MT at ifdefined@c at TF\SK at eqnnum
+ {\MT at patch@patch\SK at eqnnum{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\SK at eqnnum{)}{\rightprotrusion{)}}}%
+ {\MT at patch@patch\@eqnnum{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\@eqnnum{)}{\rightprotrusion{)}}}}}%
}{}%
% \end{macrocode}
% \end{itemize}
@@ -6927,6 +7031,25 @@
%\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 The new footnote code (in \file{latex-lab-footnotes.ltx}), which is meant
+% to facilitate tagging, introduces many hooks, among them |fntext/begin|, which
+% would seem appropriate for us. Unfortunately, however, we cannot use it, as we'd
+% stumble over the hook management itself.
+%^^A see my feature request at https://github.com/latex3/tagging-project/issues/726
+% I think it's unnecessary to patch the |expl3| version too, but I suppose
+% it won't do any harm either.
+% There's no new code for footnotes in minipages at the moment.
+%\changes{v3.2}{2024/10/03}{fix protrusion patch \texttt{footnote} for tagging
+% (reported by \contributor hpvd <@\at @>) \githubissue{40}}
+% \begin{macrocode}
+ \MT at define@patch{footnote}{%
+ \MT at ifdefined@n at TF{fnote_footnotetext:n}
+ {\ExplSyntaxOn
+ \MT at patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT at exp@cs\MT at patch@patch{fnote_footnotetext:n}{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \ExplSyntaxOff}
+% \end{macrocode}
% \item \pkg{hyperref} also patches this command (but only if |hyperfootnotes=true|,
% |implicit=true| and \cmd\hyper at nopatch@footnote\ is undefined)
%\changes{v3.0a}{2021/11/30}{fix protrusion patch \texttt{footnote} with \pkg{hyperref}
@@ -6936,8 +7059,7 @@
%\changes{v3.0e}{2022/05/21}{fix protrusion patch \texttt{footnote} for \pkg{hyperref}
% if \cmd\hyper at nopatch@footnote\ is defined}
% \begin{macrocode}
- \MT at define@patch{footnote}{%
- \@ifpackageloaded{hyperref}
+ {\@ifpackageloaded{hyperref}
{\MT at if@false
\ifHy at implicit
\ifHy at hyperfootnotes
@@ -6983,12 +7105,12 @@
% \item the base classes
% \begin{macrocode}
{\MT at patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
- \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}%
+ \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}}%
}{}%
% \end{macrocode}
% \end{itemize}
% \item [|verbatim|] disable all microtypographic extensions in
-% verbatim blocks. (This could have been a nice opportunity
+% verbatim blocks. (This could have been another 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
@@ -7015,7 +7137,6 @@
\MT at redefined@patches
}}
%</package>
-%</package|letterspace>
% \end{macrocode}
%
%\subsection{Font setup}\label{sub:font-setup}
@@ -7088,7 +7209,9 @@
% \begin{macrocode}
%<pdf->\MT at requires@pdftex6
%<lua->\MT at requires@luatex3
-%<pdf-|lua-> {\g at addto@macro\MT at setupfont\MT at tracking}\relax
+%<pdf-|lua->{
+%<pdf-|lua-|xe-> \g at addto@macro\MT at setupfont\MT at tracking
+%<pdf-|lua->}\relax
\g at addto@macro\MT at setupfont{%
\MT at check@font
\ifMT at inlist@
@@ -7218,7 +7341,7 @@
%<pdf->}\relax
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT at lua@copy at font}
+%\begin{macro}{\MT at lua@copy at font} ^^A TODO: \fontname ?
% \meta{\#1} and \meta{\#2} are `|select|' and `|font|', respectively,
% \meta{\#3} is the font spec.
% \begin{macrocode}
@@ -8347,7 +8470,9 @@
% that's how the penalties bug was discovered~\dots).
%\changes{v3.0d}{2022/03/03}{no longer reset counters
% (reported by \contributor Brian Dunn <@\at @>) \githubissue{14}}
-% (We no longer reset counters etc., since we don't typeset groups anymore.)
+% (We no longer reset counters etc., since we don't typeset whole arguments anymore.)
+% Also, we begin a group to make it color-safe.
+%\changes{v3.2}{2024/04/24}{make color-safe}
%\begin{macro}{\MT at prot@hook}
% Furthermore, we have a hook for compatibility fixes (currently used for \pkg{csquotes} only),
%\begin{macro}{\MT at csq@eqgroup}
@@ -8386,7 +8511,9 @@
\interlinepenalty\z@
\@newlistfalse
\MT at prot@hook
- \MT at noindent #1\relax\MT at csq@eqgroup}%
+ \begingroup
+ \MT at noindent #1\relax\MT at csq@eqgroup
+ \endgroup}%
\vbadness=\@M
\splittopskip=\z@
\vfuzz=\maxdimen
@@ -8531,6 +8658,148 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\begin{macro}{\MT at prot@get at first@group}
+%\begin{macro}{\MT at prot@get at first@group@}
+% If next char is |{|, start a group and try again, else continue until
+% we find a beginning char.
+% \begin{macrocode}
+\def\MT at prot@get at first@group@{%
+ \MT at prot@ifcat\bgroup{%
+ \def\MT at temp*{\MT at prot@addgroup}%
+ }{%
+ \def\MT at temp*{\MT at prot@get at first@token}%
+ }%
+ \MT at temp*%
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT at prot@get at first@group at tc}
+% The variant for text commands (in case they start with another group).
+% \begin{macrocode}
+\def\MT at prot@get at first@group at tc{%
+ \MT at prot@ifcat\bgroup{%
+ \def\MT at temp*##1##2\MT at nil{\MT at ifempty{##1}\relax
+ {{\MT at prot@get at firstgroup@tc##1\MT at nil}}}%
+ }{%
+ \def\MT at temp*{\MT at prot@get at first@token}%
+ }%
+ \MT at temp*%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at prot@get at 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 at prot@get at first@token{%
+ \def\MT at temp*{\MT at exp@one at n\MT at ifempty{\the\MT at toks}
+ {\MT at exp@one at n\MT at ifempty{\the\MT at prot@toks}\relax{\the\MT at prot@toks\MT at gobble@to at nil}}
+ {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}}%
+ \MT at prot@ifcat{a}{%
+ \def\MT at temp*{\MT at prot@addtoken at first}%
+ }{%
+ \MT at prot@ifcat{!}{%
+ \def\MT at temp*{\MT at prot@addtoken at first}%
+ }{%
+% \end{macrocode}
+% a space character, \dots
+% \begin{macrocode}
+ \MT at prot@ifx\@sptoken{%
+ \def\MT at temp* {\MT at prot@get at firstgroup}%
+ }{%
+% \end{macrocode}
+% commands, \dots
+% \begin{macrocode}
+ \let\MT at prot@ifmacro\MT at prot@ifmacro@
+ \MT at map@tlist at c\MT at prot@check at cmds\MT at prot@check
+% \end{macrocode}
+% \dots~or a command/active char whose first command is one of the following:
+% \begin{macrocode}
+ \MT at prot@ifmacro{%
+ \MT at prot@iffirstcmd\UTFviii at two@octets{%
+ \def\MT at temp*##1##2{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2}}%
+ }{%
+ \MT at prot@iffirstcmd\UTFviii at three@octets{%
+ \def\MT at temp*##1##2##3{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3}}%
+ }{%
+ \MT at prot@iffirstcmd\UTFviii at four@octets{%
+ \def\MT at temp*##1##2##3##4{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3##4}}%
+ }{%
+% \end{macrocode}
+% (this is for chars made active by \pkg{csquotes}, via \cmd\MakeAutoQuote\ or
+% \cmd\MakeOuterQuote)
+% \begin{macrocode}
+ \MT at prot@iffirstcmd\csqQQ{\def\MT at temp*##1{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1}}}{%
+% \end{macrocode}
+% or, finally, a <LICR> command.
+% \begin{macrocode}
+ \MT at prot@iflicrcmd
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \MT at temp*%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at prot@addtoken at first}
+% Begin filling toks.
+% \begin{macrocode}
+\def\MT at prot@addtoken at first#1{%
+ \MT at toks\expandafter{\the\MT at toks#1}%
+ \MT at prot@get at nexttoken
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at prot@get at next@token}
+% Continue if letter or other.
+% \begin{macrocode}
+\def\MT at prot@get at next@token{%
+ \def\MT at temp*{\MT at prot@addtoken at next}%
+ \MT at prot@ifcat{a}\relax{%
+ \MT at prot@ifcat{!}\relax{%
+ \def\MT at temp*{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
+ }%
+ }%
+ \MT at temp*%
+}
+%</package>
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at prot@addtoken at next}
+% Add token to our toks and test whether we've seen enough (ligature completed).
+% For luatex, we have to jump through another hoop (\ie, box), because, contrary
+% to the manual, \cmd\lastnodetype\ isn't really compatible. ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-August/006536.html et seqq.
+%\changes{v3.2}{2024/04/24}{make color-safe}
+% \begin{macrocode}
+%<*pdf-|lua-|xe->
+\def\MT at prot@addtoken at next#1{%
+ \MT at toks\expandafter{\the\MT at toks#1}%
+ \setbox\MT at tempbox\hbox{%
+ \begingroup
+% \end{macrocode}
+% We disable italic correction, which would prevent us from
+% seeing the ligature (with text commands).
+% \begin{macrocode}
+ \let\maybe at ic\relax
+ \MT at exp@one at n\MT at maybe@textcmd{\the\MT at toks}%
+%<pdf-|xe-> \relax
+ \endgroup
+%<lua-> }\setbox\MT at tempbox\hbox{\unhbox\MT at tempbox
+ \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
+ \MT at prot@get at nexttoken
+ {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
+}
+%</pdf-|lua-|xe->
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\MT at prot@check}
%\changes{v3.1}{2022/12/17}{allow replacement command}
%\begin{macro}{\MT at prot@check@}
@@ -8538,6 +8807,7 @@
% \meta{\#3} will be \cmd\relax\ by default, but can also indicate
% a replacement command.
% \begin{macrocode}
+%<*package>
\def\MT at prot@check#1{\MT at prot@check@#1\relax\@nil}
\def\MT at prot@check@#1#2#3\@nil{%
\ifx\MT at prot@next#2%
@@ -8570,7 +8840,7 @@
% \end{macrocode}
%\end{macro}
% \item
-%\begin{macro}{\MT at prot@check at X}
+%\begin{macro}{\MT at prot@check at O}
% Add a command with \textbf{O}ne argument.
% \begin{macrocode}
\def\MT at prot@check at O{%
@@ -8579,6 +8849,28 @@
% \end{macrocode}
%\end{macro}
% \item
+%\begin{macro}{\MT at prot@check at o}
+%\changes{v3.2}{2024/04/24}{new macro: for one-argument commands with optional argument}
+%\begin{macro}{\MT at prot@check at o@}
+% The same with an optional argument.
+% \begin{macrocode}
+\def\MT at prot@check at o{%
+ \def\MT at temp*##1{\@ifnextchar[{\MT at prot@check at o@##1}{\MT at prot@check at o@##1[]}}%
+}
+% \end{macrocode}
+% The \cmd\color\ command, for which this is used, would stumble over an empty
+% optional argument.
+% \begin{macrocode}
+\def\MT at prot@check at o@#1[#2]#3{%
+ \MT at ifempty{#2}
+ {\MT at toks\expandafter{\the\MT at toks#1{#3}}}
+ {\MT at toks\expandafter{\the\MT at toks#1[#2]{#3}}}%
+ \MT at prot@get at firstgroup
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+% \item
%\begin{macro}{\MT at prot@check at T}
% Add a command with \textbf{T}wo arguments.
% \begin{macrocode}
@@ -8670,6 +8962,9 @@
% ^^A private mail, 2023/03/13
%\changes{v3.1b}{2024/03/29}{fix: failed when group began with another command
% \githubissue{31}}
+%\changes{v3.2}{2024/09/03}{fix: add \cmd\@empty\ (reported by \contributor nowox <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/725639/insert-monospace-text-at-the-beginning-of-item-while-using-microtype
+%\begin{macro}{\MT at prot@check at F@@}
% 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,
@@ -8684,22 +8979,55 @@
\else
\let\MT at prot@l\MT at prot@l at tc
\let\MT at prot@get at first@group\MT at prot@get at first@group at tc
- \def\MT at temp*##1##2{%
- \let\MT at maybe@textcmd##1%
+ \def\MT at temp*##1{%
\the\MT at toks
\MT at toks{}%
- \MT at prot@toks{##1{##2}}%
- \MT at prot@get at firstgroup@tc##2\MT at nil
+ \MT at prot@check at F@##1%
}%
\fi
}
+\def\MT at prot@check at F@@#1#2{%
+ \let\MT at maybe@textcmd#1%
+ \MT at prot@toks{#1{#2}}%
+ \MT at prot@get at firstgroup@tc#2\@empty\MT at nil
+}
% \end{macrocode}
%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT at prot@check at F@beamer}
+%\changes{v3.2}{2024/10/02}{compatibility with \cls{beamer}'s overlay specifications
+% (reported by \contributor Frank Mittelbach <frank.mittelbach\at latex-project.org>) \githubissue{38}}
+%\begin{macro}{\MT at prot@check at F@beamer@}
+% Compatibility with the \cls{beamer} class and its overlay specifications
+% (\eg, |\textbf<2>{...}|).
+% \begin{macrocode}
+\def\MT at prot@check at F@beamer#1{%
+ \@ifnextchar<%
+ {\MT at prot@check at F@beamer@#1}%
+ {\MT at prot@check at F@@#1}%
+}
+\def\MT at prot@check at F@beamer@#1<#2>#3{%
+ \def\MT at maybe@textcmd{#1<#2>}%
+ \MT at prot@toks{#1<#2>{#3}}%
+ \MT at prot@get at firstgroup@tc#3\@empty\MT at nil
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\begin{macro}{\MT at prot@check at F@}
+% Choose the right definition.
+% \begin{macrocode}
+\@ifclassloaded{beamer}
+ {\let\MT at prot@check at F@\MT at prot@check at F@beamer}
+ {\let\MT at prot@check at F@\MT at prot@check at F@@}
+% \end{macrocode}
+%\end{macro}
% \item
%\begin{macro}{\MT at prot@check at C}
%\changes{v3.1b}{2023/03/16}{new macro: for text commands with an optional argument
% (after \contributor scholnik <@\at @> reported
% that \cmd\MakeUppercase\ and friends support one) \githubissue{29}}
+%\begin{macro}{\MT at prot@check at C@}
% Same, but for commands that allow an optional argument (\eg, the \textbf{C}ase
% changing commands since \LaTeX\ 2022/11/01).
% \begin{macrocode}
@@ -8721,10 +9049,11 @@
\def\MT at prot@check at C@#1[#2]#3{%
\def\MT at maybe@textcmd{#1[#2]}%
\MT at prot@toks{#1[#2]{#3}}%
- \MT at prot@get at firstgroup@tc#3\MT at nil
+ \MT at prot@get at firstgroup@tc#3\@empty\MT at nil
}
% \end{macrocode}
%\end{macro}
+%\end{macro}
%\end{itemize}
%\begin{macro}{\MT at prot@check at cmds}
%\changes{v3.0e}{2022/06/09}{new macro: make list of commands extensible}
@@ -8734,6 +9063,7 @@
%\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.
+% (It's a bit of a shame that \cs{textls} is not among them.)
% \begin{macrocode}
\def\MT at prot@check at cmds{%
{I\ignorespaces}{I\relax}{I\@empty}%
@@ -8771,7 +9101,30 @@
% \begin{macrocode}
\@ifclassloaded{ltxdoc}
{\g at addto@macro\MT at prot@check at cmds{{E\enquote}{E\marg}{E\oarg}{E\parg}{E\cs}}}\relax
+% \end{macrocode}
+% Add \cmd\color\ (but not yet \cmd\textcolor).
+%\changes{v3.2}{2024/04/24}{add \pkg{color}'s \cmd\color\ command}
+% We also don't yet understand \cls{beamer}'s |<.-.>| notation added to \cmd\color.
+% \begin{macrocode}
\MT at addto@setup{%
+ \MT at with@package at T{color}
+ {\@ifclassloaded{beamer}\relax{\g at addto@macro\MT at prot@check at cmds{{o\color}}}}%
+% \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 at with@package at T{csquotes}
+ {\@ifclassloaded{ltxdoc}
+ {\patchcmd\MT at prot@check at cmds{E\enquote}{e\enquote}\relax\relax}
+ {\g at addto@macro\MT at prot@check at cmds{{e\enquote}}}%
+ \g at addto@macro\MT at prot@check at cmds{{e\textquote}%
+ {l\foreignquote}{l\hyphenquote}{l\foreigntextquote}{l\hyphentextquote}%
+ {{eX}\textcquote\textquote}%
+ {{lX}\foreigntextcquote\foreigntextquote}%
+ {{lX}\hyphentextcquote\hyphentextquote}}}%
\MT at with@package at T{doc}
{\g at addto@macro\MT at prot@check at cmds{{E\meta}}}%
% \end{macrocode}
@@ -8782,13 +9135,21 @@
{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 at addto@macro\MT at prot@check at cmds{%
{S\swshape}{S\ulcshape}{S\sscshape}%
- {F\textulc}{F\textsw}{F\textssc}}}}
+ {F\textulc}{F\textsw}{F\textssc}}}}%
% \end{macrocode}
+% \pkg{fontspec}'s \cmd\fontspec's command allows an optional
+% argument \emph{after} the mandatory one, and we can't deal with
+% that (yet).
+%\changes{v3.2}{2024/05/22}{add some \pkg{fontspec} commands}
+% \begin{macrocode}
+ \MT at with@package at T{fontspec}
+ {\g at addto@macro\MT at prot@check at cmds{%
+ {O\addfontfeature}{O\addfontfeatures}{F\strong}}}%
+% \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
@@ -8818,7 +9179,7 @@
{F\textmb}{F\textdb}{F\textsb}{F\texteb}%
{F\textub}{F\textlg}{F\textel}{F\textul}}%
\IfFormatAtLeastTF{2020/02/02}\relax
- {\g at addto@macro\MT at prot@check at cmds{{S\swshape}{F\textsw}}}}
+ {\g at addto@macro\MT at prot@check at cmds{{S\swshape}{F\textsw}}}}%
% \end{macrocode}
% If \pkg{yfonts} is loaded, we add the relevant commands.
% \begin{macrocode}
@@ -8826,164 +9187,10 @@
{\g at addto@macro\MT at prot@check at 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 at with@package at T{csquotes}
- {\@ifclassloaded{ltxdoc}
- {\patchcmd\MT at prot@check at cmds{E\enquote}{e\enquote}\relax\relax}
- {\g at addto@macro\MT at prot@check at cmds{{e\enquote}}}%
- \g at addto@macro\MT at prot@check at cmds{{e\textquote}%
- {l\foreignquote}{l\hyphenquote}{l\foreigntextquote}{l\hyphentextquote}%
- {{eX}\textcquote\textquote}%
- {{lX}\foreigntextcquote\foreigntextquote}%
- {{lX}\hyphentextcquote\hyphentextquote}}}%
}
-% \end{macrocode}
-%\end{macro}
-%\begin{macro}{\MT at prot@get at first@group}
-%\begin{macro}{\MT at prot@get at first@group@}
-% If next char is |{|, start a group and try again, else continue until
-% we find a beginning char.
-% \begin{macrocode}
-\def\MT at prot@get at first@group@{%
- \MT at prot@ifcat\bgroup{%
- \def\MT at temp*{\MT at prot@addgroup}%
- }{%
- \def\MT at temp*{\MT at prot@get at first@token}%
- }%
- \MT at temp*%
-}
-% \end{macrocode}
-%\end{macro}
-%\end{macro}
-%\begin{macro}{\MT at prot@get at first@group at tc}
-% The variant for text commands (in case they start with another group).
-% \begin{macrocode}
-\def\MT at prot@get at first@group at tc{%
- \MT at prot@ifcat\bgroup{%
- \def\MT at temp*##1##2\MT at nil{\MT at ifempty{##1}\relax
- {{\MT at prot@get at firstgroup@tc##1\MT at nil}}}%
- }{%
- \def\MT at temp*{\MT at prot@get at first@token}%
- }%
- \MT at temp*%
-}
-% \end{macrocode}
-%\end{macro}
-%\begin{macro}{\MT at prot@get at 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 at prot@get at first@token{%
- \def\MT at temp*{\MT at exp@one at n\MT at ifempty{\the\MT at toks}
- {\MT at exp@one at n\MT at ifempty{\the\MT at prot@toks}\relax{\the\MT at prot@toks\MT at gobble@to at nil}}
- {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}}%
- \MT at prot@ifcat{a}{%
- \def\MT at temp*{\MT at prot@addtoken at first}%
- }{%
- \MT at prot@ifcat{!}{%
- \def\MT at temp*{\MT at prot@addtoken at first}%
- }{%
-% \end{macrocode}
-% a space character, \dots
-% \begin{macrocode}
- \MT at prot@ifx\@sptoken{%
- \def\MT at temp* {\MT at prot@get at firstgroup}%
- }{%
-% \end{macrocode}
-% commands, \dots
-% \begin{macrocode}
- \let\MT at prot@ifmacro\MT at prot@ifmacro@
- \MT at map@tlist at c\MT at prot@check at cmds\MT at prot@check
-% \end{macrocode}
-% \dots~or a command/active char whose first command is one of the following:
-% \begin{macrocode}
- \MT at prot@ifmacro{%
- \MT at prot@iffirstcmd\UTFviii at two@octets{%
- \def\MT at temp*##1##2{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2}}%
- }{%
- \MT at prot@iffirstcmd\UTFviii at three@octets{%
- \def\MT at temp*##1##2##3{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3}}%
- }{%
- \MT at prot@iffirstcmd\UTFviii at four@octets{%
- \def\MT at temp*##1##2##3##4{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3##4}}%
- }{%
-% \end{macrocode}
-% (this is for chars made active by \pkg{csquotes}, via \cmd\MakeAutoQuote\ or
-% \cmd\MakeOuterQuote)
-% \begin{macrocode}
- \MT at prot@iffirstcmd\csqQQ{\def\MT at temp*##1{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1}}}{%
-% \end{macrocode}
-% or, finally, a <LICR> command.
-% \begin{macrocode}
- \MT at prot@iflicrcmd
- }%
- }%
- }%
- }%
- }%
- }%
- }%
- }%
- \MT at temp*%
-}
-% \end{macrocode}
-%\end{macro}
-%\begin{macro}{\MT at prot@addtoken at first}
-% Begin filling toks.
-% \begin{macrocode}
-\def\MT at prot@addtoken at first#1{%
- \MT at toks\expandafter{\the\MT at toks#1}%
- \MT at prot@get at nexttoken
-}
-% \end{macrocode}
-%\end{macro}
-%\begin{macro}{\MT at prot@get at next@token}
-% Continue if letter or other.
-% \begin{macrocode}
-\def\MT at prot@get at next@token{%
- \def\MT at temp*{\MT at prot@addtoken at next}%
- \MT at prot@ifcat{a}\relax{%
- \MT at prot@ifcat{!}\relax{%
- \def\MT at temp*{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
- }%
- }%
- \MT at temp*%
-}
%</package>
% \end{macrocode}
%\end{macro}
-%\begin{macro}{\MT at prot@addtoken at next}
-% Add token to our toks and test whether we've seen enough (ligature completed).
-% For luatex, we have to jump through another hoop (\ie, box), because, contrary
-% to the manual, \cmd\lastnodetype\ isn't really compatible. ^^A cf. https://mailman.ntg.nl/pipermail/dev-luatex/2021-August/006536.html et seqq.
-% \begin{macrocode}
-%<*pdf-|lua-|xe->
-\def\MT at prot@addtoken at next#1{%
- \MT at toks\expandafter{\the\MT at toks#1}%
- \setbox\MT at tempbox\hbox{%
-% \end{macrocode}
-% We disable italic correction, which would prevent us from
-% seeing the ligature (with text commands).
-% \begin{macrocode}
- \let\maybe at ic\relax
- \MT at exp@one at n\MT at maybe@textcmd{\the\MT at toks}%
-%<pdf-|xe-> \relax
-%<lua-> }\setbox\MT at tempbox\hbox{\unhbox\MT at tempbox
- \ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
- \MT at prot@get at nexttoken
- {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
-}
-%</pdf-|lua-|xe->
-% \end{macrocode}
-%\end{macro}
%
%\subsubsection{Expansion}
%
@@ -9453,12 +9660,15 @@
%
% This only works with \pdftex\ 1.40
%\changes{v2.5}{2010/09/17}{letterspacing with \luatex\ 0.62} ^^A (beta:03)
+%\changes{v3.2}{2024/05/16}{letterspacing\slash tracking with \xetex\
+% (requested by \contributor Aleksandr Petrosyan <@\at @>)
+% \githubissue{22}}
% or \luatex\ 0.62.
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
%<pdf->\MT at requires@pdftex6
%<lua->\MT at requires@luatex3
-{
+%<pdf-|lua->{
% \end{macrocode}
%\begin{macro}{\MT at tracking}
%\changes{v2.2}{2007/02/23}{remember fonts that shouldn't be letterspaced}
@@ -9478,9 +9688,9 @@
\fi
\fi
}
-%</pdf-|lua->
-%<pdf-|lua-|letterspace>\let\MT at tracking
-%<pdf-|lua-> \MT at tracking@
+%</pdf-|lua-|xe->
+%<pdf-|lua-|xe-|letterspace>\let\MT at tracking
+%<pdf-|lua-|xe-> \MT at tracking@
%<letterspace> \relax
% \end{macrocode}
%\end{macro}
@@ -9497,9 +9707,9 @@
%\changes{v3.0}{2021/07/01}{with \pdftex\ 1.40.23, tracking also works for fonts with a zero \fontdim6}
% case we issue a warning (once for every font).
% \begin{macrocode}
-%<*pdf-|lua-|letterspace>
+%<*pdf-|lua-|xe-|letterspace>
\def\MT at set@tr at codes{%
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\MT at vinfo{Tracking font `\MT@@font'\on at line}%
%<*pdf->
\MT at requires@pdftex8\@firstofone{%
@@ -9517,7 +9727,7 @@
\MT at if@list at exists
\MT at get@tr at opt
\relax
-%</pdf-|lua->
+%</pdf-|lua-|xe->
\MT at ifdefined@c at TF\MT at letterspace@\relax{\let\MT at letterspace@\MT at letterspace}%
\ifnum\MT at letterspace@=\z@
% \end{macrocode}
@@ -9526,11 +9736,11 @@
% \begin{macrocode}
\MT at set@tr at zero
\else
-%<pdf-|lua-> \MT at vinfo{... Tracking by \number\MT at letterspace@}%
+%<pdf-|lua-|xe-> \MT at vinfo{... Tracking by \number\MT at letterspace@}%
% \end{macrocode}
% Letterspacing only works in <PDF> mode.
% \begin{macrocode}
- \MT at warn@tracking at DVI
+%<pdf-|lua-|letterspace> \MT at warn@tracking at DVI
% \end{macrocode}
%\begin{macro}{\MT at lsfont}
% The letterspaced font instances are saved in macros
@@ -9557,21 +9767,30 @@
% use when dealing with non-legacy fonts, as it is less problematic and faster
% than the \pdftex\ primitive \cmd\letterspacefont.
% \begin{macrocode}
-%<*lua-|letterspace>
- \MT at if@luaotf at font{%
-%<lua-&debug>\MT at dinfo@nl{1}{... luaotf font: \MessageBreak
-%<lua-&debug> \expandafter\fontname\font at name}%
+%<*lua-|xe-|letterspace>
+ \MT at if@opentype at font{%
+%<debug>\MT at dinfo@nl{1}{... opentype font: \MessageBreak
+%<debug> \expandafter\fontname\font at name}%
+%<lua-|xe-|letterspace> \let\MT at tr@features\@empty
+%<lua-|xe-> \MT at ifdefined@c at T\MT at tr@feat\MT at tr@set at features
\global\expandafter\font\MT at lsfont=\MT at ls@fontspec at font
+%<debug>\MT at dinfo@nl{2}{... -- new font: \expandafter\fontname\MT at lsfont}%
}{%
-%</lua-|letterspace>
+%</lua-|xe-|letterspace>
%<lua-&debug>\MT at dinfo@nl{1}{... legacy font}%
- \global\expandafter\letterspacefont\MT at lsfont\font at name\MT at letterspace@
-%<lua-|letterspace> }%
+%<lua-> \MT at ifdefined@c at T\MT at tr@feat
+%<lua-> {\MT at warning{\MT@@font\space is a legacy font.\MessageBreak
+%<lua-> Cannot disable Opentype `features' in \MT at curr@list at name}}%
+%<pdf-|lua-|letterspace> \global\expandafter\letterspacefont\MT at lsfont\font at name\MT at letterspace@
+%<xe-> \MT at warning{\MT@@font\space is a legacy font.\MessageBreak
+%<xe-> Cannot letterspace it}%
+%<xe-> \MT at glet\MT at lsfont\font at name
+%<lua-|xe-|letterspace> }%
% \end{macrocode}
%\changes{v2.2}{2007/06/16}{possibility to customise interword spacing}
% Scale interword spacing (not configurable in \letterspace).
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\MT at ifdefined@c at TF\MT at tr@ispace
{\let\@tempa\MT at tr@ispace}%
{\edef\@tempa{\MT at letterspace@*,,}}%
@@ -9579,7 +9798,7 @@
{\edef\@tempa{\@tempa,\MT at tr@ospace}}%
{\edef\@tempa{\@tempa,,,}}%
\expandafter\MT at tr@set at space\@tempa,%
-%</pdf-|lua->
+%</pdf-|lua-|xe->
%<*letterspace>
% spacing = {<letterspace amount>*,,}
\fontdimen2\MT at lsfont=\dimexpr\numexpr 1000+\MT at letterspace@\relax sp
@@ -9591,19 +9810,22 @@
% ^^A MID: <46aa1cbb$0$31620$9b4e6d93 at newsspool3.arcor-online.net>
% Adjust outer kerning (\microtype\ only).
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\MT at ifdefined@c at TF\MT at tr@okern{\let\@tempa\MT at tr@okern}{\def\@tempa{*,*}}%
\expandafter\MT at tr@set at okern\@tempa,%
% \end{macrocode}
%\changes{v2.2}{2007/02/23}{disable ligatures in letterspaced fonts manually
% (due to change in \pdftex\ 1.40.4)}
-% Disable ligatures (not configurable in \letterspace).
+% Disable ligatures (not configurable in \letterspace, not possible with \xetex).
+%\changes{v3.2}{2024/05/16}{fix noligatures for OpenType fonts with \letterspace}
% \begin{macrocode}
\MT at ifdefined@c at T\MT at tr@ligatures\MT at tr@noligatures
-%</pdf-|lua->
+%</pdf-|lua-|xe->
%<*letterspace>
% no ligatures = {f}
- \tagcode\MT at lsfont`f=\m at ne
+ \MT at if@opentype at font
+ {\MT at lua{microtype.noligatures([[\MT at lsfont]],[[\number\numexpr`f]])}}
+ {\tagcode\MT at lsfont`f=\m at ne}%
%</letterspace>
% \end{macrocode}
% Adjust protrusion values now, and maybe later (in \cs{MT at pr@split at val})
@@ -9616,11 +9838,11 @@
% (reported by \contributor Wolfram Schaalo <schaalo\at gmx.net>)}
% ^^A private mail, 2008/05/12
% \begin{macrocode}
-%<lua-|letterspace> \MT at if@luaotf at font\relax{%
-%<debug>\MT at dinfo@nl{2}{... compensating for tracking (\number\MT at letterspace@)}%
- \MT at do@font{\lpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax
- \rpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax}%
- \let\MT at the@pr at code\MT at the@pr at code@tr
+%<lua-|letterspace> \MT at if@opentype at font\relax{%
+%<(lua-|pdf-)&debug>\MT at dinfo@nl{2}{... compensating for tracking (\number\MT at letterspace@)}%
+%<!xe-> \MT at do@font{\lpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax
+%<!xe-> \rpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax}%
+%<!xe-> \let\MT at the@pr at code\MT at the@pr at code@tr
%<lua-|letterspace> }%
\fi
% \end{macrocode}
@@ -9629,8 +9851,8 @@
%\changes{v2.5a}{2013/05/15}{fix: load font for \pkg{fontspec}} ^^A for MT at get@slot
% \begin{macrocode}
\aftergroup\MT at set@lsfont
-%<pdf-|lua-> \let\MT at font\MT at lsfont
-%<lua-> \MT at if@luaotf at font\MT at font\relax
+%<pdf-|lua-|xe-> \let\MT at font\MT at lsfont
+%<lua-|xe-> \MT at if@opentype at font\MT at font\relax
% \end{macrocode}
%\begin{macro}{\MT at set@curr at ls}
%\begin{macro}{\MT at curr@ls}
@@ -9647,11 +9869,11 @@
% We get the current outer spacing and adjust it, then, after the end of the
% current outer group, set the current outer spacing, again, and adjust.
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\MT at outer@space=\csname MT at outer@space\expandafter\string\font at name\endcsname\relax
\xdef\MT at set@curr at os{\MT at outer@space=\the\MT at outer@space\relax}%
\MT at tr@outer at l
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
% If \cs{MT at ls@adjust} is empty, it's the starred version of \cs{textls}.
@@ -9665,7 +9887,7 @@
% Otherwise, get the current outer kerning and adjust it, for left and right
% side (\microtype\ only).
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\else
\MT at outer@kern=\expandafter\expandafter\expandafter\@firstoftwo
\csname MT at outer@kern\expandafter\string\font at name\endcsname\relax
@@ -9672,7 +9894,7 @@
\ifdim\MT at outer@kern=\z@\else \MT at ls@outer at k \fi
\MT at outer@kern=\expandafter\expandafter\expandafter\@secondoftwo
\csname MT at outer@kern\expandafter\string\font at name\endcsname\relax
-%</pdf-|lua->
+%</pdf-|lua-|xe->
%<*letterspace>
\xdef\MT at set@curr at ok{\MT at outer@kern=\the\MT at outer@kern\relax}%
\MT at afteraftergroup{%
@@ -9681,7 +9903,7 @@
}%
%</letterspace>
\fi
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
% \end{macrocode}
%\begin{macro}{\MT at set@curr at ok}
% Carry the outer kerning amount to outside the next group, then set outer
@@ -9698,7 +9920,7 @@
\MT at set@curr at ok
\noexpand\MT at tr@outer at r
}%
-%</pdf-|lua->
+%</pdf-|lua-|xe->
\fi
%<pdf-> }%
}
@@ -9720,10 +9942,11 @@
}%
%<!letterspace> }%
}
-%</pdf-|lua-|letterspace>
+%</pdf-|lua-|xe-|letterspace>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at ls@fontspec at font}
+% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}.
%\changes{v2.6a}{2016/05/03}{fix for value of \textpm1000}
%\changes{v2.7}{2017/02/10}{fix for `\texttt{file:}\meta{font}' spec
% (reported by \contributor Reinhard Kotucha <reinhard.kotucha\at web.de>)}
@@ -9731,25 +9954,36 @@
%\changes{v3.0}{2021/03/19}{use \texttt{lua} to parse font spec\slash fix for font spec containing spaces
% (reported by \contributor Aman Mehra <reportaman\at gmail.com>)}
% ^^A https://tex.stackexchange.com/questions/567698/luatex-microtype-fontspec-luaotfload-buggy-interaction-canceling-each-others-s
-% Add the |kernfactor| feature to a font loaded by \pkg{fontspec}.
+%\changes{v3.2}{2024/05/03}{fix for spaces in font names, made necessary because \pkg{fontspec} v2.9b no longer strips them
+% (reported by \contributor Bernhard Fisseni <@\at @>)
+% \githubissue{35}} ^^A cf. https://github.com/latex3/fontspec/commit/b3f91feab5519d1a04db4b63adfc397e3e81a742
% \begin{macrocode}
%<*lua-|letterspace>
\def\MT at ls@fontspec at font{%
- \MT at lua{microtype.add_ls([[\MT at letterspace@]])}%
+ \MT at lua{microtype.add_ls([[\MT at letterspace@]],[[\MT at tr@features]])}%
}
%</lua-|letterspace>
+%<*xe->
+\def\MT at ls@fontspec at font{\MT at exp@two at c\MT at ls@fontspec at font@\fontname\font at name\MT at nil}
+\def\MT at ls@fontspec at font@"#1"#2\MT at nil{\MT at ls@fontspec at font@@#1::\MT at nil#2}
+\def\MT at ls@fontspec at font@@#1:#2:#3\MT at nil{%
+ "#1:#2letterspace=\strip at pt\dimexpr\MT at letterspace@ pt/10\relax
+ ;\MT at tr@features"%
+}
+%</xe->
%<*luafile>
-local function add_ls(k)
+local function add_ls(k,feat)
local f = tex.fontname(font.current())
local spec,size = match(f,'^(.+)( at .+)$')
if not spec then spec = f end
- local a,b,c = match(spec,'^([^:]+):?([^:]*):?(.*)$')
+ local q = match(spec,'^"') or ""
+ local a,b,c = match(spec,'^'..q..'([^:]+):?([^:]*):?(.*)'..q..'$')
local ls = "kernfactor=" .. k/1000 .. ';'
- microtype.sprint(a..':')
+ microtype.sprint(q..a..':')
if (a == "name" or a == "file") then
- microtype.sprint(b..':'..ls..c)
+ microtype.sprint(b..':'..ls..c..feat..q)
else
- microtype.sprint(ls..b)
+ microtype.sprint(ls..b..feat..q)
end
if size then
microtype.sprint(size)
@@ -9763,7 +9997,7 @@
%\begin{macro}{\MT at get@tr at opt}
% Various settings (only for the \microtype\ version).
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\def\MT at get@tr at opt{%
\MT at set@listname
\let\MT at tr@factor@\@m
@@ -9809,6 +10043,7 @@
% Which ligatures should we disable (empty means all, undefined none)?
% \begin{macrocode}
\MT at get@tr at opt@{noligatures} {ligatures}%
+%<lua-|xe-> \MT at get@tr at opt@{features} {feat}%
}
% \end{macrocode}
%\end{macro}
@@ -9819,14 +10054,92 @@
\MT at ifdefined@n at T{MT at tr@c@\MT at tr@c at name @#1}%
{\MT at let@nn{MT at tr@#2}{MT at tr@c@\MT at tr@c at name @#1}}%
}
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\MT at tr@set at features}
+% With \luatex\ or \xetex, Ligatures features may be switched
+% on or off.
+% \begin{macrocode}
+%<*lua-|xe->
+\def\MT at tr@set at features{%
+ \MT at map@clist at c\MT at tr@feat{%
+ \MT at ifempty{##1}\relax{%
+ \MT at if@false
+ \lowercase{\edef\@tempa{##1}}%
+ \MT at map@tlist at n{{{required} {rlig}}
+ {{common} {liga}}
+ {{contextual} {clig}}
+ {{rare} {dlig}}
+ {{discretionary}{dlig}}
+ {{historic} {hlig}}
+%<lua-> {{tex} {tlig}}
+ }\MT at tr@set at feature@
+ \ifMT at if@\else
+%<*xe->
+ \MT at ifstreq{\@tempa}{tex}{%
+ \MT at xadd\MT at tr@features{mapping=tex-text;}%
+ }{%
+ \MT at ifstreq{\@tempa}{texoff}{%
+ \MT at xadd\MT at tr@features{mapping=;}%
+ }{%
+ \MT at ifstreq{\@tempa}{notex}{%
+ \MT at xadd\MT at tr@features{mapping=;}%
+ }{%
+%</xe->
+ \MT at ifstreq{\@tempa}{resetall}{%
+ \MT at xadd\MT at tr@features{+dlig;-dlig;+rlig;-rlig;+liga;-liga;+clig;-clig;+hlig;-hlig;%
+%<lua-> +tlig,-tlig;%
+%<xe-> mapping=tex-text;%
+ }%
+ }{%
+ \MT at warning@nl{Unknown Ligatures feature `##1' in \MT at curr@list at name.
+ Ignoring it}%
+ }%
+%<xe-> }}}%
+ \fi
+ }%
+ }%
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\MT at tr@set at feature@}
+%\begin{macro}{\MT at tr@set at feature@@}
+% \begin{macrocode}
+\def\MT at tr@set at feature@#1{%
+ \MT at tr@set at feature@@#1%
+}
+\def\MT at tr@set at feature@@#1#2{%
+ \MT at ifstreq\@tempa{#1}{%
+ \MT at tr@set at feature@@@{+#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1off}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{no#1}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1reset}{%
+ \MT at tr@set at feature@@@{+#2;-#2}%
+ }\relax
+ }%
+ }%
+ }%
+}
+\def\MT at tr@set at feature@@@#1{%
+ \MT at xadd\MT at tr@features{#1;}%
+ \MT at if@true
+ \MT at tlist@break
+}
+%</lua-|xe->
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
%\begin{macro}{\MT at set@lsfont}
% Redefine \cmd\font at name, which will be called a second later (in
% \cmd\selectfont).
% \begin{macrocode}
-%<*pdf-|lua-|letterspace>
+%<*pdf-|lua-|xe-|letterspace>
%<plain>\MT at requires@latex2{
\def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
% \end{macrocode}
@@ -9862,8 +10175,8 @@
\DeclareRobustCommand\lsstyle{%
\not at math@alphabet\lsstyle\textls
\let\glb at currsize\@empty
-%<pdf-|lua-> \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
-%<pdf-|lua-> \def\MT at feat{tr}%
+%<pdf-|lua-|xe-> \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
+%<pdf-|lua-|xe-> \def\MT at feat{tr}%
\let\MT at tracking\MT at set@tr at codes
\selectfont
}
@@ -9954,32 +10267,52 @@
\aftergroup\MT at set@lsbasefont
\fi
}
-%</pdf-|lua-|letterspace>
+%</pdf-|lua-|xe-|letterspace>
% \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\MT at tr@noligatures}
+% Since an empty value is somewhat ambiguous, we also allow the values
+% `|all|' and `|none|'.
+%\changes{v3.2}{2024/04/03}{new values `\texttt{none}' and `\texttt{all}'
+% for the `\texttt{no ligatures}' key in
+% \cs{SetTracking} (after a report by \contributor user202729 <@\at @>)}
+% ^^A https://tex.stackexchange.com/questions/709456/ligatures-are-not-preserved-by-textls-letter-spacing/
% \pdftex\ 1.40.0--1.40.3 disabled all ligatures in letterspaced fonts.
% \begin{macrocode}
+%<*pdf-|lua-|xe->
+%<pdf->\MT at requires@pdftex7{
%<*pdf-|lua->
-%<pdf->\MT at requires@pdftex7{
\def\MT at tr@noligatures{%
\ifx\MT at tr@ligatures\@empty
\MT at noligatures@\MT at lsfont\@undefined
\else
- \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ \MT at ifstreq\MT at tr@ligatures{all}{%
+ \MT at noligatures@\MT at lsfont\@undefined
+ }{%
+ \MT at ifstreq\MT at tr@ligatures{none}\relax{%
+ \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ }%
+ }%
\fi
}
-%<*pdf->
-}{
+%</pdf-|lua->
+%<*pdf-|xe->
+%<pdf->}{
\def\MT at tr@noligatures{%
- \MT at warning@nl{%
- Disabling selected ligatures is only possible since\MessageBreak
- pdftex 1.40.4. Disabling all ligatures instead}%
- \MT at glet\MT at tr@noligatures\relax
+ \MT at ifstreq\MT at tr@ligatures{all}\relax{%
+ \MT at warning@nl{%
+ Disabling (selected) ligatures is
+%<pdf-> possible since\MessageBreak pdftex 1.40.4.
+%<pdf-> Disabling all ligatures instead%
+%<xe-> not possible with\MessageBreak xetex.
+%<xe-> Ignoring `no ligatures' key in \MT at curr@list at name
+ }%
+ \MT at glet\MT at tr@noligatures\relax
+ }%
}
-}
-%</pdf->
+%<pdf->}
+%</pdf-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at outer@space}
@@ -10047,10 +10380,16 @@
% \end{macrocode}
% For \fontdim2, we also have to subtract the kerning that letterspacing adds
% to each side of the characters (only half if it's for outer spacing).
+%\changes{v3.2}{2024/05/15}{fix for \luatex\ and \xetex}
+% This is necessary only for legacy fonts.
% \begin{macrocode}
+%<*pdf-|lua->
\ifnum#2=\tw@
+%<lua-> \MT at if@opentype at font\relax{%
\advance\@tempdima -\dimexpr\MT at letterspace@ sp*\MT at dimen@six/#3\relax
+%<lua-> }%
\fi
+%</pdf-|lua->
}{%
\MT at ifempty\@tempa{\let\@tempa\MT at letterspace@}\relax
\@tempdima=\dimexpr \numexpr1000+\@tempa sp *\fontdimen#2\MT at lsfont/1000\relax
@@ -10259,6 +10598,7 @@
%\end{macro}
% For older \pdftex\ versions and \luatex, throw an error.
% \begin{macrocode}
+%<*pdf-|lua->
}{
\DeclareRobustCommand\lsstyle{%
\MT at error{Letterspacing only works with \MT at engine tex version
@@ -10269,17 +10609,8 @@
\MT at glet\lsstyle\relax
}
}
-% \end{macrocode}
-% And for \xetex, too.
-% \begin{macrocode}
%</pdf-|lua->
-%<*xe->
-\DeclareRobustCommand\lsstyle{%
- \MT at error{Letterspacing currently doesn't work with xetex}
- {Run pdftex or luatex, or use the `soul' package instead.}%
- \MT at glet\lsstyle\relax
-}
-%</xe->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\begin{macro}{\textls}
%\changes{v2.0}{2005/09/21}{new command: letterspacing} ^^A (beta:1)
@@ -10364,12 +10695,13 @@
%\begin{macro}{\MT at outer@kern}
%\begin{macro}{\MT at tr@set at okern}
%\changes{v2.3d}{2008/12/19}{allow empty value for \texttt{outer kerning}}
+%\changes{v3.2}{2024/05/14}{fix for \luatex\ and \xetex}
% This dimen is used for the starred version of \cs{textls}, for \cs{lslig}
% and for adjusted outer kerning.
% \begin{macrocode}
\newdimen\MT at outer@kern
%</package|letterspace>
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
\def\MT at tr@set at okern#1,#2,{%
\let\MT at temp\@empty
\MT at ifempty{#1}{\MT at tr@set at okern@{*}}{\MT at tr@set at okern@{#1}}%
@@ -10394,11 +10726,13 @@
\@tempdima=\dimexpr \numexpr\@tempa*\MT at letterspace@/1000\relax sp
* \fontdimen6\MT at lsfont/2000\relax
}%
- \advance\@tempdima -\dimexpr \MT at letterspace@ sp
- * \fontdimen6\MT at lsfont/2000\relax
+%<lua-> \MT at if@opentype at font\relax{%
+%<pdf-|lua-> \advance\@tempdima -\dimexpr \MT at letterspace@ sp
+%<pdf-|lua-> * \fontdimen6\MT at lsfont/2000\relax
+%<lua-> }%
\edef\MT at temp{\MT at temp{\the\@tempdima}}%
}
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at ls@outer at k}
@@ -10406,7 +10740,7 @@
% for cases of nested letterspacing without anything actually printed. ^^A eg. \LaTeX!
%\changes{v2.5a}{2013/05/15}{add marker for tightly nested letterspacing}
% \begin{macrocode}
-%<*pdf-|lua-|letterspace>
+%<*pdf-|lua-|xe-|letterspace>
\def\MT at ls@outer at k{%
\ifhmode
\ifdim\lastkern=-3sp \unkern
@@ -10421,7 +10755,7 @@
{\kern\MT at outer@kern\kern3sp\kern-3sp\relax}%
\fi
}
-%</pdf-|lua-|letterspace>
+%</pdf-|lua-|xe-|letterspace>
% \end{macrocode}
%\end{macro}
%
@@ -10463,19 +10797,22 @@
%\changes{v2.3b}{2008/03/27}{fix: warning messages for unknown slots}
% \begin{macrocode}
\let\MT at warn@maybe at inputenc\@empty
- \def\MT at curr@list at name{\@backslashchar DisableLigatures}%
+ \MT at ifstreq\MT at feat{tr}\relax
+ {\def\MT at curr@list at name{\@backslashchar DisableLigatures}}%
\MT at map@clist at c#2{%
- \KV@@sp at def\@tempa{##1}\MT at get@slot
- \ifnum\MT at char>\m at ne
- \tagcode#1\MT at char=\m at ne
+ \MT at ifempty{##1}\relax{%
+ \KV@@sp at def\@tempa{##1}\MT at get@slot
+ \ifnum\MT at char>\m at ne
+ \tagcode#1\MT at char=\m at ne
% \end{macrocode}
% With \luatex, we additionally register the ligatures that should be inhibited
% in a table (used by the \pkg{luaotfload} function |keepligature|).
%\changes{v2.6}{2016/04/20}{use \pkg{luaotfload} function to keep\slash inhibit ligatures}
% \begin{macrocode}
-%<lua-> \MT at if@luaotf at font
-%<lua-> {\MT at lua{microtype.noligatures([[#1]],[[\MT at char]])}}\relax
- \fi
+%<lua-> \MT at if@opentype at font
+%<lua-> {\MT at lua{microtype.noligatures([[#1]],[[\MT at char]])}}\relax
+ \fi
+ }%
}%
\MT at vinfo{... Disabling ligatures for characters: #2}%
}{%
@@ -10486,7 +10823,7 @@
}%
}{%
\pdfnoligatures#1%
-%<lua-> \MT at if@luaotf at font
+%<lua-> \MT at if@opentype at font
%<lua-> {\MT at lua{microtype.noligatures([[#1]],"_all_")}}\relax
\MT at vinfo{... Disabling all ligatures}%
}%
@@ -12086,9 +12423,9 @@
%<*pdf-|lua-|xe->
%<pdf->\MT at requires@pdftex6
%<lua->\MT at requires@luatex3
-%<pdf-|lua-> {\def\MT at active@features{,tr}}{%
- \let\MT at active@features\@empty
-%<pdf-|lua-> }
+%<pdf-|lua-> {%
+ \def\MT at active@features{,tr}%
+%<pdf-|lua-> }{\let\MT at active@features\@empty}
%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
@@ -12182,7 +12519,7 @@
% Inside the preamble, this command shouldn't actually do anything but remember itself for
% later.
% \begin{macrocode}
-\def\microtypecontext{\MT at begin@catcodes\MT at microtypecontext}
+\DeclareRobustCommand\microtypecontext{\MT at begin@catcodes\MT at microtypecontext}
\def\MT at microtypecontext#1{\MT at end@catcodes\MT at addto@setup{\microtypecontext{#1}}}
\MT at addto@setup{%
\DeclareRobustCommand\microtypecontext{%
@@ -12598,6 +12935,13 @@
\MT at get@size@
\fi
% \end{macrocode}
+% Font specifications also accept dimens. (\cmd\ifdefdimen\ is provided
+% by \pkg{etoolbox}.)
+%\changes{v3.2}{2024/05/03}{check for dimen (reported by \contributor Oliver Beery <@\at @>)
+% \githubissue{36}}
+% \begin{macrocode}
+^^X \MT at exp@one at n\ifdefdimen\MT at val{\edef\MT at val{\the\MT at val}}\relax
+% \end{macrocode}
% Test whether we finally got a number or dimension so that we can strip the
% `|pt|' (\cmd\@defaultunits\ and \cmd\strip at pt\ are kernel macros).
%\changes{v1.2}{2004/09/27}{additional magic to catch some errors}
@@ -13027,20 +13371,28 @@
%\subsubsection{Interaction with \pkg{babel}}
%
%\begin{macro}{\DeclareMicrotypeBabelHook}
+%\changes{v2.0}{2005/10/04}{new command: interaction with \pkg{babel}} ^^A (beta:1)
+%\changes{v3.2}{2024/05/25}{make catcode-safe}
+%\begin{macro}{\MT at DeclareMicrotypeBabelHook}
% Declare the context that should be loaded when a \pkg{babel} language
% is selected. The command will not check whether a previous declaration will
% be overwritten.
-%\changes{v2.0}{2005/10/04}{new command: interaction with \pkg{babel}} ^^A (beta:1)
% \begin{macrocode}
%<*package>
-\def\DeclareMicrotypeBabelHook#1#2{%
+\def\DeclareMicrotypeBabelHook{%
+ \MT at begin@catcodes
+ \MT at DeclareMicrotypeBabelHook
+}
+\def\MT at DeclareMicrotypeBabelHook#1#2{%
\MT at map@clist at n{#1}{%
\KV@@sp at def\@tempa{##1}%
\MT at gdef@n{MT at babel@\@tempa}{#2}%
}%
+ \MT at end@catcodes
}
% \end{macrocode}
%\end{macro}
+%\end{macro}
%
%
%\subsubsection{Fine tuning}
@@ -13138,6 +13490,7 @@
\MT at gdef@n{MT at ex@c@\MT at ex@c at name}{#3}%
\MT at end@catcodes
}
+%</pdf-|lua->
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -13152,7 +13505,10 @@
% to adjust interword spacing
% (suggested by \contributor Steven~E. Harris <seh\at panix.com>)}
% ^^A private mail, 2007/06/15
+%\changes{v3.2}{2024/05/15}{new key `\texttt{features}' to en-\slash disable \pkg{fontspec}
+% features (\luatex\ or \xetex)}
% \begin{macrocode}
+%<*pdf-|lua-|xe->
\def\SetTracking{%
\MT at begin@catcodes
\MT at SetTracking
@@ -13178,7 +13534,7 @@
tracking set `\MT at curr@set at name'}}}%
\MT at end@catcodes
}
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\SetExtraSpacing}
@@ -13526,11 +13882,9 @@
{\MT at warn@nodim{character widths}}%
}%
}
-%</package>
% \end{macrocode}
% Tracking may only be relative to a dimension.
% \begin{macrocode}
-%<*pdf-|lua->
\define at key{MT at tr@c}{unit}[1em]{%
\MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@empty
\def\@tempa{#1}%
@@ -13539,7 +13893,7 @@
{\MT at warn@nodim{1em}%
\MT at gdef@n{MT at tr@c@\MT at curr@set at name @unit}{1em}}%
}
-%</pdf-|lua->
+%</package>
% \end{macrocode}
% Spacing and kerning codes may additionally be relative to space dimensions.
% \begin{macrocode}
@@ -13603,14 +13957,17 @@
%<pdf-> \relax
\fi
}
+%</pdf-|lua->
% \end{macrocode}
% Tracking: Interword spacing and outer kerning.
% The variant with space just in case \cs{SetTracking} is called inside an
% argument (\eg, to \cmd\IfFileExists).
% \begin{macrocode}
+%<*pdf-|lua-|xe->
\MT at define@opt at key{tr}{spacing}
\MT at define@opt at key{tr}{outerspacing}
\MT at define@opt at key{tr}{outerkerning}
+\MT at define@opt at key{tr}{features}
% \end{macrocode}
% Which ligatures should be disabled?
% \begin{macrocode}
@@ -13619,7 +13976,7 @@
\define at key{MT at tr@c}{outer spacing}[]{\setkeys{MT at tr@c}{outerspacing={#1}}}
\define at key{MT at tr@c}{outer kerning}[]{\setkeys{MT at tr@c}{outerkerning={#1}}}
\define at key{MT at tr@c}{no ligatures}[]{\setkeys{MT at tr@c}{noligatures={#1}}}
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%
%\subsubsection{Character inheritance}
@@ -14652,6 +15009,7 @@
%\changes{v1.7}{2005/02/17}{fix: warning also when setting to \texttt{(no)compatibility}}
%\changes{v1.9a}{2005/11/21}{inside the preamble, accepts all package options}
%\changes{v2.3d}{2009/03/05}{select font after setup}
+%\changes{v3.2}{2024/04/24}{make robust}
%\begin{macro}{\MT at define@optionX}
% Inside the preamble, \cs{microtypesetup} accepts the same options as the
% package (unless \opt{defersetup}|=false|).
@@ -14659,8 +15017,8 @@
% |protrusion|, |expansion|, |activate|, |tracking|, |spacing| and |kerning|
% (but specifying font sets is not allowed), and |patch| and |nopatch|.
% \begin{macrocode}
-\def\microtypesetup{\setkeys{MT}}
-\MT at addto@setup{\def\microtypesetup#1{\setkeys{MTX}{#1}\selectfont}}
+\DeclareRobustCommand\microtypesetup{\setkeys{MT}}
+\MT at addto@setup{\DeclareRobustCommand\microtypesetup[1]{\setkeys{MTX}{#1}\selectfont}}
%</package>
%<*pdf-|lua-|xe->
\def\MT at define@optionX#1#2{%
@@ -14732,7 +15090,6 @@
%\end{macro}
% \begin{macrocode}
\MT at define@optionX{protrusion}\MT at protrudechars
-%</pdf-|lua-|xe->
%<*pdf-|lua->
\MT at define@optionX{expansion}\MT at adjustspacing
% \end{macrocode}
@@ -14759,7 +15116,6 @@
% The same for |tracking|, |spacing| and |kerning|, which do not have a
% |compatibility| level.
% \begin{macrocode}
-%<*pdf-|lua->
%<pdf->\MT at requires@pdftex6{
%<lua->\MT at requires@luatex3{
\def\MT at define@optionX@#1#2{%
@@ -14798,13 +15154,11 @@
%<pdf-> \MT at define@optionX@{spacing}{\pdfadjustinterwordglue\@tempcnta}
%<pdf-> \MT at define@optionX@{kerning}{\pdfprependkern\@tempcnta
%<pdf-> \pdfappendkern\@tempcnta}
-}{
-%</pdf-|lua->
-%<*pdf-|lua-|xe->
+%<pdf-|lua->}{
% \end{macrocode}
% Disable for older \pdftex\ versions and for \xetex\ and \luatex.
% \begin{macrocode}
-\define at key{MTX}{tracking}[true]{\MT at warning{Ignoring tracking setup}}
+%<pdf-|lua->\define at key{MTX}{tracking}[true]{\MT at warning{Ignoring tracking setup}}
%<lua->}
\define at key{MTX}{kerning}[true]{\MT at warning{Ignoring kerning setup}}
\define at key{MTX}{spacing}[true]{\MT at warning{Ignoring spacing setup}}
@@ -15265,7 +15619,7 @@
%\begin{macro}{\MT at setup@tracking}
% Tracking, spacing and kerning.
% \begin{macrocode}
-%<*pdf-|lua->
+%<*pdf-|lua-|xe->
%<pdf->\MT at requires@pdftex6{%
%<lua->\MT at requires@luatex3{%
\def\MT at setup@tracking{%
@@ -15282,7 +15636,7 @@
\MT at info@nl{No adjustment of tracking}%
\fi
}
-%</pdf-|lua->
+%</pdf-|lua-|xe->
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at setup@spacing}
@@ -15393,7 +15747,7 @@
}%
\fi
}
-%<pdf-|xe-> \def\MT at setup@tracking{\MT at error@doesnt at work{tracking}}
+%<pdf-> \def\MT at setup@tracking{\MT at error@doesnt at work{tracking}}
\def\MT at setup@kerning {\MT at error@doesnt at work{kerning}}
\def\MT at setup@spacing {\MT at error@doesnt at work{spacing}}
%<pdf->}
@@ -15402,8 +15756,8 @@
%\end{macro}
%\begin{macro}{\MT at setup@warntracking}
% \begin{macrocode}
+%<pdf-|lua-|xe->\def\MT at setup@warntracking
%<letterspace>\MT at addto@setup
-%<pdf-|lua->\def\MT at setup@warntracking
% \end{macrocode}
%\begin{macro}{\MT at warn@tracking at DVI}
%\changes{v2.2}{2007/02/11}{warning when letterspacing in <DVI> mode}
@@ -15412,7 +15766,7 @@
% not work. We also switch on protrusion if it isn't already, to compensate for
% the letterspacing kerns.
% \begin{macrocode}
-%<*pdf-|lua-|letterspace>
+%<*pdf-|lua-|xe-|letterspace>
{%
%<*pdf-|letterspace>
\ifnum\pdfoutput<\@ne
@@ -15428,10 +15782,12 @@
}%
\else
%</pdf-|letterspace>
+%<*pdf-|lua-|letterspace>
\def\MT at warn@tracking at DVI{%
\ifnum\pdfprotrudechars<\@ne \global\pdfprotrudechars\@ne \fi
\MT at glet\MT at warn@tracking at DVI\relax
}%
+%</pdf-|lua-|letterspace>
%<pdf-|letterspace> \fi
% \end{macrocode}
%\end{macro}
@@ -15442,8 +15798,7 @@
\MT at ls@too at large\MT at letterspace
\fi
}
-%</pdf-|lua-|letterspace>
-%<xe->\let\MT at setup@warntracking\relax
+%</pdf-|lua-|xe-|letterspace>
% \end{macrocode}
%\end{macro}
%\begin{macro}{\MT at setup@noligatures}
@@ -16424,16 +16779,26 @@
% By default, we only disable the `f*' ligatures, for those fonts that have
% any. Thus, ligatures and especially kerning for all other characters will be
% retained.
+%\changes{v3.2}{2024/05/13}{\texttt{features} instead of \texttt{no ligatures} with \xetex}
+% With \xetex, we reset all ligatures (keeping only the \TeX\ pseudo-ligatures).
% \begin{macrocode}
%<*m-t>
%%% -----------------------------------------------------------------------
%%% TRACKING/LETTERSPACING
-\SetTracking
+\ifx\XeTeXrevision\@undefined
+\SetTracking % pdftex/luatex
[ name = default,
no ligatures = {f} ]
{ encoding = {OT1,T1,T2A,LY1,OT4,QX,EU2,TU} }
{ }
+\else
+\SetTracking % xetex
+ [ name = default,
+ features = {ResetAll} ]
+ { encoding = {EU1,TU} }
+ { }
+\fi
% \end{macrocode}
%
@@ -20451,7 +20816,7 @@
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
-% \CheckSum{13078}
+% \CheckSum{13403}
%
% \Finale
%
Modified: trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/letterspace.sty 2024-12-13 22:37:36 UTC (rev 73113)
@@ -34,7 +34,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{letterspace}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Robust letterspacing
(RS)]
\def\MT at MT
@@ -159,7 +159,7 @@
\def\MT at tr@min{-\@m}
\let\MT at tr@max\@m
\let\MT at letterspace\m at ne
-\def\MT at letterspace@default{100}
+\def\MT at letterspace@default{50}
\MT at pdf@or at lua\relax{
\ifx\newluafunction\@undefined \input ltluatex \fi
\MT at lua{require("microtype")}
@@ -179,8 +179,6 @@
\def\MT at ifdefined@n at TF#1{%
^^X \ifcsname#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
}
-\def\MT at if@expanding at F{\let\MT at if@expanding at F@\MT at if@expanding at F@\@firstofone}
-\def\MT at if@expanding at F@#1#2#3{\relax\relax}
\begingroup
\catcode`\%=12
\catcode`\&=14
@@ -236,9 +234,9 @@
\advance\@tempcnta \@ne
\ifnum\@tempcnta < #2\MT at repeat
}
-\MT at pdf@or at lua{\let\MT at if@luaotf at font\@secondoftwo}{
-\def\MT at if@luaotf at font{\csname\MT at lua{%
- microtype.if_luaotf_font()
+\MT at pdf@or at lua{\let\MT at if@opentype at font\@secondoftwo}{
+\def\MT at if@opentype at font{\csname\MT at lua{%
+ microtype.if_opentype_font()
}\endcsname
}
}
@@ -278,7 +276,8 @@
/\number\MT at letterspace@ ls\endcsname}%
\expandafter\ifx\MT at lsfont\relax
\MT at get@ls at basefont
- \MT at if@luaotf at font{%
+ \MT at if@opentype at font{%
+ \let\MT at tr@features\@empty
\global\expandafter\font\MT at lsfont=\MT at ls@fontspec at font
}{%
\global\expandafter\letterspacefont\MT at lsfont\font at name\MT at letterspace@
@@ -287,8 +286,10 @@
\fontdimen2\MT at lsfont=\dimexpr\numexpr 1000+\MT at letterspace@\relax sp
* \fontdimen2\MT at lsfont/1000\relax
% no ligatures = {f}
- \tagcode\MT at lsfont`f=\m at ne
- \MT at if@luaotf at font\relax{%
+ \MT at if@opentype at font
+ {\MT at lua{microtype.noligatures([[\MT at lsfont]],[[\number\numexpr`f]])}}
+ {\tagcode\MT at lsfont`f=\m at ne}%
+ \MT at if@opentype at font\relax{%
\MT at do@font{\lpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax
\rpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax}%
\let\MT at the@pr at code\MT at the@pr at code@tr
@@ -318,7 +319,7 @@
}%
}
\def\MT at ls@fontspec at font{%
- \MT at lua{microtype.add_ls([[\MT at letterspace@]])}%
+ \MT at lua{microtype.add_ls([[\MT at letterspace@]],[[\MT at tr@features]])}%
}
\MT at requires@latex2{
\def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-luatex.def 2024-12-13 22:37:36 UTC (rev 73113)
@@ -31,7 +31,7 @@
%%
\ProvidesFile
{microtype-luatex.def}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Definitions specific to
luatex
(RS)]
@@ -68,12 +68,12 @@
\MT at check@MT at version
{\MT at lua{tex.write(microtype.module['date'] .. ' v' .. microtype.module['version'])}}
{\MT at MT.lua}
-\def\MT at if@luaotf at font{\csname\MT at lua{%
- microtype.if_luaotf_font()
+\def\MT at if@opentype at font{\csname\MT at lua{%
+ microtype.if_opentype_font()
}\endcsname
}
\def\MT at do@font#1{%
- \MT at if@luaotf at font{%
+ \MT at if@opentype at font{%
\def\MT at dofont@function{#1}%
\MT at lua{microtype.do_font()}%
}{\MT at while@num\z@\@cclvi{#1}}%
@@ -98,6 +98,23 @@
}%
\fi
}
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+^^Q \MT at warning@nl{Cannot patch varwidth without etex extensions}%
+^^X \MT at info@nl{Patching varwidth to enable character protrusion}%
+^^X \newdimen\MT at vwid@leftmargin
+^^X \newdimen\MT at vwid@rightmargin
+^^X \patchcmd\@vwid at sift{\sift at deathcycles\z@}
+^^X {\MT at vwid@leftmargin\leftmarginkern\z@
+^^X \MT at vwid@rightmargin\rightmarginkern\z@ \sift at deathcycles\z@}{}{}%
+^^X \patchcmd\@vwid at resetb{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+^^X \patchcmd\@vwid at measure{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+ \fi
+ }
\def\MT at setupfont{%
\MT at font
\MT at setupfont@hook}
@@ -109,7 +126,9 @@
\MT at exp@one at n\MT at find@file\MT at familyalias\fi
}
\MT at requires@luatex3
- {\g at addto@macro\MT at setupfont\MT at tracking}\relax
+{
+ \g at addto@macro\MT at setupfont\MT at tracking
+}\relax
\g at addto@macro\MT at setupfont{%
\MT at check@font
\ifMT at inlist@
@@ -273,8 +292,10 @@
\def\MT at prot@addtoken at next#1{%
\MT at toks\expandafter{\the\MT at toks#1}%
\setbox\MT at tempbox\hbox{%
+ \begingroup
\let\maybe at ic\relax
\MT at exp@one at n\MT at maybe@textcmd{\the\MT at toks}%
+ \endgroup
}\setbox\MT at tempbox\hbox{\unhbox\MT at tempbox
\ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
\MT at prot@get at nexttoken
@@ -430,9 +451,14 @@
/\number\MT at letterspace@ ls\endcsname}%
\expandafter\ifx\MT at lsfont\relax
\MT at get@ls at basefont
- \MT at if@luaotf at font{%
+ \MT at if@opentype at font{%
+ \let\MT at tr@features\@empty
+ \MT at ifdefined@c at T\MT at tr@feat\MT at tr@set at features
\global\expandafter\font\MT at lsfont=\MT at ls@fontspec at font
}{%
+ \MT at ifdefined@c at T\MT at tr@feat
+ {\MT at warning{\MT@@font\space is a legacy font.\MessageBreak
+ Cannot disable Opentype `features' in \MT at curr@list at name}}%
\global\expandafter\letterspacefont\MT at lsfont\font at name\MT at letterspace@
}%
\MT at ifdefined@c at TF\MT at tr@ispace
@@ -445,7 +471,7 @@
\MT at ifdefined@c at TF\MT at tr@okern{\let\@tempa\MT at tr@okern}{\def\@tempa{*,*}}%
\expandafter\MT at tr@set at okern\@tempa,%
\MT at ifdefined@c at T\MT at tr@ligatures\MT at tr@noligatures
- \MT at if@luaotf at font\relax{%
+ \MT at if@opentype at font\relax{%
\MT at do@font{\lpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax
\rpcode\MT at lsfont\@tempcnta=\numexpr\MT at letterspace@/2\relax}%
\let\MT at the@pr at code\MT at the@pr at code@tr
@@ -453,7 +479,7 @@
\fi
\aftergroup\MT at set@lsfont
\let\MT at font\MT at lsfont
- \MT at if@luaotf at font\MT at font\relax
+ \MT at if@opentype at font\MT at font\relax
\xdef\MT at set@curr at ls{\def\noexpand\MT at curr@ls{\MT at letterspace@}}%
\aftergroup\MT at set@curr at ls
\MT at outer@space=\csname MT at outer@space\expandafter\string\font at name\endcsname\relax
@@ -488,7 +514,7 @@
}%
}
\def\MT at ls@fontspec at font{%
- \MT at lua{microtype.add_ls([[\MT at letterspace@]])}%
+ \MT at lua{microtype.add_ls([[\MT at letterspace@]],[[\MT at tr@features]])}%
}
\def\MT at get@tr at opt{%
\MT at set@listname
@@ -513,11 +539,63 @@
\MT at get@tr at opt@{outerspacing}{ospace}%
\MT at get@tr at opt@{outerkerning}{okern}%
\MT at get@tr at opt@{noligatures} {ligatures}%
+ \MT at get@tr at opt@{features} {feat}%
}
\def\MT at get@tr at opt@#1#2{%
\MT at ifdefined@n at T{MT at tr@c@\MT at tr@c at name @#1}%
{\MT at let@nn{MT at tr@#2}{MT at tr@c@\MT at tr@c at name @#1}}%
}
+\def\MT at tr@set at features{%
+ \MT at map@clist at c\MT at tr@feat{%
+ \MT at ifempty{##1}\relax{%
+ \MT at if@false
+ \lowercase{\edef\@tempa{##1}}%
+ \MT at map@tlist at n{{{required} {rlig}}
+ {{common} {liga}}
+ {{contextual} {clig}}
+ {{rare} {dlig}}
+ {{discretionary}{dlig}}
+ {{historic} {hlig}}
+ {{tex} {tlig}}
+ }\MT at tr@set at feature@
+ \ifMT at if@\else
+ \MT at ifstreq{\@tempa}{resetall}{%
+ \MT at xadd\MT at tr@features{+dlig;-dlig;+rlig;-rlig;+liga;-liga;+clig;-clig;+hlig;-hlig;%
+ +tlig,-tlig;%
+ }%
+ }{%
+ \MT at warning@nl{Unknown Ligatures feature `##1' in \MT at curr@list at name.
+ Ignoring it}%
+ }%
+ \fi
+ }%
+ }%
+}
+\def\MT at tr@set at feature@#1{%
+ \MT at tr@set at feature@@#1%
+}
+\def\MT at tr@set at feature@@#1#2{%
+ \MT at ifstreq\@tempa{#1}{%
+ \MT at tr@set at feature@@@{+#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1off}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{no#1}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1reset}{%
+ \MT at tr@set at feature@@@{+#2;-#2}%
+ }\relax
+ }%
+ }%
+ }%
+}
+\def\MT at tr@set at feature@@@#1{%
+ \MT at xadd\MT at tr@features{#1;}%
+ \MT at if@true
+ \MT at tlist@break
+}
\def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
\DeclareRobustCommand\lsstyle{%
\not at math@alphabet\lsstyle\textls
@@ -557,7 +635,13 @@
\ifx\MT at tr@ligatures\@empty
\MT at noligatures@\MT at lsfont\@undefined
\else
- \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ \MT at ifstreq\MT at tr@ligatures{all}{%
+ \MT at noligatures@\MT at lsfont\@undefined
+ }{%
+ \MT at ifstreq\MT at tr@ligatures{none}\relax{%
+ \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ }%
+ }%
\fi
}
\newskip\MT at outer@space
@@ -591,7 +675,9 @@
{\@tempcntb=#1\relax}%
\@tempdima=\dimexpr\@tempcntb sp*\MT at dimen@six/1000\relax
\ifnum#2=\tw@
+ \MT at if@opentype at font\relax{%
\advance\@tempdima -\dimexpr\MT at letterspace@ sp*\MT at dimen@six/#3\relax
+ }%
\fi
}{%
\MT at ifempty\@tempa{\let\@tempa\MT at letterspace@}\relax
@@ -708,8 +794,10 @@
\@tempdima=\dimexpr \numexpr\@tempa*\MT at letterspace@/1000\relax sp
* \fontdimen6\MT at lsfont/2000\relax
}%
+ \MT at if@opentype at font\relax{%
\advance\@tempdima -\dimexpr \MT at letterspace@ sp
- * \fontdimen6\MT at lsfont/2000\relax
+ * \fontdimen6\MT at lsfont/2000\relax
+ }%
\edef\MT at temp{\MT at temp{\the\@tempdima}}%
}
\def\MT at ls@outer at k{%
@@ -744,14 +832,17 @@
\MT at ifdefined@c at TF#2{%
\MT at ifdefined@c at TF\tagcode{%
\let\MT at warn@maybe at inputenc\@empty
- \def\MT at curr@list at name{\@backslashchar DisableLigatures}%
+ \MT at ifstreq\MT at feat{tr}\relax
+ {\def\MT at curr@list at name{\@backslashchar DisableLigatures}}%
\MT at map@clist at c#2{%
- \KV@@sp at def\@tempa{##1}\MT at get@slot
- \ifnum\MT at char>\m at ne
- \tagcode#1\MT at char=\m at ne
- \MT at if@luaotf at font
- {\MT at lua{microtype.noligatures([[#1]],[[\MT at char]])}}\relax
- \fi
+ \MT at ifempty{##1}\relax{%
+ \KV@@sp at def\@tempa{##1}\MT at get@slot
+ \ifnum\MT at char>\m at ne
+ \tagcode#1\MT at char=\m at ne
+ \MT at if@opentype at font
+ {\MT at lua{microtype.noligatures([[#1]],[[\MT at char]])}}\relax
+ \fi
+ }%
}%
\MT at vinfo{... Disabling ligatures for characters: #2}%
}{%
@@ -762,7 +853,7 @@
}%
}{%
\pdfnoligatures#1%
- \MT at if@luaotf at font
+ \MT at if@opentype at font
{\MT at lua{microtype.noligatures([[#1]],"_all_")}}\relax
\MT at vinfo{... Disabling all ligatures}%
}%
@@ -799,9 +890,9 @@
\def\MT at max@slot
{1114111 }
\MT at requires@luatex3
- {\def\MT at active@features{,tr}}{%
- \let\MT at active@features\@empty
- }
+ {%
+ \def\MT at active@features{,tr}%
+ }{\let\MT at active@features\@empty}
\def\DisableLigatures{%
\MT at begin@catcodes
\MT at DisableLigatures
@@ -886,14 +977,6 @@
\fi
}%
}
-\define at key{MT at tr@c}{unit}[1em]{%
- \MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@empty
- \def\@tempa{#1}%
- \MT at ifdimen\@tempa
- {\MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@tempa}%
- {\MT at warn@nodim{1em}%
- \MT at gdef@n{MT at tr@c@\MT at curr@set at name @unit}{1em}}%
-}
\MT at map@clist at n{stretch,shrink,step}{%
\define at key{MT at ex@c}{#1}[]{%
\MT at ifempty{##1}\relax{%
@@ -922,6 +1005,7 @@
\MT at define@opt at key{tr}{spacing}
\MT at define@opt at key{tr}{outerspacing}
\MT at define@opt at key{tr}{outerkerning}
+\MT at define@opt at key{tr}{features}
\define at key{MT at tr@c}{noligatures}[]%
{\MT at xdef@n{MT at tr@c@\MT at curr@set at name @noligatures}{#1}}
\define at key{MT at tr@c}{outer spacing}[]{\setkeys{MT at tr@c}{outerspacing={#1}}}
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-pdftex.def 2024-12-13 22:37:36 UTC (rev 73113)
@@ -31,7 +31,7 @@
%%
\ProvidesFile
{microtype-pdftex.def}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Definitions specific to
pdftex
(RS)]
@@ -156,6 +156,34 @@
\fi
}
}
+\MT at requires@pdftex5{
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+^^Q \MT at warning@nl{Cannot patch varwidth without etex extensions}%
+^^X \MT at info@nl{Patching varwidth to enable character protrusion}%
+^^X \newdimen\MT at vwid@leftmargin
+^^X \newdimen\MT at vwid@rightmargin
+^^X \patchcmd\@vwid at sift{\sift at deathcycles\z@}
+^^X {\MT at vwid@leftmargin\leftmarginkern\z@
+^^X \MT at vwid@rightmargin\rightmarginkern\z@ \sift at deathcycles\z@}{}{}%
+^^X \patchcmd\@vwid at resetb{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+^^X \patchcmd\@vwid at measure{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+ \fi
+ }
+}{
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+ \MT at warning@nl{%
+ The pdftex version you are using does not allow\MessageBreak
+ character protrusion in varwidth environments.\MessageBreak
+ Upgrade pdftex to version 1.30 or later}%
+ \fi
+ }
+}
\def\MT at setupfont{%
\MT at setupfont@hook}
\MT at requires@pdftex7{
@@ -168,7 +196,9 @@
\MT at exp@one at n\MT at find@file\MT at familyalias\fi
}
\MT at requires@pdftex6
- {\g at addto@macro\MT at setupfont\MT at tracking}\relax
+{
+ \g at addto@macro\MT at setupfont\MT at tracking
+}\relax
\g at addto@macro\MT at setupfont{%
\MT at check@font
\ifMT at inlist@
@@ -354,9 +384,11 @@
\def\MT at prot@addtoken at next#1{%
\MT at toks\expandafter{\the\MT at toks#1}%
\setbox\MT at tempbox\hbox{%
+ \begingroup
\let\maybe at ic\relax
\MT at exp@one at n\MT at maybe@textcmd{\the\MT at toks}%
\relax
+ \endgroup
\ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
\MT at prot@get at nexttoken
{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
@@ -758,15 +790,25 @@
\ifx\MT at tr@ligatures\@empty
\MT at noligatures@\MT at lsfont\@undefined
\else
- \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ \MT at ifstreq\MT at tr@ligatures{all}{%
+ \MT at noligatures@\MT at lsfont\@undefined
+ }{%
+ \MT at ifstreq\MT at tr@ligatures{none}\relax{%
+ \MT at noligatures@\MT at lsfont\MT at tr@ligatures
+ }%
+ }%
\fi
}
}{
\def\MT at tr@noligatures{%
- \MT at warning@nl{%
- Disabling selected ligatures is only possible since\MessageBreak
- pdftex 1.40.4. Disabling all ligatures instead}%
- \MT at glet\MT at tr@noligatures\relax
+ \MT at ifstreq\MT at tr@ligatures{all}\relax{%
+ \MT at warning@nl{%
+ Disabling (selected) ligatures is
+ possible since\MessageBreak pdftex 1.40.4.
+ Disabling all ligatures instead%
+ }%
+ \MT at glet\MT at tr@noligatures\relax
+ }%
}
}
\newskip\MT at outer@space
@@ -918,7 +960,7 @@
* \fontdimen6\MT at lsfont/2000\relax
}%
\advance\@tempdima -\dimexpr \MT at letterspace@ sp
- * \fontdimen6\MT at lsfont/2000\relax
+ * \fontdimen6\MT at lsfont/2000\relax
\edef\MT at temp{\MT at temp{\the\@tempdima}}%
}
\def\MT at ls@outer at k{%
@@ -953,12 +995,15 @@
\MT at ifdefined@c at TF#2{%
\MT at ifdefined@c at TF\tagcode{%
\let\MT at warn@maybe at inputenc\@empty
- \def\MT at curr@list at name{\@backslashchar DisableLigatures}%
+ \MT at ifstreq\MT at feat{tr}\relax
+ {\def\MT at curr@list at name{\@backslashchar DisableLigatures}}%
\MT at map@clist at c#2{%
- \KV@@sp at def\@tempa{##1}\MT at get@slot
- \ifnum\MT at char>\m at ne
- \tagcode#1\MT at char=\m at ne
- \fi
+ \MT at ifempty{##1}\relax{%
+ \KV@@sp at def\@tempa{##1}\MT at get@slot
+ \ifnum\MT at char>\m at ne
+ \tagcode#1\MT at char=\m at ne
+ \fi
+ }%
}%
\MT at vinfo{... Disabling ligatures for characters: #2}%
}{%
@@ -988,9 +1033,9 @@
\def\MT at max@slot
{255 }
\MT at requires@pdftex6
- {\def\MT at active@features{,tr}}{%
- \let\MT at active@features\@empty
- }
+ {%
+ \def\MT at active@features{,tr}%
+ }{\let\MT at active@features\@empty}
\MT at requires@pdftex5{
\def\DisableLigatures{%
\MT at begin@catcodes
@@ -1125,14 +1170,6 @@
{Upgrade pdftex.}%
}
}
-\define at key{MT at tr@c}{unit}[1em]{%
- \MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@empty
- \def\@tempa{#1}%
- \MT at ifdimen\@tempa
- {\MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@tempa}%
- {\MT at warn@nodim{1em}%
- \MT at gdef@n{MT at tr@c@\MT at curr@set at name @unit}{1em}}%
-}
\MT at map@clist at n{sp,kn}{%
\define at key{MT@#1 at c}{unit}[space]{%
\MT at glet@nc{MT@#1 at c@\MT at curr@set at name @unit}\@empty
@@ -1175,6 +1212,7 @@
\MT at define@opt at key{tr}{spacing}
\MT at define@opt at key{tr}{outerspacing}
\MT at define@opt at key{tr}{outerkerning}
+\MT at define@opt at key{tr}{features}
\define at key{MT at tr@c}{noligatures}[]%
{\MT at xdef@n{MT at tr@c@\MT at curr@set at name @noligatures}{#1}}
\define at key{MT at tr@c}{outer spacing}[]{\setkeys{MT at tr@c}{outerspacing={#1}}}
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-show.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-show.sty 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-show.sty 2024-12-13 22:37:36 UTC (rev 73113)
@@ -34,7 +34,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{microtype-show}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Visual debugging for the microtype package
(RS)]
\RequirePackage{iftex}
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype-xetex.def 2024-12-13 22:37:36 UTC (rev 73113)
@@ -31,7 +31,7 @@
%%
\ProvidesFile
{microtype-xetex.def}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Definitions specific to
xetex
(RS)]
@@ -61,6 +61,13 @@
\expandafter\@secondoftwo
\fi
}
+\def\MT at if@opentype at font{%
+ \ifnum\XeTeXfonttype\font at name=\z@
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}
\def\MT at do@font#1{%
\@tempcnta=\z@
\MT at loop
@@ -88,6 +95,23 @@
}%
\fi
}
+ \def\MT at varwidth@setup{%
+ \ifMT at protrusion
+^^Q \MT at warning@nl{Cannot patch varwidth without etex extensions}%
+^^X \MT at info@nl{Patching varwidth to enable character protrusion}%
+^^X \newdimen\MT at vwid@leftmargin
+^^X \newdimen\MT at vwid@rightmargin
+^^X \patchcmd\@vwid at sift{\sift at deathcycles\z@}
+^^X {\MT at vwid@leftmargin\leftmarginkern\z@
+^^X \MT at vwid@rightmargin\rightmarginkern\z@ \sift at deathcycles\z@}{}{}%
+^^X \patchcmd\@vwid at resetb{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+^^X \patchcmd\@vwid at measure{\kern\@vwid at loff \unhbox\z@}
+^^X {\kern\@vwid at loff \ifdim\MT at vwid@leftmargin=\z@\else\kern\MT at vwid@leftmargin\fi
+^^X \unhbox\z@ \ifdim\MT at vwid@rightmargin=\z@\else\kern\MT at vwid@rightmargin\fi}{}{}%
+ \fi
+ }
\def\MT at setupfont{%
\MT at font
\MT at setupfont@hook}
@@ -97,6 +121,7 @@
\ifx\MT at familyalias\@empty \else
\MT at exp@one at n\MT at find@file\MT at familyalias\fi
}
+ \g at addto@macro\MT at setupfont\MT at tracking
\g at addto@macro\MT at setupfont{%
\MT at check@font
\ifMT at inlist@
@@ -228,18 +253,389 @@
\def\MT at prot@addtoken at next#1{%
\MT at toks\expandafter{\the\MT at toks#1}%
\setbox\MT at tempbox\hbox{%
+ \begingroup
\let\maybe at ic\relax
\MT at exp@one at n\MT at maybe@textcmd{\the\MT at toks}%
\relax
+ \endgroup
\ifnum\lastnodetype=7 \aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi}%
\MT at prot@get at nexttoken
{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
}
+\let\MT at tr@font at list\@empty
+\def\MT at tracking@{%
+ \MT at exp@one at n\MT at in@clist\MT at font\MT at tr@font at list
+ \ifMT at inlist@\else
+ \MT at maybe@do{tr}%
+ \ifMT at do\else
+ \xdef\MT at tr@font at list{\MT at tr@font at list\MT at font,}%
+ \fi
+ \fi
+}
+\let\MT at tracking
+ \MT at tracking@
+\def\MT at set@tr at codes{%
+ \MT at vinfo{Tracking font `\MT@@font'\on at line}%
+ \MT at if@list at exists
+ \MT at get@tr at opt
+ \relax
+ \MT at ifdefined@c at TF\MT at letterspace@\relax{\let\MT at letterspace@\MT at letterspace}%
+ \ifnum\MT at letterspace@=\z@
+ \MT at set@tr at zero
+ \else
+ \MT at vinfo{... Tracking by \number\MT at letterspace@}%
+ \xdef\MT at lsfont{\csname\expandafter\string\font at name
+ /\number\MT at letterspace@ ls\endcsname}%
+ \expandafter\ifx\MT at lsfont\relax
+ \MT at get@ls at basefont
+ \MT at if@opentype at font{%
+ \let\MT at tr@features\@empty
+ \MT at ifdefined@c at T\MT at tr@feat\MT at tr@set at features
+ \global\expandafter\font\MT at lsfont=\MT at ls@fontspec at font
+ }{%
+ \MT at warning{\MT@@font\space is a legacy font.\MessageBreak
+ Cannot letterspace it}%
+ \MT at glet\MT at lsfont\font at name
+ }%
+ \MT at ifdefined@c at TF\MT at tr@ispace
+ {\let\@tempa\MT at tr@ispace}%
+ {\edef\@tempa{\MT at letterspace@*,,}}%
+ \MT at ifdefined@c at TF\MT at tr@ospace
+ {\edef\@tempa{\@tempa,\MT at tr@ospace}}%
+ {\edef\@tempa{\@tempa,,,}}%
+ \expandafter\MT at tr@set at space\@tempa,%
+ \MT at ifdefined@c at TF\MT at tr@okern{\let\@tempa\MT at tr@okern}{\def\@tempa{*,*}}%
+ \expandafter\MT at tr@set at okern\@tempa,%
+ \MT at ifdefined@c at T\MT at tr@ligatures\MT at tr@noligatures
+ \fi
+ \aftergroup\MT at set@lsfont
+ \let\MT at font\MT at lsfont
+ \MT at if@opentype at font\MT at font\relax
+ \xdef\MT at set@curr at ls{\def\noexpand\MT at curr@ls{\MT at letterspace@}}%
+ \aftergroup\MT at set@curr at ls
+ \MT at outer@space=\csname MT at outer@space\expandafter\string\font at name\endcsname\relax
+ \xdef\MT at set@curr at os{\MT at outer@space=\the\MT at outer@space\relax}%
+ \MT at tr@outer at l
+ \ifx\MT at ls@adjust\@empty
+ \MT at outer@kern=-\dimexpr\MT at letterspace@ sp * \fontdimen6\font at name/2000\relax
+ \MT at ls@outer at k
+ \else
+ \MT at outer@kern=\expandafter\expandafter\expandafter\@firstoftwo
+ \csname MT at outer@kern\expandafter\string\font at name\endcsname\relax
+ \ifdim\MT at outer@kern=\z@\else \MT at ls@outer at k \fi
+ \MT at outer@kern=\expandafter\expandafter\expandafter\@secondoftwo
+ \csname MT at outer@kern\expandafter\string\font at name\endcsname\relax
+ \fi
+ \xdef\MT at set@curr at ok{\MT at outer@kern=\the\MT at outer@kern\relax}%
+ \MT at afteraftergroup{%
+ \MT at set@curr at os
+ \MT at set@curr at ok
+ \noexpand\MT at tr@outer at r
+ }%
+ \fi
+}
+\def\MT at afteraftergroup#1{%
+ \MT at maybe@gobble at with@tikz{%
+ \MT at ifdefined@n at TF{MT at aftergroup@\number\currentgrouplevel}\relax{%
+ \MT at exp@cs\xdef{MT at aftergroup@\number\currentgrouplevel}%
+ {\MT at exp@cs\MT at glet{MT at aftergroup@\number\currentgrouplevel}\noexpand\@undefined#1}%
+ \expandafter\aftergroup\expandafter\aftergroup\MT at exp@cs\aftergroup
+ {MT at aftergroup@\number\currentgrouplevel}%
+ }%
+ }%
+}
+\def\MT at ls@fontspec at font{\MT at exp@two at c\MT at ls@fontspec at font@\fontname\font at name\MT at nil}
+\def\MT at ls@fontspec at font@"#1"#2\MT at nil{\MT at ls@fontspec at font@@#1::\MT at nil#2}
+\def\MT at ls@fontspec at font@@#1:#2:#3\MT at nil{%
+ "#1:#2letterspace=\strip at pt\dimexpr\MT at letterspace@ pt/10\relax
+ ;\MT at tr@features"%
+}
+\def\MT at get@tr at opt{%
+ \MT at set@listname
+ \let\MT at tr@factor@\@m
+ \MT at ifdefined@n at T{MT at tr@c@\MT at tr@c at name @unit}{%
+ \MT at let@cn\MT at tr@unit@{MT at tr@c@\MT at tr@c at name @unit}%
+ \ifdim\MT at tr@unit@=1em
+ \let\MT at tr@unit@\@undefined
+ \else
+ \MT at get@unit\MT at tr@unit@
+ \fi
+ }%
+ \MT at ifdefined@n at T{MT at tr@c@\MT at tr@c at name}{%
+ \MT at let@cn\MT at letterspace{MT at tr@c@\MT at tr@c at name}%
+ \MT at ifdefined@c at T\MT at tr@unit@{%
+ \let\@tempb\MT at letterspace
+ \MT at scale@to at em
+ \edef\MT at letterspace{\number\@tempcntb}%
+ }%
+ }%
+ \MT at get@tr at opt@{spacing} {ispace}%
+ \MT at get@tr at opt@{outerspacing}{ospace}%
+ \MT at get@tr at opt@{outerkerning}{okern}%
+ \MT at get@tr at opt@{noligatures} {ligatures}%
+ \MT at get@tr at opt@{features} {feat}%
+}
+\def\MT at get@tr at opt@#1#2{%
+ \MT at ifdefined@n at T{MT at tr@c@\MT at tr@c at name @#1}%
+ {\MT at let@nn{MT at tr@#2}{MT at tr@c@\MT at tr@c at name @#1}}%
+}
+\def\MT at tr@set at features{%
+ \MT at map@clist at c\MT at tr@feat{%
+ \MT at ifempty{##1}\relax{%
+ \MT at if@false
+ \lowercase{\edef\@tempa{##1}}%
+ \MT at map@tlist at n{{{required} {rlig}}
+ {{common} {liga}}
+ {{contextual} {clig}}
+ {{rare} {dlig}}
+ {{discretionary}{dlig}}
+ {{historic} {hlig}}
+ }\MT at tr@set at feature@
+ \ifMT at if@\else
+ \MT at ifstreq{\@tempa}{tex}{%
+ \MT at xadd\MT at tr@features{mapping=tex-text;}%
+ }{%
+ \MT at ifstreq{\@tempa}{texoff}{%
+ \MT at xadd\MT at tr@features{mapping=;}%
+ }{%
+ \MT at ifstreq{\@tempa}{notex}{%
+ \MT at xadd\MT at tr@features{mapping=;}%
+ }{%
+ \MT at ifstreq{\@tempa}{resetall}{%
+ \MT at xadd\MT at tr@features{+dlig;-dlig;+rlig;-rlig;+liga;-liga;+clig;-clig;+hlig;-hlig;%
+ mapping=tex-text;%
+ }%
+ }{%
+ \MT at warning@nl{Unknown Ligatures feature `##1' in \MT at curr@list at name.
+ Ignoring it}%
+ }%
+ }}}%
+ \fi
+ }%
+ }%
+}
+\def\MT at tr@set at feature@#1{%
+ \MT at tr@set at feature@@#1%
+}
+\def\MT at tr@set at feature@@#1#2{%
+ \MT at ifstreq\@tempa{#1}{%
+ \MT at tr@set at feature@@@{+#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1off}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{no#1}{%
+ \MT at tr@set at feature@@@{-#2}%
+ }{%
+ \MT at ifstreq\@tempa{#1reset}{%
+ \MT at tr@set at feature@@@{+#2;-#2}%
+ }\relax
+ }%
+ }%
+ }%
+}
+\def\MT at tr@set at feature@@@#1{%
+ \MT at xadd\MT at tr@features{#1;}%
+ \MT at if@true
+ \MT at tlist@break
+}
+\def\MT at set@lsfont{\MT at exp@two at c\let\font at name\MT at lsfont}
\DeclareRobustCommand\lsstyle{%
- \MT at error{Letterspacing currently doesn't work with xetex}
- {Run pdftex or luatex, or use the `soul' package instead.}%
- \MT at glet\lsstyle\relax
+ \not at math@alphabet\lsstyle\textls
+ \let\glb at currsize\@empty
+ \MT at maybe@gobble at with@tikz{\aftergroup\glb at settings}%
+ \def\MT at feat{tr}%
+ \let\MT at tracking\MT at set@tr at codes
+ \selectfont
}
+\DeclareRobustCommand\lslig[1]{%
+ {\MT at ifdefined@c at TF\MT at curr@ls{%
+ \escapechar\m at ne
+ \xdef\font at name{\csname\curr at fontshape/\f at size\endcsname}%
+ \MT at get@ls at basefont
+ \MT at outer@kern=\dimexpr\MT at curr@ls sp * \fontdimen6\font at name/2000\relax
+ \kern\MT at outer@kern
+ \font at name #1%
+ \kern\MT at outer@kern
+ }{#1}}%
+}
+\def\MT at get@ls at basefont{%
+ \xdef\MT at ls@basefont{\csname\expandafter\string\font at name @base\endcsname}%
+ \expandafter\ifx\MT at ls@basefont\relax
+ \MT at exp@two at c\MT at glet\MT at ls@basefont\font at name
+ \else
+ \MT at set@lsbasefont
+ \fi
+}
+\def\MT at set@lsbasefont{\MT at exp@two at c\let\font at name\MT at ls@basefont}
+\def\MT at set@tr at zero{%
+ \xdef\MT at ls@basefont{\csname\expandafter\string\font at name @base\endcsname}%
+ \expandafter\ifx\MT at ls@basefont\relax \else
+ \aftergroup\MT at set@lsbasefont
+ \fi
+}
+ \def\MT at tr@noligatures{%
+ \MT at ifstreq\MT at tr@ligatures{all}\relax{%
+ \MT at warning@nl{%
+ Disabling (selected) ligatures is
+ not possible with\MessageBreak xetex.
+ Ignoring `no ligatures' key in \MT at curr@list at name
+ }%
+ \MT at glet\MT at tr@noligatures\relax
+ }%
+ }
+\newskip\MT at outer@space
+\def\MT at tr@set at space#1,#2,#3,#4,#5,#6,{%
+ \let\MT at temp\@empty
+ \MT at tr@set at space@{#1}{#4}{2}\@empty
+ \MT at tr@set at space@{#2}{#5}{3}\@plus
+ \MT at tr@set at space@{#3}{#6}{4}\@minus
+ \MT at glet@nc{MT at outer@space\expandafter\string\font at name}\MT at temp
+}
+\def\MT at tr@set at space@#1#2#3#4{%
+ \MT at ifempty{#2}{%
+ \MT at ifempty{#1}\relax{%
+ \MT at tr@set at space@@{#1}{#3}{1000}%
+ \fontdimen#3\MT at lsfont=\@tempdima
+ }%
+ \edef\MT at temp{\MT at temp#4\the\fontdimen#3\MT at lsfont}%
+ }{%
+ \MT at tr@set at space@@{#2}{#3}{2000}%
+ \edef\MT at temp{\MT at temp#4\the\@tempdima}%
+ \MT at ifempty{#1}\relax{%
+ \MT at tr@set at space@@{#1}{#3}{1000}%
+ \fontdimen#3\MT at lsfont=\@tempdima
+ }%
+ }%
+}
+\def\MT at tr@set at space@@#1#2#3{%
+ \MT at test@ast#1*\@nil{%
+ \MT at ifdefined@c at TF\MT at tr@unit@
+ {\edef\@tempb{#1}\MT at scale@to at em}
+ {\@tempcntb=#1\relax}%
+ \@tempdima=\dimexpr\@tempcntb sp*\MT at dimen@six/1000\relax
+ }{%
+ \MT at ifempty\@tempa{\let\@tempa\MT at letterspace@}\relax
+ \@tempdima=\dimexpr \numexpr1000+\@tempa sp *\fontdimen#2\MT at lsfont/1000\relax
+ }%
+}
+\def\MT at tr@outer at l{%
+ \ifhmode
+ \ifdim\lastskip>5sp
+ \edef\x{\the\lastskip minus 0pt}%
+ \setbox\z@\hbox{\MT at outer@space=\x}%
+ \ifdim\wd\z@>\z@
+ \unskip \hskip\MT at outer@space\relax
+ \let\MT at ls@outer at k\relax
+ \else
+ \ifdim\lastskip=%
+ \ifnum\spacefactor<2000
+ \spaceskip
+ \else
+ \ifdim\xspaceskip=\z@
+ \dimexpr\spaceskip+\fontdimen7\font at name\relax
+ \else
+ \xspaceskip
+ \fi
+ \fi
+ \unskip \hskip\MT at outer@space\relax
+ \let\MT at ls@outer at k\relax
+ \fi
+ \fi
+ \fi
+ \fi
+}
+\def\MT at tr@outer at r{%
+ \futurelet\MT at tr@outer at next\MT at tr@outer at r@
+}
+\def\MT at if@outer at next#1{%
+ \ifx\MT at tr@outer at next#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+\def\MT at tr@outer at r@{%
+ \def\MT at temp*{}%
+ \ifmmode \else
+ \ifnum\currentgrouptype=10 \else
+ \def\MT at temp*##1{\ifhmode\hskip\MT at outer@space
+ \fi}%
+ \expandafter\ifcat\expandafter\noexpand\csname MT at tr@outer at next\endcsname\egroup
+ \ifhmode\unkern\fi\egroup
+ \MT at set@curr at ok \MT at set@curr at os
+ \def\MT at temp*{\afterassignment\MT at tr@outer at r\let\MT at temp=}%
+ \else
+ \MT at if@outer at next\maybe at ic{%
+ \MT at set@curr at ok \MT at set@curr at os
+ \def\MT at temp*{\afterassignment\MT at tr@outer at icr\let\MT at temp=}%
+ }{%
+ \MT at if@outer at next\check at icr{%
+ \def\MT at temp*{\aftergroup\MT at tr@outer at r\check at icr\let\MT at temp=}%
+ }{%
+ \MT at if@outer at next\@sptoken{%
+ \def\MT at temp* {\ifhmode\hskip\MT at outer@space
+ \fi}%
+ }{%
+ \MT at if@outer at next~{%
+ \def\MT at temp*~{\nobreak\hskip\MT at outer@space
+ }%
+ }{%
+ \MT at if@outer at next\ \relax{%
+ \MT at if@outer at next\space\relax{%
+ \MT at if@outer at next\@xobeysp\relax{%
+ \MT at if@outer at next\xspace{%
+ \def\MT at temp*\xspace{\MT at xspace}%
+ }{%
+ \def\MT at temp*{\ifdim\MT at outer@kern=\z@\else\MT at ls@outer at k
+ \fi}%
+ \MT at let@nc{MT at tr@outer at next}\relax
+ }}}}}}}}\fi
+ \fi\fi
+ \MT at temp*%
+}
+\def\MT at tr@outer at icr{\afterassignment\MT at tr@outer at icr@\MT at tr@outer at r}
+\def\MT at tr@outer at icr@{%
+ \let\@let at token= \MT at tr@outer at next
+ \maybe at ic@
+}
+\def\MT at xspace{\futurelet\@let at token\MT at xspace@}
+\def\MT at xspace@{\@xspace at firsttrue\@xspace
+ \ifdim\lastskip>5sp
+ \unskip \hskip\MT at outer@space
+ \else
+ \ifdim\MT at outer@kern=\z@\else\MT at ls@outer at k \fi
+ \fi
+}
+\def\MT at tr@set at okern#1,#2,{%
+ \let\MT at temp\@empty
+ \MT at ifempty{#1}{\MT at tr@set at okern@{*}}{\MT at tr@set at okern@{#1}}%
+ \MT at ifempty{#2}{\MT at tr@set at okern@{*}}{\MT at tr@set at okern@{#2}}%
+ \MT at glet@nc{MT at outer@kern\expandafter\string\font at name}\MT at temp
+}
+\def\MT at tr@set at okern@#1{%
+ \MT at test@ast#1*\@nil{%
+ \MT at ifdefined@c at TF\MT at tr@unit@
+ {\edef\@tempb{#1}\MT at scale@to at em}
+ {\@tempcntb=#1\relax}%
+ \@tempdima=\dimexpr \@tempcntb sp * \MT at dimen@six/1000\relax
+ }{%
+ \MT at ifempty\@tempa{\let\@tempa\@m}\relax
+ \@tempdima=\dimexpr \numexpr\@tempa*\MT at letterspace@/1000\relax sp
+ * \fontdimen6\MT at lsfont/2000\relax
+ }%
+ \edef\MT at temp{\MT at temp{\the\@tempdima}}%
+}
+\def\MT at ls@outer at k{%
+ \ifhmode
+ \ifdim\lastkern=-3sp \unkern
+ \ifdim\lastkern=3sp \kern-3sp
+ \expandafter\expandafter\expandafter\@gobble
+ \else \unkern
+ \expandafter\expandafter\expandafter\@firstofone
+ \fi
+ \else
+ \expandafter\@firstofone
+ \fi
+ {\kern\MT at outer@kern\kern3sp\kern-3sp\relax}%
+ \fi
+}
\def\MT at get@slot@{%
\ifnum\XeTeXfonttype\MT at font=\z@
\ifnum\MT at char > \m at ne
@@ -289,7 +685,7 @@
{1114111 }
\def\MT at max@slot
{1114111 }
- \let\MT at active@features\@empty
+ \def\MT at active@features{,tr}%
\renewcommand*\DisableLigatures[2][]{%
\MT at error{Disabling ligatures of a font is only possible\MessageBreak
with pdftex version 1.30 or newer.\MessageBreak
@@ -297,6 +693,24 @@
Use
pdftex.}%
}
+\def\SetTracking{%
+ \MT at begin@catcodes
+ \MT at SetTracking
+}
+\newcommand*\MT at SetTracking[3][]{%
+ \let\MT at extra@context\@empty
+ \MT at set@named at keys{MT at tr@c}{#1}%
+ \def\MT at permutelist{tr at c}%
+ \setkeys{MT at cfg}{#2}%
+ \MT at permute
+ \KV@@sp at def\@tempa{#3}%
+ \MT at ifempty\@tempa\relax{%
+ \MT at ifint\@tempa
+ {\MT at xdef@n{MT at tr@c@\MT at tr@c at name}{\@tempa}}%
+ {\MT at warning{Value `\@tempa' is not a number in\MessageBreak
+ tracking set `\MT at curr@set at name'}}}%
+ \MT at end@catcodes
+}
\define at key{MT at pr@c}{context}[]{%
\MT at error{Protrusion contexts only work with pdftex
\MessageBreak or luatex.
@@ -303,6 +717,15 @@
Ignoring `context' key\on at line}%
{Use pdftex or luatex.}%
}
+\MT at define@opt at key{tr}{spacing}
+\MT at define@opt at key{tr}{outerspacing}
+\MT at define@opt at key{tr}{outerkerning}
+\MT at define@opt at key{tr}{features}
+\define at key{MT at tr@c}{noligatures}[]%
+ {\MT at xdef@n{MT at tr@c@\MT at curr@set at name @noligatures}{#1}}
+\define at key{MT at tr@c}{outer spacing}[]{\setkeys{MT at tr@c}{outerspacing={#1}}}
+\define at key{MT at tr@c}{outer kerning}[]{\setkeys{MT at tr@c}{outerkerning={#1}}}
+\define at key{MT at tr@c}{no ligatures}[]{\setkeys{MT at tr@c}{noligatures={#1}}}
\def\MT at inh@split#1=#2=#3\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty \else
@@ -396,7 +819,34 @@
\MT at define@optionX{protrusion}\MT at protrudechars
\let\MT at protrudechars\XeTeXprotrudechars
\define at key{MTX}{expansion}[true]{\MT at warning{Ignoring expansion setup}}
-\define at key{MTX}{tracking}[true]{\MT at warning{Ignoring tracking setup}}
+ \def\MT at define@optionX@#1#2{%
+ \define at key{MTX}{#1}[true]{%
+ \MT at map@clist at n{##1}{%
+ \KV@@sp at def\MT at val{####1}%
+ \MT at ifempty\MT at val\relax{%
+ \@tempcnta=\m at ne
+ \MT at ifstreq\MT at val{true}{%
+ \MT at checksetup{#1}{%
+ \@tempcnta=\@ne
+ \MT at vinfo{Enabling #1\on at line}%
+ }%
+ }{%
+ \MT at ifstreq\MT at val{false}{%
+ \@tempcnta=\z@
+ \MT at vinfo{Disabling #1\on at line}%
+ }{\MT at error{Value `\MT at val' for key `#1' not recognised}
+ {Use either `true' or `false'}%
+ }%
+ }%
+ \ifnum\@tempcnta>\m at ne
+ #2\relax
+ \fi
+ }%
+ }%
+ }%
+ }
+ \MT at define@optionX@{tracking}{\ifnum\@tempcnta=\z@ \let\MT at tracking\MT at set@tr at zero
+ \else \let\MT at tracking\MT at tracking@ \fi}
\define at key{MTX}{kerning}[true]{\MT at warning{Ignoring kerning setup}}
\define at key{MTX}{spacing}[true]{\MT at warning{Ignoring spacing setup}}
\define at key{MTX}{activate}[true]{%
@@ -426,6 +876,16 @@
\fi
\fi
}
+ \def\MT at setup@tracking{%
+ \ifMT at tracking
+ \MT at info@nl{Tracking enabled}%
+ \MT at check@active at set{tr}%
+ \ifMT at protrusion\else\MT at protrudechars\@ne\fi
+ \else
+ \let\MT at tracking\relax
+ \MT at info@nl{No adjustment of tracking}%
+ \fi
+ }
\def\MT at error@doesnt at work#1{%
\csname ifMT@#1\endcsname
\MT at error{The #1 feature only works with pdftex 1.40\MessageBreak
@@ -438,10 +898,16 @@
}%
\fi
}
- \def\MT at setup@tracking{\MT at error@doesnt at work{tracking}}
\def\MT at setup@kerning {\MT at error@doesnt at work{kerning}}
\def\MT at setup@spacing {\MT at error@doesnt at work{spacing}}
-\let\MT at setup@warntracking\relax
+\def\MT at setup@warntracking
+{%
+ \ifnum\MT at letterspace=\m at ne
+ \let\MT at letterspace\MT at letterspace@default
+ \else
+ \MT at ls@too at large\MT at letterspace
+ \fi
+}
\let\MT at setup@noligatures\relax
\endinput
%%
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.cfg 2024-12-13 22:37:36 UTC (rev 73113)
@@ -41,7 +41,7 @@
%%
\ProvidesFile
{microtype.cfg}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
microtype main configuration file
(RS)]
@@ -436,11 +436,19 @@
%%% -----------------------------------------------------------------------
%%% TRACKING/LETTERSPACING
-\SetTracking
+\ifx\XeTeXrevision\@undefined
+\SetTracking % pdftex/luatex
[ name = default,
no ligatures = {f} ]
{ encoding = {OT1,T1,T2A,LY1,OT4,QX,EU2,TU} }
{ }
+\else
+\SetTracking % xetex
+ [ name = default,
+ features = {ResetAll} ]
+ { encoding = {EU1,TU} }
+ { }
+\fi
%%% -----------------------------------------------------------------------
%%% EXPANSION
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.lua 2024-12-13 22:37:36 UTC (rev 73113)
@@ -35,8 +35,8 @@
local microtype = microtype
microtype.module = {
name = "microtype",
- version = "3.1b",
- date = "2024/03/29",
+ version = "3.2",
+ date = "2024/12/12",
description = "microtype module.",
author = "E. Roux, R. Schlicht and P. Gesang",
copyright = "E. Roux, R. Schlicht and P. Gesang",
@@ -100,7 +100,7 @@
end
microtype.if_str_eq = if_str_eq
-local function if_luaotf_font()
+local function if_opentype_font()
local thefont = font.getfont(font.current())
if thefont and ( thefont.format == "opentype" or thefont.format == "truetype" )
then tex.write("@firstoftwo")
@@ -107,7 +107,7 @@
else tex.write("@secondoftwo")
end
end
-microtype.if_luaotf_font = if_luaotf_font
+microtype.if_opentype_font = if_opentype_font
local function do_font()
local thefont = font.getfont(font.current())
@@ -121,17 +121,18 @@
end
microtype.do_font = do_font
-local function add_ls(k)
+local function add_ls(k,feat)
local f = tex.fontname(font.current())
local spec,size = match(f,'^(.+)( at .+)$')
if not spec then spec = f end
- local a,b,c = match(spec,'^([^:]+):?([^:]*):?(.*)$')
+ local q = match(spec,'^"') or ""
+ local a,b,c = match(spec,'^'..q..'([^:]+):?([^:]*):?(.*)'..q..'$')
local ls = "kernfactor=" .. k/1000 .. ';'
- microtype.sprint(a..':')
+ microtype.sprint(q..a..':')
if (a == "name" or a == "file") then
- microtype.sprint(b..':'..ls..c)
+ microtype.sprint(b..':'..ls..c..feat..q)
else
- microtype.sprint(ls..b)
+ microtype.sprint(ls..b..feat..q)
end
if size then
microtype.sprint(size)
Modified: trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty 2024-12-13 22:37:25 UTC (rev 73112)
+++ trunk/Master/texmf-dist/tex/latex/microtype/microtype.sty 2024-12-13 22:37:36 UTC (rev 73113)
@@ -30,7 +30,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{microtype}
- [2024/03/29 v3.1b
+ [2024/12/12 v3.2
Micro-typographical refinements
(RS)]
\def\MT at MT
@@ -229,7 +229,7 @@
\def\MT at stretch@default{20 }
\def\MT at shrink@default{20 }
\let\MT at letterspace\m at ne
-\def\MT at letterspace@default{100}
+\def\MT at letterspace@default{50}
\newif\ifMT at document
\def\MT at glet{\global\let}
\def\MT at exp@cs#1#2{\expandafter#1\csname#2\endcsname}
@@ -512,6 +512,7 @@
\MT at with@package at T {ledmac}\MT at ledmac@setup
\MT at with@package at T {eledmac}\MT at ledmac@setup
\MT at with@package at T{reledmac}\MT at ledmac@setup
+ \MT at with@package at T{varwidth}\MT at varwidth@setup
\MT at with@package at T{xunicode}\MT at xunicodetrue
\MT at with@package at T{fontspec}\MT at fontspectrue
\MT at glet\MT at setupfont@hook\@empty
@@ -705,8 +706,11 @@
\MT at patch@patch\theIEEEsubequationdis{)}{\rightprotrusion{)}}}%
{}%
\@ifpackageloaded{amsmath}
- {\MT at patch@patch\tagform@{(}{\leftprotrusion{(}}%
- \MT at patch@patch\tagform@{)}{\rightprotrusion{)}}%
+ {\MT at ifdefined@c at TF\SK at tagform@
+ {\MT at patch@patch\SK at tagform@{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\SK at tagform@{)}{\rightprotrusion{)}}}%
+ {\MT at patch@patch\tagform@{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\tagform@{)}{\rightprotrusion{)}}}%
\MT at ifdefined@n at TF{eqref }
{\MT at exp@cs\MT at patch@patch{eqref }}{\MT at patch@patch\eqref}
{\tagform@}{\@nameuse{MT at patch@saved@\string\tagform@}}%
@@ -718,11 +722,21 @@
`\@backslashchar rightprotrusion' as\MessageBreak
appropriate in mathtools's `\@backslashchar newtagform' command}%
\fi}}
- {\MT at patch@patch\@eqnnum{(}{\leftprotrusion{(}}%
- \MT at patch@patch\@eqnnum{)}{\rightprotrusion{)}}}%
+ {\@ifclassloaded{IEEEtran}{}
+ {\MT at ifdefined@c at TF\SK at eqnnum
+ {\MT at patch@patch\SK at eqnnum{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\SK at eqnnum{)}{\rightprotrusion{)}}}%
+ {\MT at patch@patch\@eqnnum{(}{\leftprotrusion{(}}%
+ \MT at patch@patch\@eqnnum{)}{\rightprotrusion{)}}}}}%
}{}%
\MT at define@patch{footnote}{%
- \@ifpackageloaded{hyperref}
+ \MT at ifdefined@n at TF{fnote_footnotetext:n}
+ {\ExplSyntaxOn
+ \MT at patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT at exp@cs\MT at patch@patch{fnote_footnotetext:n}{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}%
+ \ExplSyntaxOff}
+ {\@ifpackageloaded{hyperref}
{\MT at if@false
\ifHy at implicit
\ifHy at hyperfootnotes
@@ -751,7 +765,7 @@
{\MT at ifdefined@c at TF\KOMAClassName
{\MT at patch@patch\scr at saved@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
{\MT at patch@patch\@footnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}%
- \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}%
+ \MT at patch@patch\@mpfootnotetext{\ignorespaces}{\ignorespaces\leftprotrusion}}}}}%
}{}%
\MT at define@patch{verbatim}{%
\MT at append@patch\@verbatim{\microtypesetup{activate=false}}%
@@ -1099,7 +1113,9 @@
\interlinepenalty\z@
\@newlistfalse
\MT at prot@hook
- \MT at noindent #1\relax\MT at csq@eqgroup}%
+ \begingroup
+ \MT at noindent #1\relax\MT at csq@eqgroup
+ \endgroup}%
\vbadness=\@M
\splittopskip=\z@
\vfuzz=\maxdimen
@@ -1159,6 +1175,73 @@
\def\MT at prot@get at firstgroup@tc{\futurelet\MT at prot@next\MT at prot@get at first@group at tc}
\def\MT at prot@get at firsttoken{\futurelet\MT at prot@next\MT at prot@get at first@token}
\def\MT at prot@get at nexttoken{\futurelet\MT at prot@next\MT at prot@get at next@token}
+\def\MT at prot@get at first@group@{%
+ \MT at prot@ifcat\bgroup{%
+ \def\MT at temp*{\MT at prot@addgroup}%
+ }{%
+ \def\MT at temp*{\MT at prot@get at first@token}%
+ }%
+ \MT at temp*%
+}
+\def\MT at prot@get at first@group at tc{%
+ \MT at prot@ifcat\bgroup{%
+ \def\MT at temp*##1##2\MT at nil{\MT at ifempty{##1}\relax
+ {{\MT at prot@get at firstgroup@tc##1\MT at nil}}}%
+ }{%
+ \def\MT at temp*{\MT at prot@get at first@token}%
+ }%
+ \MT at temp*%
+}
+\def\MT at prot@get at first@token{%
+ \def\MT at temp*{\MT at exp@one at n\MT at ifempty{\the\MT at toks}
+ {\MT at exp@one at n\MT at ifempty{\the\MT at prot@toks}\relax{\the\MT at prot@toks\MT at gobble@to at nil}}
+ {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}}%
+ \MT at prot@ifcat{a}{%
+ \def\MT at temp*{\MT at prot@addtoken at first}%
+ }{%
+ \MT at prot@ifcat{!}{%
+ \def\MT at temp*{\MT at prot@addtoken at first}%
+ }{%
+ \MT at prot@ifx\@sptoken{%
+ \def\MT at temp* {\MT at prot@get at firstgroup}%
+ }{%
+ \let\MT at prot@ifmacro\MT at prot@ifmacro@
+ \MT at map@tlist at c\MT at prot@check at cmds\MT at prot@check
+ \MT at prot@ifmacro{%
+ \MT at prot@iffirstcmd\UTFviii at two@octets{%
+ \def\MT at temp*##1##2{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2}}%
+ }{%
+ \MT at prot@iffirstcmd\UTFviii at three@octets{%
+ \def\MT at temp*##1##2##3{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3}}%
+ }{%
+ \MT at prot@iffirstcmd\UTFviii at four@octets{%
+ \def\MT at temp*##1##2##3##4{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3##4}}%
+ }{%
+ \MT at prot@iffirstcmd\csqQQ{\def\MT at temp*##1{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1}}}{%
+ \MT at prot@iflicrcmd
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \MT at temp*%
+}
+\def\MT at prot@addtoken at first#1{%
+ \MT at toks\expandafter{\the\MT at toks#1}%
+ \MT at prot@get at nexttoken
+}
+\def\MT at prot@get at next@token{%
+ \def\MT at temp*{\MT at prot@addtoken at next}%
+ \MT at prot@ifcat{a}\relax{%
+ \MT at prot@ifcat{!}\relax{%
+ \def\MT at temp*{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
+ }%
+ }%
+ \MT at temp*%
+}
\def\MT at prot@check#1{\MT at prot@check@#1\relax\@nil}
\def\MT at prot@check@#1#2#3\@nil{%
\ifx\MT at prot@next#2%
@@ -1176,6 +1259,15 @@
\def\MT at prot@check at O{%
\def\MT at temp*##1##2{\MT at toks\expandafter{\the\MT at toks##1{##2}}\MT at prot@get at firstgroup}%
}
+\def\MT at prot@check at o{%
+ \def\MT at temp*##1{\@ifnextchar[{\MT at prot@check at o@##1}{\MT at prot@check at o@##1[]}}%
+}
+\def\MT at prot@check at o@#1[#2]#3{%
+ \MT at ifempty{#2}
+ {\MT at toks\expandafter{\the\MT at toks#1{#3}}}
+ {\MT at toks\expandafter{\the\MT at toks#1[#2]{#3}}}%
+ \MT at prot@get at firstgroup
+}
\def\MT at prot@check at T{%
\def\MT at temp*##1##2##3{\MT at toks\expandafter{\the\MT at toks##1{##2}{##3}}\MT at prot@get at firstgroup}%
}
@@ -1215,15 +1307,31 @@
\else
\let\MT at prot@l\MT at prot@l at tc
\let\MT at prot@get at first@group\MT at prot@get at first@group at tc
- \def\MT at temp*##1##2{%
- \let\MT at maybe@textcmd##1%
+ \def\MT at temp*##1{%
\the\MT at toks
\MT at toks{}%
- \MT at prot@toks{##1{##2}}%
- \MT at prot@get at firstgroup@tc##2\MT at nil
+ \MT at prot@check at F@##1%
}%
\fi
}
+\def\MT at prot@check at F@@#1#2{%
+ \let\MT at maybe@textcmd#1%
+ \MT at prot@toks{#1{#2}}%
+ \MT at prot@get at firstgroup@tc#2\@empty\MT at nil
+}
+\def\MT at prot@check at F@beamer#1{%
+ \@ifnextchar<%
+ {\MT at prot@check at F@beamer@#1}%
+ {\MT at prot@check at F@@#1}%
+}
+\def\MT at prot@check at F@beamer@#1<#2>#3{%
+ \def\MT at maybe@textcmd{#1<#2>}%
+ \MT at prot@toks{#1<#2>{#3}}%
+ \MT at prot@get at firstgroup@tc#3\@empty\MT at nil
+}
+\@ifclassloaded{beamer}
+ {\let\MT at prot@check at F@\MT at prot@check at F@beamer}
+ {\let\MT at prot@check at F@\MT at prot@check at F@@}
\def\MT at prot@check at C{%
\ifx\MT at prot@l\MT at prot@l at tc
\def\MT at temp*{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
@@ -1242,7 +1350,7 @@
\def\MT at prot@check at C@#1[#2]#3{%
\def\MT at maybe@textcmd{#1[#2]}%
\MT at prot@toks{#1[#2]{#3}}%
- \MT at prot@get at firstgroup@tc#3\MT at nil
+ \MT at prot@get at firstgroup@tc#3\@empty\MT at nil
}
\def\MT at prot@check at cmds{%
{I\ignorespaces}{I\relax}{I\@empty}%
@@ -1270,6 +1378,17 @@
\@ifclassloaded{ltxdoc}
{\g at addto@macro\MT at prot@check at cmds{{E\enquote}{E\marg}{E\oarg}{E\parg}{E\cs}}}\relax
\MT at addto@setup{%
+ \MT at with@package at T{color}
+ {\@ifclassloaded{beamer}\relax{\g at addto@macro\MT at prot@check at cmds{{o\color}}}}%
+ \MT at with@package at T{csquotes}
+ {\@ifclassloaded{ltxdoc}
+ {\patchcmd\MT at prot@check at cmds{E\enquote}{e\enquote}\relax\relax}
+ {\g at addto@macro\MT at prot@check at cmds{{e\enquote}}}%
+ \g at addto@macro\MT at prot@check at cmds{{e\textquote}%
+ {l\foreignquote}{l\hyphenquote}{l\foreigntextquote}{l\hyphentextquote}%
+ {{eX}\textcquote\textquote}%
+ {{lX}\foreigntextcquote\foreigntextquote}%
+ {{lX}\hyphentextcquote\hyphentextquote}}}%
\MT at with@package at T{doc}
{\g at addto@macro\MT at prot@check at cmds{{E\meta}}}%
\MT at with@package at T{fontaxes}
@@ -1277,12 +1396,14 @@
{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 at addto@macro\MT at prot@check at cmds{%
{S\swshape}{S\ulcshape}{S\sscshape}%
- {F\textulc}{F\textsw}{F\textssc}}}}
+ {F\textulc}{F\textsw}{F\textssc}}}}%
+ \MT at with@package at T{fontspec}
+ {\g at addto@macro\MT at prot@check at cmds{%
+ {O\addfontfeature}{O\addfontfeatures}{F\strong}}}%
\MT at with@package at T{nfssext-cfr}
{\g at addto@macro\MT at prot@check at cmds{%
{S\tistyle}{S\ltstyle}{S\ofstyle}{S\altstyle}{S\regstyle}{S\embossstyle}%
@@ -1306,88 +1427,12 @@
{F\textmb}{F\textdb}{F\textsb}{F\texteb}%
{F\textub}{F\textlg}{F\textel}{F\textul}}%
\IfFormatAtLeastTF{2020/02/02}\relax
- {\g at addto@macro\MT at prot@check at cmds{{S\swshape}{F\textsw}}}}
+ {\g at addto@macro\MT at prot@check at cmds{{S\swshape}{F\textsw}}}}%
\MT at with@package at T{yfonts}
{\g at addto@macro\MT at prot@check at cmds{%
{S\frakfamily}{S\swabfamily}{S\gothfamily}%
{F\textfrak}{F\textswab}{F\textgoth}}}%
- \MT at with@package at T{csquotes}
- {\@ifclassloaded{ltxdoc}
- {\patchcmd\MT at prot@check at cmds{E\enquote}{e\enquote}\relax\relax}
- {\g at addto@macro\MT at prot@check at cmds{{e\enquote}}}%
- \g at addto@macro\MT at prot@check at cmds{{e\textquote}%
- {l\foreignquote}{l\hyphenquote}{l\foreigntextquote}{l\hyphentextquote}%
- {{eX}\textcquote\textquote}%
- {{lX}\foreigntextcquote\foreigntextquote}%
- {{lX}\hyphentextcquote\hyphentextquote}}}%
}
-\def\MT at prot@get at first@group@{%
- \MT at prot@ifcat\bgroup{%
- \def\MT at temp*{\MT at prot@addgroup}%
- }{%
- \def\MT at temp*{\MT at prot@get at first@token}%
- }%
- \MT at temp*%
-}
-\def\MT at prot@get at first@group at tc{%
- \MT at prot@ifcat\bgroup{%
- \def\MT at temp*##1##2\MT at nil{\MT at ifempty{##1}\relax
- {{\MT at prot@get at firstgroup@tc##1\MT at nil}}}%
- }{%
- \def\MT at temp*{\MT at prot@get at first@token}%
- }%
- \MT at temp*%
-}
-\def\MT at prot@get at first@token{%
- \def\MT at temp*{\MT at exp@one at n\MT at ifempty{\the\MT at toks}
- {\MT at exp@one at n\MT at ifempty{\the\MT at prot@toks}\relax{\the\MT at prot@toks\MT at gobble@to at nil}}
- {\MT at exp@one at n\MT at prot@l{\the\MT at toks}}}%
- \MT at prot@ifcat{a}{%
- \def\MT at temp*{\MT at prot@addtoken at first}%
- }{%
- \MT at prot@ifcat{!}{%
- \def\MT at temp*{\MT at prot@addtoken at first}%
- }{%
- \MT at prot@ifx\@sptoken{%
- \def\MT at temp* {\MT at prot@get at firstgroup}%
- }{%
- \let\MT at prot@ifmacro\MT at prot@ifmacro@
- \MT at map@tlist at c\MT at prot@check at cmds\MT at prot@check
- \MT at prot@ifmacro{%
- \MT at prot@iffirstcmd\UTFviii at two@octets{%
- \def\MT at temp*##1##2{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2}}%
- }{%
- \MT at prot@iffirstcmd\UTFviii at three@octets{%
- \def\MT at temp*##1##2##3{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3}}%
- }{%
- \MT at prot@iffirstcmd\UTFviii at four@octets{%
- \def\MT at temp*##1##2##3##4{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1##2##3##4}}%
- }{%
- \MT at prot@iffirstcmd\csqQQ{\def\MT at temp*##1{\MT at exp@one at n\MT at prot@l{\the\MT at toks##1}}}{%
- \MT at prot@iflicrcmd
- }%
- }%
- }%
- }%
- }%
- }%
- }%
- }%
- \MT at temp*%
-}
-\def\MT at prot@addtoken at first#1{%
- \MT at toks\expandafter{\the\MT at toks#1}%
- \MT at prot@get at nexttoken
-}
-\def\MT at prot@get at next@token{%
- \def\MT at temp*{\MT at prot@addtoken at next}%
- \MT at prot@ifcat{a}\relax{%
- \MT at prot@ifcat{!}\relax{%
- \def\MT at temp*{\MT at exp@one at n\MT at prot@l{\the\MT at toks}}%
- }%
- }%
- \MT at temp*%
-}
\newif\ifMT at nonselected
\DeclareRobustCommand\textls{%
\@ifstar{\let\MT at ls@adjust@\MT at ls@adjust at empty\MT at textls}%
@@ -1993,7 +2038,7 @@
\MT at font \csname MT@\@tempa @#1font at list\endcsname
}%
}
-\def\microtypecontext{\MT at begin@catcodes\MT at microtypecontext}
+\DeclareRobustCommand\microtypecontext{\MT at begin@catcodes\MT at microtypecontext}
\def\MT at microtypecontext#1{\MT at end@catcodes\MT at addto@setup{\microtypecontext{#1}}}
\MT at addto@setup{%
\DeclareRobustCommand\microtypecontext{%
@@ -2194,6 +2239,7 @@
\ifx\@tempa\relax\else
\MT at get@size@
\fi
+^^X \MT at exp@one at n\ifdefdimen\MT at val{\edef\MT at val{\the\MT at val}}\relax
\MT at ifdimen\MT at val{%
\@defaultunits\@tempdima\MT at val pt\relax\@nnil
\edef\MT at val{\strip at pt\@tempdima}%
@@ -2393,11 +2439,16 @@
\def\DeclareMicrotypeFilePrefix#1{%
\def\MT at cfg@prefix{#1}%
}
-\def\DeclareMicrotypeBabelHook#1#2{%
+\def\DeclareMicrotypeBabelHook{%
+ \MT at begin@catcodes
+ \MT at DeclareMicrotypeBabelHook
+}
+\def\MT at DeclareMicrotypeBabelHook#1#2{%
\MT at map@clist at n{#1}{%
\KV@@sp at def\@tempa{##1}%
\MT at gdef@n{MT at babel@\@tempa}{#2}%
}%
+ \MT at end@catcodes
}
\def\SetProtrusion{%
\MT at begin@catcodes
@@ -2526,6 +2577,14 @@
{\MT at warn@nodim{character widths}}%
}%
}
+\define at key{MT at tr@c}{unit}[1em]{%
+ \MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@empty
+ \def\@tempa{#1}%
+ \MT at ifdimen\@tempa
+ {\MT at glet@nc{MT at tr@c@\MT at curr@set at name @unit}\@tempa}%
+ {\MT at warn@nodim{1em}%
+ \MT at gdef@n{MT at tr@c@\MT at curr@set at name @unit}{1em}}%
+}
\renewcommand*\DeclareCharacterInheritance[1][]{%
\let\MT at extra@context\@empty
\let\MT at extra@inputenc\@undefined
@@ -2991,8 +3050,8 @@
Use \@backslashchar Microtype at Hook instead}
{You might want to inform the font package authors.}\MicroType at Hook}
\MT at ifdefined@c at T\Microtype at Hook\Microtype at Hook
-\def\microtypesetup{\setkeys{MT}}
-\MT at addto@setup{\def\microtypesetup#1{\setkeys{MTX}{#1}\selectfont}}
+\DeclareRobustCommand\microtypesetup{\setkeys{MT}}
+\MT at addto@setup{\DeclareRobustCommand\microtypesetup[1]{\setkeys{MTX}{#1}\selectfont}}
\let\MT at saved@setupfont\MT at setupfont
\define at key{MTX}{deactivate}[]{%
\MT at info{Deactivate `\MT at MT' package}%
More information about the tex-live-commits
mailing list.