From 4736ac744a8c914e0d5ced1d157e017a385bbf43 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 29 Feb 2020 03:02:30 +0000
Subject: CTAN sync 202002290302

---
 macros/latex/base/ltfssaxes.dtx | 56 +++++++++++++++++++++++++++++++++++------
 1 file changed, 49 insertions(+), 7 deletions(-)

(limited to 'macros/latex/base/ltfssaxes.dtx')

diff --git a/macros/latex/base/ltfssaxes.dtx b/macros/latex/base/ltfssaxes.dtx
index 1a8dbd9cfb..02a49a3122 100644
--- a/macros/latex/base/ltfssaxes.dtx
+++ b/macros/latex/base/ltfssaxes.dtx
@@ -35,7 +35,7 @@
 %
 %
 \ProvidesFile{ltfssaxes.dtx}
-             [2020/02/18 v1.0c LaTeX Kernel (NFSS Axes handing)]
+             [2020/02/27 v1.0d 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,63 @@
 \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}%
+    \expandafter\series@maybe@drop@one@m\expandafter{\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#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 istelf 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}
 
 
 
@@ -1215,6 +1256,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
-- 
cgit v1.2.3

