diff options
author | Karl Berry <karl@freefriends.org> | 2021-06-07 20:06:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-06-07 20:06:05 +0000 |
commit | 81eca4c5a7f042ad3b39c5bcd95765b1725b4ebe (patch) | |
tree | 258d3c3cbe4601905bb63d498b653574e2fc7b49 | |
parent | 9469f94f21a9dd6d51e1c81a9e761fc33df2723e (diff) |
mathcommand (7jun21)
git-svn-id: svn://tug.org/texlive/trunk@59512 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/mathcommand/README.md | 35 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mathcommand/mathcommand.pdf | bin | 454011 -> 452046 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/mathcommand/mathcommand.dtx | 170 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mathcommand/mathcommand.ins | 60 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty | 147 |
5 files changed, 284 insertions, 128 deletions
diff --git a/Master/texmf-dist/doc/latex/mathcommand/README.md b/Master/texmf-dist/doc/latex/mathcommand/README.md index ee2f7779ca3..aba303a9d40 100644 --- a/Master/texmf-dist/doc/latex/mathcommand/README.md +++ b/Master/texmf-dist/doc/latex/mathcommand/README.md @@ -1,13 +1,36 @@ + mathcommand.dtx + + Copyright (C) 2019-2021 by Thomas Colcombet + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license or (at your option) any later version. + The latest version of this license is in + + http://www.latex-project.org/lppl.txt + + and version 1.3 or later is part of all distributions of LaTeX + version 2005/12/01 or later. + + This work has the LPPL maintenance status ‘maintained’. + + The Current Maintainer of this work is Thomas Colcombet. + + This work consists of the files + mathcommand.dtx, mathcommand.ins, and makefile, + and the derived files + mathcommand.sty and readme.md. + %%%%%%%% This directory contains the package name: mathcommand - license: LaTeX Project Public License version 1.2 or above - version: v1.03 - date: 2019/12/06 + license: LaTeX Project Public License version 1.3 or above + version: v1.04 + date: 2021/06/07 author: Thomas Colcombet mail: thomas.colcombet@irif.fr - web: - + web: https://www.ctan.org/pkg/mathcommand Purpose: The mathcommand package provides functionalities for defining macros: @@ -24,11 +47,11 @@ Install: Content of the file mathcommand-ctan.zip: - README.md: this file generated while compiling mathcommand.ins, - - mathcommand.sty: the package file (generated using knowledge.ins) + - mathcommand.sty: the package file (generated using mathcommand.ins) - mathcommand.pdf: the user documentation (generated by compiling mathcommand.dtx) - makefile: the makefile. Use 'make all' to generate mathcommand.sty - and knowledge.pdf. It can also: clean the directory, make zip + and mathcommand.pdf. It can also: clean the directory, make zip version of the sources, or ready for CTAN. - mathcommand.ins: is the file generating mathcommand.sty and README.md from mathcommand.dtx (using docstrip). diff --git a/Master/texmf-dist/doc/latex/mathcommand/mathcommand.pdf b/Master/texmf-dist/doc/latex/mathcommand/mathcommand.pdf Binary files differindex 8e836ed0e48..b1716e32ed1 100644 --- a/Master/texmf-dist/doc/latex/mathcommand/mathcommand.pdf +++ b/Master/texmf-dist/doc/latex/mathcommand/mathcommand.pdf diff --git a/Master/texmf-dist/source/latex/mathcommand/mathcommand.dtx b/Master/texmf-dist/source/latex/mathcommand/mathcommand.dtx index e269646e1f1..7b2bb48485a 100644 --- a/Master/texmf-dist/source/latex/mathcommand/mathcommand.dtx +++ b/Master/texmf-dist/source/latex/mathcommand/mathcommand.dtx @@ -4,26 +4,34 @@ % % % -% meta-comment -% -% Copyright (C) 2019-2019 by Thomas Colcombet -% ----------------------------------- -% -% This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.2 -% of this license or (at your option) any later version. -% The latest version of this license is in: -% -% http://www.latex-project.org/lppl.txt -% -% and version 1.2 or later is part of all distributions of LaTeX -% version 1999/12/01 or later. -% +%% mathcommand.dtx +%% +%% Copyright (C) 2019-2021 by Thomas Colcombet +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status ‘maintained’. +%% +%% The Current Maintainer of this work is Thomas Colcombet. +%% +%% This work consists of the files +%% mathcommand.dtx, mathcommand.ins, and makefile, +%% and the derived files +%% mathcommand.sty and readme.md. +%% % \fi % % \iffalse %<head>\usepackage{expl3} -%<head>\ProvidesExplPackage{mathcommand}{2019/12/06}{1.03}{} +%<head>\ProvidesExplPackage{mathcommand}{2021/06/07}{1.04}{} %<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} @@ -40,6 +48,7 @@ \changes{1.01}{2019/05/12}{Initial version} % \changes{1.02}{2019/07/03}{Bug correction} % \changes{1.03}{2019/12/06}{added disabling commands} % +\changes{1.04}{2021/06/05}{correction with respect to modification of xparse package} % \GetFileInfo{mathcommand.sty} % \DoNotIndex{} \edef\mathcommandversiondate{\fileversion--\filedate} @@ -160,6 +169,7 @@ \knowledge{knowledge}{package,url = {https://www.ctan.org/pkg/knowledge}} \knowledge{xcolor}{package,url = {https://www.ctan.org/pkg/xcolor}} \knowledge{amsfonts}{package,url = {https://www.ctan.org/pkg/amsfonts}} +\knowledge{amssymb}{package,url = {https://www.ctan.org/pkg/amssymb}} \knowledge{mathcommand}{package} \knowledge{math variant}{doc notion} @@ -204,6 +214,7 @@ \item[2019-05-14] New macros \cs\IfEmptyTF, \cs\GetExponent, and \cs\GetIndex. \item[2019-07-03] Corrects bug of functions declaring PIE's issuing an error when already existing. Version 1.02 on CTAN. \item[2019-12-06] Added disabling commands, and package options. Version 1.03 on CTAN. +\item[2021-06-07] Corrected code that was broken due to an update in "xparse". Version 1.04 on CTAN. \end{compactdesc} @@ -230,10 +241,9 @@ \end{center} If the macro \cs{\macro} already exists, it is stored - under the name \cs{\LaTeXmacro}, and then everything's happen as + under the name \cs{\LaTeXmacro}, and then everything happens as if it had already been defined both in math and text mode. - - This is interesting for redefining known macros. + This is useful for redefining known macros. For instance \cs{\c} is a convenient way to producing cedillas in \LaTeX, as in \smallcode{\cs\c\ a} which yields `\c a'. However, one may want \cs{\c} to reprensent a variable $c$ in math mode. This is done using, e.g.: @@ -414,7 +424,7 @@ defined with as main body \texttt{\cs\overline\{u\#2\}\#1\#3} Hence, for instance: \begin{code}[10cm] \cs\LoopCommands\cs\lettersUppercase[bb\#1]\\ - \indent~~~~~~\{\cs\newmathcommand\{\cs\mathbb \#1\}\}\\ + \indent~~~~~~\{\cs\newmathcommand\#2\{\cs\mathbb \#1\}\}\\ \cs\LoopCommands\cs\lettersGreekLowercase[\#1][LaTeX\#1]\\ \indent~~~~~~\{\cs\renewmathcommand\#2\{\cs\textcolor\{blue\}\{\#3\}\} \end{code} @@ -422,7 +432,7 @@ defined with as main body \texttt{\cs\overline\{u\#2\}\#1\#3} the letters in blackboard bold alphabet (e.g. with the "amsfonts" package), and the lowercase greek letters \cs\alpha,\dots\ to be displayed in blue (with the "xcolor" package loaded). Note in the last case - the use of the third parameter used for accessing the macros \cs\LaTeXalpha,\dots\ + the use of the third parameter for accessing the macros \cs\LaTeXalpha,\dots\ that are automatically generated by the \cs\renewmathcommand\ macro. \section{Disabling command} @@ -439,7 +449,7 @@ The result of this command is that the control sequences appearing in the sequen \item The original macro is stored as \cs\LaTeXmacro, and thus can still be used. \item Using \cs\macro\ now displays an error message explaining that it has been disabled, that~\cs\LaTeXmacro\ can be used instead, and also provides a list suggestions of replacement that are defined by the command \cs\suggestcommand. \end{itemize} -However, be careful: disabling a command which is used in the system or in the the style will yield an error. +However, be careful: disabling a command which is used in the system or in the the style may cause problems. Hence, it is possible to disable all math symbols but macros like \cs\dagger\ would yield problem if used in footnotes or for the affiliation of the authors. \AP The syntax of~\cs\suggestcommand\ is as follows: \begin{center} @@ -462,7 +472,7 @@ Now, executing \cs\leq\ yields: \section{Options} -\AP Options can either be triggered either when the package is loaded, or using: +\AP Options can be triggered either when the package is loaded, or using: \begin{center} \csintro\mathcommandconfigure\{option list\} \end{center} @@ -495,12 +505,12 @@ The available options are: This directory contains the package name: mathcommand - license: LaTeX Project Public License version 1.2 or above - version: v1.03 - date: 2019/12/06 + license: LaTeX Project Public License version 1.3 or above + version: v1.04 + date: 2021/06/07 author: Thomas Colcombet mail: thomas.colcombet@irif.fr - web: - + web: https://www.ctan.org/pkg/mathcommand Purpose: The mathcommand package provides functionalities for defining macros: @@ -517,11 +527,11 @@ Install: Content of the file mathcommand-ctan.zip: - README.md: this file generated while compiling mathcommand.ins, - - mathcommand.sty: the package file (generated using knowledge.ins) + - mathcommand.sty: the package file (generated using mathcommand.ins) - mathcommand.pdf: the user documentation (generated by compiling mathcommand.dtx) - makefile: the makefile. Use 'make all' to generate mathcommand.sty - and knowledge.pdf. It can also: clean the directory, make zip + and mathcommand.pdf. It can also: clean the directory, make zip version of the sources, or ready for CTAN. - mathcommand.ins: is the file generating mathcommand.sty and README.md from mathcommand.dtx (using docstrip). @@ -676,7 +686,7 @@ Content of the file mathcommand-ctan.zip: % % \begin{macrocode} \NewDocumentCommand\newcommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \newcommandPIE + \__mathcommand_check_definable:nNT {#1} \newcommandPIE { \cs_if_exist:NTF #1 { @@ -688,7 +698,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\renewcommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \renewcommandPIE + \__mathcommand_check_definable:nNT {#1} \renewcommandPIE { \cs_if_exist:NTF #1 { \__mathcommand_declarecommandPIE:Nnnn #1{#2}{#3}{#4} } @@ -700,7 +710,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\declarecommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \declarecommandPIE + \__mathcommand_check_definable:nNT {#1} \declarecommandPIE { \__mathcommand_declarecommandPIE:Nnnn #1{#2}{#3}{#4} } } % \end{macrocode} @@ -721,7 +731,7 @@ Content of the file mathcommand-ctan.zip: % \end{macrocode} % \begin{macrocode} \cs_new_protected:Npn\NewDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \NewDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \NewDocumentCommandPIE { \cs_if_exist:NTF #1 { @@ -735,12 +745,12 @@ Content of the file mathcommand-ctan.zip: % \end{macrocode} % \begin{macrocode} \cs_new_protected:Npn\RenewDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \RenewDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \RenewDocumentCommandPIE { \cs_if_exist:NTF #1 { \__mathcommand_DeclareDocumentCommandPIE:Nnn #1 {#2} {#3} } { - \__kernel_msg_error:nnxx { xparse } { command-not-yet-defined } + \__kernel_msg_error:nnxx { mathcommand } { command-not-yet-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewDocumentCommandPIE } } @@ -749,7 +759,7 @@ Content of the file mathcommand-ctan.zip: % \end{macrocode} % \begin{macrocode} \cs_new_protected:Npn\DeclareDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentCommandPIE { \__mathcommand_DeclareDocumentCommandPIE:Nnn #1 {#2} {#3} } @@ -757,7 +767,7 @@ Content of the file mathcommand-ctan.zip: % \end{macrocode} % \begin{macrocode} \cs_new_protected:Npn\ProvideDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentCommandPIE { \cs_if_exist:NTF #1{} { @@ -970,7 +980,7 @@ Content of the file mathcommand-ctan.zip: % \subsection{Definition of the high level commands} % \begin{macrocode} \NewDocumentCommand\declarecommand{m}{ - \__xparse_check_definable:nNT {#1} \declarecommand + \__mathcommand_check_definable:nNT {#1} \declarecommand { \cs_if_exist:NTF#1 {\renewcommand#1} @@ -978,7 +988,7 @@ Content of the file mathcommand-ctan.zip: } } \newrobustcmd\storecommand[2][\__mathcommand_prefix_store_tl]{ - \__xparse_check_definable:nNT {#2} \storecommand + \__mathcommand_check_definable:nNT {#2} \storecommand { \cs_if_exist:NTF#2{ \cs_set_eq:cN{#1\cs_to_str:N#2}#2 @@ -992,7 +1002,7 @@ Content of the file mathcommand-ctan.zip: } \NewDocumentCommand\NewDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \NewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -1000,7 +1010,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\NewDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \NewDocumentTextCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_text:NF#1 @@ -1008,7 +1018,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\newmathcommand{m}{ - \__xparse_check_definable:nNT {#1} \newmathcommand + \__mathcommand_check_definable:nNT {#1} \newmathcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -1016,7 +1026,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\newtextcommand{m}{ - \__xparse_check_definable:nNT {#1} \newtextcommand + \__mathcommand_check_definable:nNT {#1} \newtextcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_text:NF#1 @@ -1024,7 +1034,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\RenewDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -1032,7 +1042,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\RenewDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_text:NF#1 @@ -1040,7 +1050,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\renewmathcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommand + \__mathcommand_check_definable:nNT {#1} \renewmathcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -1048,7 +1058,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\renewtextcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewtextcommand + \__mathcommand_check_definable:nNT {#1} \renewtextcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_text:NF#1 @@ -1056,14 +1066,14 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\declaremathcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommand + \__mathcommand_check_definable:nNT {#1} \renewmathcommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\declaretextcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewtextcommand + \__mathcommand_check_definable:nNT {#1} \renewtextcommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommand{\__mathcommand_to_texttl:N#1} @@ -1071,28 +1081,28 @@ Content of the file mathcommand-ctan.zip: } \NewDocumentCommand\DeclareDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\DeclareDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentTextCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_texttl:N#1} } } \NewDocumentCommand\ProvideDocumentMathCommand{mmm}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommand{\__mathcommand_to_mathtl:N#1}{#2}{#3} } } \NewDocumentCommand\ProvideDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentTextCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommand{\__mathcommand_to_texttl:N#1} @@ -1104,7 +1114,7 @@ Content of the file mathcommand-ctan.zip: % % \begin{macrocode} \NewDocumentCommand\NewDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \NewDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -1112,7 +1122,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\newmathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \newmathcommandPiE + \__mathcommand_check_definable:nNT {#1} \newmathcommandPiE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -1120,7 +1130,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\RenewDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -1128,7 +1138,7 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\renewmathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommandPIE + \__mathcommand_check_definable:nNT {#1} \renewmathcommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -1136,14 +1146,14 @@ Content of the file mathcommand-ctan.zip: } } \NewDocumentCommand\DeclareDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\declaremathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \declaremathcommandPIE + \__mathcommand_check_definable:nNT {#1} \declaremathcommandPIE { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommandPIE{\__mathcommand_to_mathtl:N#1} @@ -1151,7 +1161,7 @@ Content of the file mathcommand-ctan.zip: } \NewDocumentCommand\ProvideDocumentMathCommandPIE{mmm}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommandPIE{\__mathcommand_to_mathtl:N#1}{#2}{#3} @@ -1265,7 +1275,7 @@ Content of the file mathcommand-ctan.zip: \cs_new:Nn\mathcommand_disablecommand:N { \cs_if_exist:NTF#1{ - \__xparse_check_definable:nNT#1\disablecommand + \__mathcommand_check_definable:nNT#1\disablecommand {\tl_if_exist:cTF{\__mathcommand_to_disabled_help_tl:N#1} {} {\storecommand#1 @@ -1312,6 +1322,44 @@ Content of the file mathcommand-ctan.zip: \NewDocumentCommand\mathcommandconfigure{ m } {\keys_set:nn{ mathcommand}{ #1} } % \end{macrocode} +% +% \subsection{Testing control sequence for definition} +% This part of the code is an import of a previous version of xparse (Frank Mittelbach, Chris Rowley, David Carlisle, The LaTeX Project). It is done in a very ugly hack: the code is copied and past, and \texttt{mathcommand} substituted to \texttt{xparse} wherever necessary. +% \begin{macrocode} +\cs_new_protected:Npn \__mathcommand_check_definable:nNT #1 + { \tl_trim_spaces_apply:nN {#1} \__mathcommand_check_definable_aux:nN } +\group_begin: + \char_set_catcode_active:n { `? } + \cs_new_protected:Npn \__mathcommand_check_definable_aux:nN #1#2 + { + \group_begin: + \tl_if_single_token:nTF {#1} + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_args:Nx \tl_if_empty:nTF + { \exp_args:No \str_tail:n { \token_to_str:N #1 } } + { + \exp_args:Nx \char_set_lccode:nn + { ` \str_head:n {#1} } { `? } + \tex_lowercase:D { \tl_if_eq:nnTF {#1} } { ? } + { \group_end: \use_iii:nnn } + { \group_end: \use_i:nnn } + } + { \group_end: \use_iii:nnn } + } + { \group_end: \use_ii:nnn } + { + \__kernel_msg_error:nnxx { mathcommand } { not-definable } + { \tl_to_str:n {#1} } { \token_to_str:N #2 } + } + { + \__kernel_msg_error:nnxx { mathcommand } { not-one-token } + { \tl_to_str:n {#1} } { \token_to_str:N #2 } + } + } +\group_end: +% \end{macrocode} +% \subsection{Closure} % \begin{macrocode} \ExplSyntaxOff % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/mathcommand/mathcommand.ins b/Master/texmf-dist/source/latex/mathcommand/mathcommand.ins index b8104498c5a..ac79f74974d 100644 --- a/Master/texmf-dist/source/latex/mathcommand/mathcommand.ins +++ b/Master/texmf-dist/source/latex/mathcommand/mathcommand.ins @@ -1,33 +1,52 @@ +%% mathcommand.ins %% -%% Copyright (C) 2017 by Thomas Colcombet +%% Copyright (C) 2019-2021 by Thomas Colcombet %% -%% This file may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.2 of this license or (at your option) any later -%% version. The latest version of this license is in: +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in %% - -%% http://www.latex-project.org/lppl.txt +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status ‘maintained’. +%% +%% The Current Maintainer of this work is Thomas Colcombet. %% -%% and version 1.2 or later is part of all distributions of -%% LaTeX version 1999/12/01 or later. +%% This work consists of the files +%% mathcommand.dtx, mathcommand.ins, and makefile, +%% and the derived files +%% mathcommand.sty and readme.md. %% \input docstrip.tex \keepsilent \askforoverwritefalse \preamble + This is a generated file. + + Copyright (C) 2019-2021 by Thomas Colcombet + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license or (at your option) any later version. + The latest version of this license is in + + http://www.latex-project.org/lppl.txt -This is a generated file. Copyright (C) 2019 by Thomas Colcombet + and version 1.3 or later is part of all distributions of LaTeX + version 2005/12/01 or later. -This file may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either -version 1.2 of this license or (at your option) any later -version. The latest version of this license is in: + This work has the LPPL maintenance status ‘maintained’. - http://www.latex-project.org/lppl.txt + The Current Maintainer of this work is Thomas Colcombet. -and version 1.2 or later is part of all distributions of -LaTeX version 1999/12/01 or later. + This work consists of the files + mathcommand.dtx, mathcommand.ins, and makefile, + and the derived files + mathcommand.sty and readme.md. \endpreamble @@ -57,10 +76,11 @@ LaTeX version 1999/12/01 or later. \Msg{* To finish the installation you have to move the } \Msg{* following file into a directory searched by TeX:} \Msg{*} -\Msg{* knowledge.sty} +\Msg{* mathcommand.sty } \Msg{*} -\Msg{* To produce the documentation run the file *} -\Msg{* knowledge.dtx through LaTeX.} +\Msg{* To produce the documentation run the file} +\Msg{* mathcommand.dtx through LaTeX. or use} +\Msg{* the makefile } \Msg{*} \Msg{****************************************************} diff --git a/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty b/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty index 5aa4c03ae66..30b7658d18e 100644 --- a/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty +++ b/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty @@ -5,21 +5,54 @@ %% The original source files were: %% %% mathcommand.dtx (with options: `head,package') +%% This is a generated file. %% -%% This is a generated file. Copyright (C) 2019 by Thomas Colcombet +%% Copyright (C) 2019-2021 by Thomas Colcombet %% -%% This file may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.2 of this license or (at your option) any later -%% version. The latest version of this license is in: +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in %% -%% http://www.latex-project.org/lppl.txt +%% http://www.latex-project.org/lppl.txt %% -%% and version 1.2 or later is part of all distributions of -%% LaTeX version 1999/12/01 or later. +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. %% +%% This work has the LPPL maintenance status ‘maintained’. +%% +%% The Current Maintainer of this work is Thomas Colcombet. +%% +%% This work consists of the files +%% mathcommand.dtx, mathcommand.ins, and makefile, +%% and the derived files +%% mathcommand.sty and readme.md. +%% +%% mathcommand.dtx +%% +%% Copyright (C) 2019-2021 by Thomas Colcombet +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status ‘maintained’. +%% +%% The Current Maintainer of this work is Thomas Colcombet. +%% +%% This work consists of the files +%% mathcommand.dtx, mathcommand.ins, and makefile, +%% and the derived files +%% mathcommand.sty and readme.md. +%% \usepackage{expl3} -\ProvidesExplPackage{mathcommand}{2019/12/06}{1.03}{} +\ProvidesExplPackage{mathcommand}{2021/06/07}{1.04}{} %%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[1994/06/01] \RequirePackage{expl3,l3keys2e} @@ -115,7 +148,7 @@ \__mathcommand_absorb_finished:} \__mathcommand_absorb_finished:} \NewDocumentCommand\newcommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \newcommandPIE + \__mathcommand_check_definable:nNT {#1} \newcommandPIE { \cs_if_exist:NTF #1 { @@ -127,7 +160,7 @@ } } \NewDocumentCommand\renewcommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \renewcommandPIE + \__mathcommand_check_definable:nNT {#1} \renewcommandPIE { \cs_if_exist:NTF #1 { \__mathcommand_declarecommandPIE:Nnnn #1{#2}{#3}{#4} } @@ -139,7 +172,7 @@ } } \NewDocumentCommand\declarecommandPIE{ m o o m }{ - \__xparse_check_definable:nNT {#1} \declarecommandPIE + \__mathcommand_check_definable:nNT {#1} \declarecommandPIE { \__mathcommand_declarecommandPIE:Nnnn #1{#2}{#3}{#4} } } \cs_new:Nn\__mathcommand_declarecommandPIE:Nnnn{ @@ -156,7 +189,7 @@ {\exp_not:n{#4}} }} \cs_new_protected:Npn\NewDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \NewDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \NewDocumentCommandPIE { \cs_if_exist:NTF #1 { @@ -168,25 +201,25 @@ } } \cs_new_protected:Npn\RenewDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \RenewDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \RenewDocumentCommandPIE { \cs_if_exist:NTF #1 { \__mathcommand_DeclareDocumentCommandPIE:Nnn #1 {#2} {#3} } { - \__kernel_msg_error:nnxx { xparse } { command-not-yet-defined } + \__kernel_msg_error:nnxx { mathcommand } { command-not-yet-defined } { \use:nnn \token_to_str:N #1 { } } { \token_to_str:N \RenewDocumentCommandPIE } } } } \cs_new_protected:Npn\DeclareDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentCommandPIE { \__mathcommand_DeclareDocumentCommandPIE:Nnn #1 {#2} {#3} } } \cs_new_protected:Npn\ProvideDocumentCommandPIE#1#2#3{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentCommandPIE + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentCommandPIE { \cs_if_exist:NTF #1{} { @@ -344,7 +377,7 @@ }{ \cs_set_eq:NN#1\__mathcommand_tmp_cs } } \NewDocumentCommand\declarecommand{m}{ - \__xparse_check_definable:nNT {#1} \declarecommand + \__mathcommand_check_definable:nNT {#1} \declarecommand { \cs_if_exist:NTF#1 {\renewcommand#1} @@ -352,7 +385,7 @@ } } \newrobustcmd\storecommand[2][\__mathcommand_prefix_store_tl]{ - \__xparse_check_definable:nNT {#2} \storecommand + \__mathcommand_check_definable:nNT {#2} \storecommand { \cs_if_exist:NTF#2{ \cs_set_eq:cN{#1\cs_to_str:N#2}#2 @@ -366,7 +399,7 @@ } \NewDocumentCommand\NewDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \NewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -374,7 +407,7 @@ } } \NewDocumentCommand\NewDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \NewDocumentTextCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_text:NF#1 @@ -382,7 +415,7 @@ } } \NewDocumentCommand\newmathcommand{m}{ - \__xparse_check_definable:nNT {#1} \newmathcommand + \__mathcommand_check_definable:nNT {#1} \newmathcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -390,7 +423,7 @@ } } \NewDocumentCommand\newtextcommand{m}{ - \__xparse_check_definable:nNT {#1} \newtextcommand + \__mathcommand_check_definable:nNT {#1} \newtextcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_text:NF#1 @@ -398,7 +431,7 @@ } } \NewDocumentCommand\RenewDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -406,7 +439,7 @@ } } \NewDocumentCommand\RenewDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_text:NF#1 @@ -414,7 +447,7 @@ } } \NewDocumentCommand\renewmathcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommand + \__mathcommand_check_definable:nNT {#1} \renewmathcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -422,7 +455,7 @@ } } \NewDocumentCommand\renewtextcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewtextcommand + \__mathcommand_check_definable:nNT {#1} \renewtextcommand { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_text:NF#1 @@ -430,14 +463,14 @@ } } \NewDocumentCommand\declaremathcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommand + \__mathcommand_check_definable:nNT {#1} \renewmathcommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\declaretextcommand{m}{ - \__xparse_check_definable:nNT {#1} \renewtextcommand + \__mathcommand_check_definable:nNT {#1} \renewtextcommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommand{\__mathcommand_to_texttl:N#1} @@ -445,35 +478,35 @@ } \NewDocumentCommand\DeclareDocumentMathCommand{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\DeclareDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentTextCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_texttl:N#1} } } \NewDocumentCommand\ProvideDocumentMathCommand{mmm}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommand{\__mathcommand_to_mathtl:N#1}{#2}{#3} } } \NewDocumentCommand\ProvideDocumentTextCommand{m}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentTextCommand + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentTextCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommand{\__mathcommand_to_texttl:N#1} } } \NewDocumentCommand\NewDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \NewDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \NewDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -481,7 +514,7 @@ } } \NewDocumentCommand\newmathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \newmathcommandPiE + \__mathcommand_check_definable:nNT {#1} \newmathcommandPiE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_exist_math:NF#1 @@ -489,7 +522,7 @@ } } \NewDocumentCommand\RenewDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \RenewDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \RenewDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -497,7 +530,7 @@ } } \NewDocumentCommand\renewmathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \renewmathcommandPIE + \__mathcommand_check_definable:nNT {#1} \renewmathcommandPIE { \__mathcommand_create_fork:N#1 \__mathcommand_error_if_not_exist_math:NF#1 @@ -505,14 +538,14 @@ } } \NewDocumentCommand\DeclareDocumentMathCommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \DeclareDocumentMathCommand + \__mathcommand_check_definable:nNT {#1} \DeclareDocumentMathCommand { \__mathcommand_create_fork:N#1 \exp_args:Nc\DeclareDocumentCommand{\__mathcommand_to_mathtl:N#1} } } \NewDocumentCommand\declaremathcommandPIE{m}{ - \__xparse_check_definable:nNT {#1} \declaremathcommandPIE + \__mathcommand_check_definable:nNT {#1} \declaremathcommandPIE { \__mathcommand_create_fork:N#1 \exp_args:Nc\declarecommandPIE{\__mathcommand_to_mathtl:N#1} @@ -520,7 +553,7 @@ } \NewDocumentCommand\ProvideDocumentMathCommandPIE{mmm}{ - \__xparse_check_definable:nNT {#1} \ProvideDocumentMathCommandPIE + \__mathcommand_check_definable:nNT {#1} \ProvideDocumentMathCommandPIE { \__mathcommand_create_fork:N#1 \exp_args:Nc\ProvideDocumentCommandPIE{\__mathcommand_to_mathtl:N#1}{#2}{#3} @@ -614,7 +647,7 @@ \cs_new:Nn\mathcommand_disablecommand:N { \cs_if_exist:NTF#1{ - \__xparse_check_definable:nNT#1\disablecommand + \__mathcommand_check_definable:nNT#1\disablecommand {\tl_if_exist:cTF{\__mathcommand_to_disabled_help_tl:N#1} {} {\storecommand#1 @@ -653,6 +686,38 @@ \ProcessKeysOptions { mathcommand } % Parses the option list \NewDocumentCommand\mathcommandconfigure{ m } {\keys_set:nn{ mathcommand}{ #1} } +\cs_new_protected:Npn \__mathcommand_check_definable:nNT #1 + { \tl_trim_spaces_apply:nN {#1} \__mathcommand_check_definable_aux:nN } +\group_begin: + \char_set_catcode_active:n { `? } + \cs_new_protected:Npn \__mathcommand_check_definable_aux:nN #1#2 + { + \group_begin: + \tl_if_single_token:nTF {#1} + { + \int_set:Nn \tex_escapechar:D { 92 } + \exp_args:Nx \tl_if_empty:nTF + { \exp_args:No \str_tail:n { \token_to_str:N #1 } } + { + \exp_args:Nx \char_set_lccode:nn + { ` \str_head:n {#1} } { `? } + \tex_lowercase:D { \tl_if_eq:nnTF {#1} } { ? } + { \group_end: \use_iii:nnn } + { \group_end: \use_i:nnn } + } + { \group_end: \use_iii:nnn } + } + { \group_end: \use_ii:nnn } + { + \__kernel_msg_error:nnxx { mathcommand } { not-definable } + { \tl_to_str:n {#1} } { \token_to_str:N #2 } + } + { + \__kernel_msg_error:nnxx { mathcommand } { not-one-token } + { \tl_to_str:n {#1} } { \token_to_str:N #2 } + } + } +\group_end: \ExplSyntaxOff \endinput |