From fed27f633aadbacbd3d1221da7993fed8d4efffe Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 15 Sep 2019 03:00:57 +0000 Subject: CTAN sync 201909150300 --- macros/latex-dev/base/ltfssdcl.dtx | 199 ++++++++++++++++++++++++++++++++++--- 1 file changed, 187 insertions(+), 12 deletions(-) (limited to 'macros/latex-dev/base/ltfssdcl.dtx') diff --git a/macros/latex-dev/base/ltfssdcl.dtx b/macros/latex-dev/base/ltfssdcl.dtx index cca3df4693..d1284a08e8 100644 --- a/macros/latex-dev/base/ltfssdcl.dtx +++ b/macros/latex-dev/base/ltfssdcl.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright 1993-2016 +% Copyright (C) 1993-2019 % The LaTeX3 Project and any individual authors listed elsewhere % in this file. % @@ -13,7 +13,7 @@ % The latest version of this license is in % https://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% version 2008 or later. % % This file has the LPPL maintenance status "maintained". % @@ -36,7 +36,7 @@ % % \ProvidesFile{ltfssdcl.dtx} - [2016/02/18 v3.0r LaTeX Kernel (NFSS Declarative Interface)] + [2019/08/27 v3.0s LaTeX Kernel (NFSS Declarative Interface)] % \iffalse \documentclass{ltxdoc} \begin{document} @@ -1078,12 +1078,17 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\DeclareMathAlphabet} -% could do with more checks like allowing single number in |#4| -% lowercase in |#4| etc +% \begin{macro}{\DeclareMathAccent} +% Could do with more checks like allowing single number in |#4| +% lowercase in |#4| etc % \changes{v3.0r}{2016/02/18} % {Check for mathaccent not \cs{mathaccemt}} +% \changes{v3.0s}{2019/08/27}{Make math accents robust} % \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2019/10/01}% +% {DeclareMathAccent}{Make math accents robust}% \def\DeclareMathAccent#1#2#3#4{% \expandafter\in@\csname sym#3\expandafter\endcsname \expandafter{\group@list}% @@ -1097,9 +1102,14 @@ \advance\count\tw@-\count@ \if\relax\noexpand#1% is command? \edef\reserved@a{\noexpand\in@ - {\expandafter\@gobble\string\mathaccent}{\meaning#1}}% + {\expandafter\@gobble\string\mathaccent} + {\expandafter\meaning + \csname\expandafter\@gobble\string#1\space\endcsname}}% \reserved@a \ifin@ + \expandafter\let + \csname\expandafter\@gobble\string#1\space\endcsname + \@undefined \expandafter\set@mathaccent \csname sym#3\endcsname#1#2% {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% @@ -1123,21 +1133,87 @@ \@latex@error{Symbol font `#3' is not defined}\@eha \fi } +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {DeclareMathAccent}{Make math accents robust}% +%\def\DeclareMathAccent#1#2#3#4{% +% \expandafter\in@\csname sym#3\expandafter\endcsname +% \expandafter{\group@list}% +% \ifin@ +% \begingroup +% \count\z@=#4\relax +% \count\tw@\count\z@ +% \divide\count\z@\sixt@@n +% \count@\count\z@ +% \multiply\count@\sixt@@n +% \advance\count\tw@-\count@ +% \if\relax\noexpand#1% is command? +% \edef\reserved@a{\noexpand\in@ +% {\expandafter\@gobble\string\mathaccent}{\meaning#1}}% +% \reserved@a +% \ifin@ +% \expandafter\set@mathaccent +% \csname sym#3\endcsname#1#2% +% {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% +% \@font@info{Redeclaring math accent \string#1}% +% \else +% \expandafter\ifx +% \csname\expandafter\@gobble\string#1\endcsname +% \relax +% \expandafter\set@mathaccent +% \csname sym#3\endcsname#1#2% +% {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% +% \else +% \@latex@error{Command `\string#1' already defined}\@eha +% \fi +% \fi +% \else +% \@latex@error{Not a command name: `\noexpand#1'}\@eha +% \fi +% \endgroup +% \else +% \@latex@error{Symbol font `#3' is not defined}\@eha +% \fi +%} +%\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% +% \begin{macrocode} \@onlypreamble\DeclareMathAccent % \end{macrocode} % \end{macro} % % \begin{macro}{\set@mathaccent} % \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2019/10/01}% +% {\set@mathaccent}{makemath accents robust}% \def\set@mathaccent#1#2#3#4{% - \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}} + \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}% + \MakeRobust#2% +} \@onlypreamble\set@mathaccent +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {\set@mathaccent}{makemath accents robust}% +% +%\def\set@mathaccent#1#2#3#4{% +% \xdef#2{\mathaccent"\mathchar@type#3\hexnumber@#1#4\relax}} +% +%\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % % \begin{macro}{\DeclareMathSymbol} % \changes{v3.0r}{2016/02/18} % {Check for mathchar not \cs{mathchar}} +% \changes{v3.0s}{2019/09/09}{Allow definition if the math symbol was +% a command already robust} % \begin{macrocode} \def\DeclareMathSymbol#1#2#3#4{% \expandafter\in@\csname sym#3\expandafter\endcsname @@ -1151,17 +1227,30 @@ \multiply\count@\sixt@@n \advance\count\tw@-\count@ \if\relax\noexpand#1% is command? +% \end{macrocode} +% Store the command name with a space attached inside +% \cs{reserved@@b} in case we look at a robust definition. +% \begin{macrocode} + \edef\reserved@b{\expandafter\noexpand + \csname\expandafter\@gobble\string#1\space\endcsname}% +% \end{macrocode} +% Test both \verb=#1= and \verb*=#1 = for containing \texttt{mathchar}. +% \begin{macrocode} \edef\reserved@a {\noexpand\in@{\expandafter\@gobble\string\mathchar}% - {\meaning#1}}% + {\meaning#1\expandafter\meaning\reserved@b}}% \reserved@a +% \end{macrocode} +% Drop \verb*=#1 = in case it was defined before. +% \begin{macrocode} + \global\expandafter\let\reserved@b\@undefined \ifin@ \expandafter\set@mathsymbol \csname sym#3\endcsname#1#2% {\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% \@font@info{Redeclaring math symbol \string#1}% \else - \expandafter\ifx + \expandafter\ifx \csname\expandafter\@gobble\string#1\endcsname \relax \expandafter\set@mathsymbol @@ -1278,7 +1367,12 @@ % \begin{macro}{\@DeclareMathDelimiter} % \changes{v3.0r}{2016/02/18} % {Check for delimiter not \cs{delimiter}} +% \changes{v3.0s}{2019/08/27}{Make math delimiters robust} % \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2019/10/01}% +% {\@DeclareMathDelimiter}{Make math delimiters robust}% \def\@DeclareMathDelimiter#1#2#3#4#5#6{% \expandafter\in@\csname sym#3\expandafter\endcsname \expandafter{\group@list}% @@ -1304,9 +1398,11 @@ \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% % \edef\reserved@a{\noexpand\in@ - {\expandafter\@gobble\string\delimiter}{\meaning#1}}% + {\expandafter\@gobble\string\delimiter}% + {\expandafter\meaning\csname\expandafter\@gobble\string#1\space\endcsname}}% \reserved@a \ifin@ + \expandafter\let\csname\expandafter\@gobble\string#1\space\endcsname\@undefined \expandafter\set@mathdelimiter \csname sym#3\expandafter\endcsname \csname sym#5\endcsname#1#2% @@ -1332,6 +1428,68 @@ \@latex@error{Symbol font `#3' is not defined}\@eha \fi } +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {\@DeclareMathDelimiter}{Make math delimiters robust}% +%\def\@DeclareMathDelimiter#1#2#3#4#5#6{% +% \expandafter\in@\csname sym#3\expandafter\endcsname +% \expandafter{\group@list}% +% \ifin@ +% \expandafter\in@\csname sym#5\expandafter\endcsname +% \expandafter{\group@list}% +% \ifin@ +% \begingroup +% \count\z@=#4\relax +% \count\tw@\count\z@ +% \divide\count\z@\sixt@@n +% \count@\count\z@ +% \multiply\count@\sixt@@n +% \advance\count\tw@-\count@ +% \edef\reserved@c{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% +% % +% \count\z@=#6\relax +% \count\tw@\count\z@ +% \divide\count\z@\sixt@@n +% \count@\count\z@ +% \multiply\count@\sixt@@n +% \advance\count\tw@-\count@ +% \edef\reserved@d{\hexnumber@{\count\z@}\hexnumber@{\count\tw@}}% +% % +% \edef\reserved@a{\noexpand\in@ +% {\expandafter\@gobble\string\delimiter}{\meaning#1}}% +% \reserved@a +% \ifin@ +% \expandafter\set@mathdelimiter +% \csname sym#3\expandafter\endcsname +% \csname sym#5\endcsname#1#2% +% \reserved@c\reserved@d +% \@font@info{Redeclaring math delimiter \string#1}% +% \else +% \expandafter\ifx +% \csname\expandafter\@gobble\string#1\endcsname +% \relax +% \expandafter\set@mathdelimiter +% \csname sym#3\expandafter\endcsname +% \csname sym#5\endcsname#1#2% +% \reserved@c\reserved@d +% \else +% \@latex@error{Command `\string#1' already defined}\@eha +% \fi +% \fi +% \endgroup +% \else +% \@latex@error{Symbol font `#5' is not defined}\@eha +% \fi +% \else +% \@latex@error{Symbol font `#3' is not defined}\@eha +% \fi +%} +%\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} +% +% \begin{macrocode} \@onlypreamble\@DeclareMathDelimiter % \end{macrocode} % \end{macro} @@ -1384,10 +1542,27 @@ % % \changes{v2.1q}{1995/04/02}{fix pr/1329} % \begin{macrocode} +% +%<*2ekernel|latexrelease> +%\IncludeInRelease{2019/10/01}% +% {\set@mathdelimiter}{make delimiters robust}% \def\set@mathdelimiter#1#2#3#4#5#6{% \xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5% - \hexnumber@#2#6 }} + \hexnumber@#2#6 }% + \MakeRobust#3% +} \@onlypreamble\set@mathdelimiter +% +%\EndIncludeInRelease +%\IncludeInRelease{0000/00/00}% +% {\set@mathdelimiter}{make delimiters robust}% +% +%\def\set@mathdelimiter#1#2#3#4#5#6{% +% \xdef#3{\delimiter"\mathchar@type#4\hexnumber@#1#5% +% \hexnumber@#2#6 }} +% +%\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % -- cgit v1.2.3