summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mathcommand
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-07-03 21:39:47 +0000
committerKarl Berry <karl@freefriends.org>2019-07-03 21:39:47 +0000
commit6d511b03036f0b15e6182a5c3718d6dd3309abae (patch)
treeae4d6b086adc8c12e08fa055aecf6709391b786a /Master/texmf-dist/tex/latex/mathcommand
parent7826d2735a1256c7a3467eac633879709c2618a3 (diff)
mathcommand (3jul19)
git-svn-id: svn://tug.org/texlive/trunk@51542 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mathcommand')
-rw-r--r--Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty37
1 files changed, 22 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty b/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty
index 29b9b0c7007..95389e7d4c5 100644
--- a/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty
+++ b/Master/texmf-dist/tex/latex/mathcommand/mathcommand.sty
@@ -19,11 +19,13 @@
%% LaTeX version 1999/12/01 or later.
%%
\usepackage{expl3}
-\ProvidesExplPackage{mathcommand}{2019/05/12}{1.01}{}
+\ProvidesExplPackage{mathcommand}{2019/07/03}{1.02}{}
%%%%%%%%%%
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\RequirePackage{expl3}
\RequirePackage{etoolbox}
\RequirePackage{xparse}
+
\ExplSyntaxOn
\bool_if_exist:NTF\mathcommand_package_loaded_bool
\endinput
@@ -142,7 +144,7 @@
}
\cs_new:Nn\__mathcommand_declarecommandPIE:Nnnn{
\use:x{
- \exp_not:N\__mathcommand_new_generic:Nnnn
+ \exp_not:N\__mathcommand_declarePIE_generic:Nnnn
\exp_not:N#1
{\IfNoValueTF{#2}{0}{#2}}
{\cs_if_exist:NTF#1
@@ -197,25 +199,25 @@
\DeclareDocumentCommand#1{#2}{}
\int_gset_eq:NN\g_tmpa_int\l__xparse_current_arg_int
\group_end:
- \__mathcommand_new_generic:Nnnn
+ \__mathcommand_declarePIE_generic:Nnnn
#1
{\g_tmpa_int}
{\DeclareDocumentCommand#1{#2}}
{#3}
}
-\cs_new:Nn\__mathcommand_new_generic:Nnnn{
+\cs_new:Nn\__mathcommand_declarePIE_generic:Nnnn{
\int_compare:nNnTF{#2}>{6}
{\PackageError{mathcommand}
{At~most~6~parameters~in~PIE~commands~when~defining~`\token_to_str:N#1'}
{PIE~commands~(mathcommand~package)~do~not~accept~more~than~six~parameters.}}
{\int_case:nn{#2}
- {{0} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3}
- {1} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4}
- {2} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5}
- {3} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6}
- {4} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7}
- {5} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7##8}
- {6} {\cs_new:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7##8##9}}
+ {{0} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3}
+ {1} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4}
+ {2} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5}
+ {3} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6}
+ {4} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7}
+ {5} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7##8}
+ {6} {\cs_set:cpn{\cs_to_str:N#1~PIE~code}##1##2##3##4##5##6##7##8##9}}
{#4}
\use:x{
\exp_not:n{#3}
@@ -246,13 +248,18 @@
\cs_new:Npn\__mathcommand_EmptyContent:w #1#2\end_marker:{
#1*
}
-\cs_new:Npn\GetContent#1{
+\cs_new:Npn\GetExponent#1{
\tl_if_empty:nTF{#1}{}{
- \__mathcommand_GetContent:w #1*\end_marker:
+ \__mathcommand_GetIndexOrExponent:w #1\__end_marker__
}
}
-\cs_new:Npn\__mathcommand_GetContent:w #1#2\end_marker:{
- #1*
+\cs_new:Npn\GetIndex#1{
+ \tl_if_empty:nTF{#1}{}{
+ \__mathcommand_GetIndexOrExponent:w #1\__end_marker__
+ }
+}
+\cs_new:Npn\__mathcommand_GetIndexOrExponent:w #1#2#3\__end_marker__{
+ #2
}
\tl_const:Nn\__mathcommand_prefix_math_tl{Math~}
\tl_const:Nn\__mathcommand_prefix_text_tl{Text~}