summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltfssaxes.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltfssaxes.dtx')
-rw-r--r--macros/latex-dev/base/ltfssaxes.dtx65
1 files changed, 58 insertions, 7 deletions
diff --git a/macros/latex-dev/base/ltfssaxes.dtx b/macros/latex-dev/base/ltfssaxes.dtx
index 1a8dbd9cfb..58d9aa159e 100644
--- a/macros/latex-dev/base/ltfssaxes.dtx
+++ b/macros/latex-dev/base/ltfssaxes.dtx
@@ -35,7 +35,7 @@
%
%
\ProvidesFile{ltfssaxes.dtx}
- [2020/02/18 v1.0c LaTeX Kernel (NFSS Axes handing)]
+ [2020/03/02 v1.0e LaTeX Kernel (NFSS Axes handing)]
% \iffalse
\documentclass{ltxdoc}
\begin{document}
@@ -827,7 +827,6 @@
%
%
% \begin{macro}{\set@target@series}
-% \begin{macro}{\series@drop@one@m}
%
% Finally the code for normalizing the \cs{f@series} value.
%
@@ -845,21 +844,69 @@
\def\set@target@series#1{%
% \end{macrocode}
% We need to \cs{edef} the argument first in case it starts with a
-% conditional.
+% conditional. Then we check (and perhaps drop) an ``m'' from the
+% value andassign the result to \cs{f@series}.
+% \changes{v1.0d}{2020/02/27}{Drop ``m'' only in a specific set of values (gh/293)}
% \begin{macrocode}
\edef\f@series{#1}%
- \edef\f@series{\expandafter\series@drop@one@m\f@series mm\series@drop@one@m}%
+ \series@maybe@drop@one@m\f@series\f@series
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\series@maybe@drop@one@m}
+% If the series value is in NFSS notation then it should not
+% contain any ``m'' unless it is just an ``m'' by it own. So we
+% need to drop surplus ``m''s. But we better don't do this for full
+% names, such as ``\texttt{semibold}'' as used by
+% \texttt{autoinst}, for example. So we test against the possible
+% explicit values that should drop an ``m''.
+% After that we assign the result to \verb=#2= for further use.
+% \changes{v1.0d}{2020/02/27}{Drop ``m'' in certain values from a
+% fixed list (gh/293)}
+% \begin{macrocode}
+\def\series@maybe@drop@one@m#1{%
+ \expandafter\series@maybe@drop@one@m@x\expandafter{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+
+\def\series@maybe@drop@one@m@x#1#2{%
+% \end{macrocode}
+% The code below is an inline version of the \cs{in@} macro without
+% the group, so that it works in \cs{accent}.
+% \begin{macrocode}
+ \def\in@@##1,#1,{}%
+ \series@check@toks\expandafter{\in@@
+ ,ulm,elm,lm,slm,mm,sbm,bm,ebm,ubm,muc,mec,mc,msc,msx,mx,mex,mux,{}{},#1,}%
+ \edef\in@@{\the\series@check@toks}%
+ \ifx\in@@\@empty
+ \def#2{#1}%
+ \else
+ \edef#2{\expandafter\series@drop@one@m #1m\series@drop@one@m}%
+ \fi
}
% \end{macrocode}
+% As a precaution we use a private toks register not \cs{toks@} as
+% that is no longer hidden inside the group.
+% \begin{macrocode}
+\newtoks\series@check@toks
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\series@drop@one@m}
% Drop up to two \texttt{m}s but keep one if that makes the series
-% value empty.
+% value empty. Actually, with the current implementation we know
+% that there is at least one in the series value itself and we
+% added one after it, so all we have to do is now returning
+% \verb=#1#2= and dropping the rest.
% \begin{macrocode}
\def\series@drop@one@m#1m#2m#3\series@drop@one@m{%
- \ifx\relax#1#2\relax m\else#1#2\fi
+% \ifx\relax#1#2\relax m\else#1#2\fi
+ #1#2%
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
@@ -908,6 +955,7 @@
\DeclareRobustCommand\ulcshape
{\not@math@alphabet\ulcshape\relax
\fontshape\ulcdefault\selectfont}
+\let\ulcdefault\@undefined % for rollback
\newcommand\ulcdefault{ulc}
% \end{macrocode}
% \end{macro}
@@ -928,6 +976,7 @@
\DeclareRobustCommand\swshape
{\not@math@alphabet\swshape\relax
\fontshape\swdefault\selectfont}
+\let\swdefault\@undefined % for rollback
\newcommand\swdefault{sw}
% \end{macrocode}
% \end{macro}
@@ -951,6 +1000,7 @@
\DeclareRobustCommand\sscshape
{\not@math@alphabet\sscshape\relax
\fontshape\sscdefault\selectfont}
+\let\sscdefault\@undefined % for rollback
\newcommand\sscdefault{ssc}
% \end{macrocode}
% \end{macro}
@@ -1215,6 +1265,7 @@
%<latexrelease>\let\@font@shape@subst@warning\@undefined
%<latexrelease>\let\maybe@load@fontshape\@undefined
%<latexrelease>\let\set@target@series\@undefined
+%<latexrelease>\let\series@maybe@drop@one@m\@undefined
%<latexrelease>\let\series@drop@one@m\@undefined
%<latexrelease>\let\DeclareFontShapeChangeRule\@undefined
%<latexrelease>\let\merge@font@shape\@undefined