diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/mh/flexisym.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/mh/flexisym.sty | 380 |
1 files changed, 252 insertions, 128 deletions
diff --git a/Master/texmf-dist/tex/latex/mh/flexisym.sty b/Master/texmf-dist/tex/latex/mh/flexisym.sty index 4603c90e1db..b370beb1744 100644 --- a/Master/texmf-dist/tex/latex/mh/flexisym.sty +++ b/Master/texmf-dist/tex/latex/mh/flexisym.sty @@ -28,10 +28,11 @@ %% flexisym.sty, flexisym.pdf, flexisym.ins, flexisym.drv, %% cmbase.sym, mathpazo.sym, mathptmx.sym, msabm.sym. %% -\ProvidesPackage{flexisym}[2008/07/23 v0.97] -\let\@xp\expandafter \let\@nx\noexpand +\RequirePackage{expl3}[2009/08/05] +\ProvidesExplPackage{flexisym}{2009/08/07}{0.97a}{Make math characters macros} + \edef\do{% - \@nx\AtEndOfPackage{% + \noexpand\AtEndOfPackage{% \catcode\number`\"=\number\catcode`\" \relax }% @@ -41,7 +42,7 @@ \let\@sym\@gobble \DeclareOption{robust}{% \def\@sym#1{% - \ifx\protect\@typeset@protect \else\protect#1\@xp\@gobblefour\fi + \ifx\protect\@typeset@protect \else\protect#1\exp_after:wN\use_none:nnnn\fi }% } \def\mg@bin{2}% binary operators @@ -59,121 +60,234 @@ \def\mg@cal{2}% script/calligraphic %%\def\mg@frak{5}% Fraktur letters \def\mg@digit{0}% decimal digits % 1 = oldstyle, 0 = capital -\expandafter\let\csname MathChar \endcsname\mathchar -\expandafter\let\csname Delimiter \endcsname\delimiter -\expandafter\let\csname Radical \endcsname\radical -\newcommand{\MathChar}{} -\edef\MathChar{\csname MathChar \endcsname\noexpand\string} -\newcommand{\Delimiter}{} -\edef\Delimiter{\csname Delimiter \endcsname\noexpand\string} -\newcommand{\Radical}{} -\edef\Radical{\csname Radical \endcsname\noexpand\string} +\cs_set_protected:Nn \math_char:NNn { + \tex_mathchar:D \intexpr_eval:w " #1#2#3 \intexpr_eval_end: +} +\cs_set_protected:Nn \math_delimiter:NNnNn { + \tex_delimiter:D \intexpr_eval:w " #1#2#3#4#5 \intexpr_eval_end: +} +\cs_set_protected:Nn \math_radical:NnNn { + \tex_radical:D \intexpr_eval:w " #1#2#3#4 \intexpr_eval_end: +} +\cs_set_protected:Nn \math_accent:NNnn { + \tex_mathaccent:D \intexpr_eval:w " #1 #2 #3 \intexpr_eval_end: {#4} +} + \let\sumlimits\displaylimits \let\intlimits\nolimits \let\namelimits\displaylimits -\edef\m@Ord#1#2#3{\csname MathChar \endcsname"0#1#2#3 } -\edef\m@Var#1#2#3{\csname MathChar \endcsname"7#1#2#3 } -\edef\m@Bin#1#2#3{\csname MathChar \endcsname"2#1#2#3 } -\edef\m@Rel#1#2#3{\csname MathChar \endcsname"3#1#2#3 } -\edef\m@Pun#1#2#3{\csname MathChar \endcsname"6#1#2#3 } -\edef\m@COs#1#2#3{\csname MathChar \endcsname"1#1#2#3 \sumlimits} -\edef\m@COi#1#2#3{\csname MathChar \endcsname"1#1#2#3 \intlimits} -\def\delim@a#1#2#3#4{\ifx\relax#1#2#3#4\else#1\fi #2#3#4} -\def\delim@b#1#2#3#4{\ifx\relax#1#2#3#4\else#1\fi } -\def\@tempa{% - \@nx\@xp\@nx\delim@a\@nx\csname sd@##1##2##3\@nx\endcsname ##1##2##3 } -\edef\m@DeL#1#2#3{\csname Delimiter \endcsname"4\@tempa} -\edef\m@DeR#1#2#3{\csname Delimiter \endcsname"5\@tempa} -\edef\m@DeB#1#2#3{\csname Delimiter \endcsname"0\@tempa} -\edef\m@DeA#1#2#3{\csname Delimiter \endcsname"3\@tempa} -\edef\m@Rad#1#2#3{\csname Radical \endcsname"\@tempa} -\def\do#1#2{\@xp\def\csname sd@#1\endcsname{#2}} -\do{300}{028} -\do{301}{029} -\do{302}{05B} -\do{303}{05D} -\do{304}{262} -\do{305}{263} -\do{306}{264} -\do{307}{265} -\do{308}{266} -\do{309}{267} -\do{30A}{268} -\do{30B}{269} -\do{30C}{26A} -\do{30D}{26B} -\do{30E}{13D} -\do{30F}{26E} -\do{340}{37A} -\do{341}{37B} -\do{33A}{33A} -\do{33B}{33B} -\do{33E}{33E} -\do{33C}{26A} -\do{33D}{26B} -\do{378}{222} -\do{379}{223} -\do{33F}{26C} -\do{37E}{22A} -\do{37F}{22B} -\do{377}{26D} -\do{30F}{26E} -\def\m@Acc#1#2#3#4{\mathaccent"#1#2#3{#4}} -\def\@symAcc{\@sym} +\cs_new:Npn \math_bsym_Ord:Nn {\math_char:NNn 0 }% \m@Ord +\cs_new:Npn \math_bsym_Var:Nn {\math_char:NNn 7 }% \m@Var +\cs_new:Npn \math_bsym_Bin:Nn {\math_char:NNn 2}% \m@Bin +\cs_new:Npn \math_bsym_Rel:Nn {\math_char:NNn 3 }% \m@Bin +\cs_new:Npn \math_bsym_Pun:Nn {\math_char:NNn 6 }%\m@Pun +\cs_new:Nn \math_bsym_COs:Nn { \math_char:NNn 1#1{#2} \sumlimits}% \m@COs +\cs_new:Nn \math_bsym_COi:Nn { \math_char:NNn 1#1{#2} \intlimits}% \m@COi +\cs_new:Nn \math_bsym_DeL:Nn { \math_sd_del_aux:Nnn 4 #1{#2} }%\m@DeL +\cs_new:Nn \math_bsym_DeR:Nn { \math_sd_del_aux:Nnn 5 #1{#2} } %\m@DeR +\cs_new:Nn \math_bsym_DeB:Nn { \math_sd_del_aux:Nnn 0 #1{#2} }%\m@DeB +\cs_new:Nn \math_bsym_DeA:Nn { \math_sd_del_aux:Nnn 3 #1{#2} }%\m@DeA +\cs_new:Nn \math_bsym_Rad:Nn { \math_sd_rad_aux:Nn #1{#2} }%\m@Rad +\cs_new:Npn \math_bsym_Acc:Nn #1#2#3#4 {\math_accent:NNnn #1#2{#3}{#4}}% name is wrong + +\cs_set:Npn \math_sd_del_aux:Nnn #1#2#3{ + \exp_args:Nf \math_sd_del_auxi:nN {\use:c{sd@#2#3}} #1 #2{#3} +} +\cs_set:Npn \math_sd_del_auxi:nN #1#2{ \math_delimiter:NNnNn #2 #1 } +\cs_set:Npn \math_sd_rad_aux:Nn #1#2{ + \exp_args:Nf \math_sd_rad_auxi:n {\use:c{sd@#1#2}} #1 {#2} +} +\cs_set:Npn \math_sd_rad_auxi:n #1{ \math_radical:NnNn #1 } + +\cs_set_protected:Npn \math_bcsym_Ord:Nn #1#2{\@symtype\mathord{\OrdSymbol{#2}}}%\@symOrd +\cs_set_protected:Npn \math_bcsym_Var:Nn #1#2{\@symtype\mathord{\OrdSymbol{#2}}}%\@symVar +\cs_set_protected:Npn \math_bcsym_Bin:Nn #1#2{\@symtype\mathbin{\OrdSymbol{#2}}}%\@symBin +\cs_set_protected:Npn \math_bcsym_Rel:Nn #1#2{\@symtype\mathrel{\OrdSymbol{#2}}}%\@symRel +\cs_set_protected:Npn \math_bcsym_Pun:Nn #1#2{\@symtype\mathpunct{\OrdSymbol{#2}}}%\@symPun +\cs_set_protected:Npn \math_bcsym_COi:Nn #1#2{\@symtype\mathop{\OrdSymbol{#2}\intlimits}}%\@symCOi +\cs_set_protected:Npn \math_bcsym_COs:Nn #1#2{\@symtype\mathop{\OrdSymbol{#2}\sumlimits}}%\@symCOs +\cs_set_protected:Npn \math_bcsym_DeL:Nn #1#2{\@symtype\mathopen{\OrdSymbol{#2}}}%\@symDeL +\cs_set_protected:Npn \math_bcsym_DeR:Nn #1#2{\@symtype\mathclose{\OrdSymbol{#2}}}%\@symDeR +\cs_set_protected:Npn \math_bcsym_DeB:Nn #1#2{\@symtype\mathord{\OrdSymbol{#2}}}%\@symDeB +\cs_set_protected:Npn \math_bcsym_DeA:Nn #1#2{\@symtype\mathrel{\OrdSymbol{#2}}}%\@symDeA +\cs_set_protected:Npn \math_bcsym_Acc:Nn {\@sym}%\@symAcc FIX! +\cs_set_protected:Npn \math_bcsym_Ope:Nn #1#2{\@symtype\mathopen{\OrdSymbol{#2}}}%\@symVar +\cs_set_protected:Npn \math_bcsym_Clo:Nn #1#2{\@symtype\mathclose{\OrdSymbol{#2}}}%\@symVar +\cs_set_protected:Npn \math_bcsym_Inn:Nn #1#2{\@symtype\mathinner{\OrdSymbol{#2}}}%\@symVar + \let\@symtype\@firstofone -\def\@symOrd#1#2{\@symtype\mathord{\OrdSymbol{#2}}} -\def\@symVar{\@symOrd} -\def\@symBin#1#2{\@symtype\mathbin{\OrdSymbol{#2}}} -\def\@symRel#1#2{\@symtype\mathrel{\OrdSymbol{#2}}} -\def\@symPun#1#2{\@symtype\mathpunct{\OrdSymbol{#2}}} -\def\@symCOi#1#2{\@symtype{\mathop{\OrdSymbol{#2}}\intlimits}} -\def\@symCOs#1#2{\@symtype{\mathop{\OrdSymbol{#2}}\sumlimits}} -\def\@symOpe#1#2{\@symtype\mathopen{\OrdSymbol{#2}}} -\def\@symClo#1#2{\@symtype\mathclose{\OrdSymbol{#2}}} -\def\@symDeL#1#2{\@symtype\mathopen{\OrdSymbol{#2}}} -\def\@symDeR#1#2{\@symtype\mathclose{\OrdSymbol{#2}}} -\def\@symDeB#1#2{\@symtype\mathord{\OrdSymbol{#2}}} -\def\@symInn#1#2{\@symtype\mathinner{\OrdSymbol{#2}}} -\def\@xnce#1{\@xp\@nx\csname#1\endcsname} \let\sym@global\global +\cs_new:Npn \math_isym_Ord:Nn {\math_bsym_Ord:Nn }% \m@Ord +\cs_new:Npn \math_isym_Var:Nn {\math_bsym_Var:Nn }% \m@Var +\cs_new:Npn \math_isym_Bin:Nn {\math_bsym_Bin:Nn}% \m@Bin +\cs_new:Npn \math_isym_Rel:Nn {\math_bsym_Rel:Nn }% \m@Bin +\cs_new:Npn \math_isym_Pun:Nn {\math_bsym_Pun:Nn }%\m@Pun +\cs_new:Npn \math_isym_COs:Nn {\math_bsym_COs:Nn}% \m@COs +\cs_new:Npn \math_isym_COi:Nn {\math_bsym_COi:Nn}% \m@COi +\cs_new:Npn \math_isym_DeL:Nn {\math_bsym_DeL:Nn}%\m@DeL +\cs_new:Npn \math_isym_DeR:Nn{ \math_bsym_DeR:Nn}%\m@DeR +\cs_new:Npn \math_isym_DeB:Nn{ \math_bsym_DeB:Nn }%\m@DeB +\cs_new:Npn \math_isym_DeA:Nn { \math_bsym_DeA:Nn }%\m@DeA +\cs_new:Npn \math_isym_Rad:Nn { \math_bsym_Rad:Nn}%\m@Rad +\cs_new:Npn \math_isym_Acc:Nn {\math_bsym_DeL:Nn}% name is wrong +\cs_set_protected:Npn \math_icsym_Ord:Nn {\math_bcsym_Ord:Nn} +\cs_set_protected:Npn \math_icsym_Var:Nn {\math_bcsym_Var:Nn} +\cs_set_protected:Npn \math_icsym_Bin:Nn {\math_bcsym_Bin:Nn} +\cs_set_protected:Npn \math_icsym_Rel:Nn {\math_bcsym_Rel:Nn} +\cs_set_protected:Npn \math_icsym_Pun:Nn {\math_bcsym_Pun:Nn} +\cs_set_protected:Npn \math_icsym_COi:Nn {\math_bcsym_COi:Nn} +\cs_set_protected:Npn \math_icsym_COs:Nn {\math_bcsym_COs:Nn} +\cs_set_protected:Npn \math_icsym_DeL:Nn {\math_bcsym_DeL:Nn} +\cs_set_protected:Npn \math_icsym_DeR:Nn {\math_bcsym_DeR:Nn} +\cs_set_protected:Npn \math_icsym_DeB:Nn {\math_bcsym_DeB:Nn} +\cs_set_protected:Npn \math_icsym_DeA:Nn {\math_bcsym_DeA:Nn} +\cs_set_protected:Npn \math_icsym_Acc:Nn {\math_bcsym_Acc:Nn} +\cs_set_protected:Npn \math_icsym_Ope:Nn {\math_bcsym_Ope:Nn} +\cs_set_protected:Npn \math_icsym_Clo:Nn {\math_bcsym_Clo:Nn} +\cs_set_protected:Npn \math_icsym_Inn:Nn {\math_bcsym_Inn:Nn} +\cs_new:Npn \math_dsym_Ord:Nn {\math_bsym_Ord:Nn } +\cs_new:Npn \math_dsym_Var:Nn {\math_bsym_Var:Nn } +\cs_new:Npn \math_dsym_Bin:Nn {\math_bsym_Bin:Nn} +\cs_new:Npn \math_dsym_Rel:Nn {\math_bsym_Rel:Nn } +\cs_new:Npn \math_dsym_Pun:Nn {\math_bsym_Pun:Nn } +\cs_new:Npn \math_dsym_COs:Nn {\math_bsym_COs:Nn} +\cs_new:Npn \math_dsym_COi:Nn {\math_bsym_COi:Nn} +\cs_new:Npn \math_dsym_DeL:Nn {\math_bsym_DeL:Nn} +\cs_new:Npn \math_dsym_DeR:Nn{ \math_bsym_DeR:Nn} +\cs_new:Npn \math_dsym_DeB:Nn{ \math_bsym_DeB:Nn } +\cs_new:Npn \math_dsym_DeA:Nn { \math_bsym_DeA:Nn } +\cs_new:Npn \math_dsym_Rad:Nn { \math_bsym_Rad:Nn} +\cs_new:Npn \math_dsym_Acc:Nn {\math_bsym_DeL:Nn} +\cs_set_protected:Npn \math_dcsym_Ord:Nn {\math_bcsym_Ord:Nn} +\cs_set_protected:Npn \math_dcsym_Var:Nn {\math_bcsym_Var:Nn} +\cs_set_protected:Npn \math_dcsym_Bin:Nn {\math_bcsym_Bin:Nn} +\cs_set_protected:Npn \math_dcsym_Rel:Nn {\math_bcsym_Rel:Nn} +\cs_set_protected:Npn \math_dcsym_Pun:Nn {\math_bcsym_Pun:Nn} +\cs_set_protected:Npn \math_dcsym_COi:Nn {\math_bcsym_COi:Nn} +\cs_set_protected:Npn \math_dcsym_COs:Nn {\math_bcsym_COs:Nn} +\cs_set_protected:Npn \math_dcsym_DeL:Nn {\math_bcsym_DeL:Nn} +\cs_set_protected:Npn \math_dcsym_DeR:Nn {\math_bcsym_DeR:Nn} +\cs_set_protected:Npn \math_dcsym_DeB:Nn {\math_bcsym_DeB:Nn} +\cs_set_protected:Npn \math_dcsym_DeA:Nn {\math_bcsym_DeA:Nn} +\cs_set_protected:Npn \math_dcsym_Acc:Nn {\math_bcsym_Acc:Nn} +\cs_set_protected:Npn \math_dcsym_Ope:Nn {\math_bcsym_Ope:Nn} +\cs_set_protected:Npn \math_dcsym_Clo:Nn {\math_bcsym_Clo:Nn} +\cs_set_protected:Npn \math_dcsym_Inn:Nn {\math_bcsym_Inn:Nn} +\cs_set:Npn \math_setup_inline_symbols:{ + \cs_set_eq:NN \math_sym_Ord:Nn \math_isym_Ord:Nn + \cs_set_eq:NN \math_sym_Var:Nn \math_isym_Var:Nn + \cs_set_eq:NN \math_sym_Bin:Nn \math_isym_Bin:Nn + \cs_set_eq:NN \math_sym_Rel:Nn \math_isym_Rel:Nn + \cs_set_eq:NN \math_sym_Pun:Nn \math_isym_Pun:Nn + \cs_set_eq:NN \math_sym_COs:Nn \math_isym_COs:Nn + \cs_set_eq:NN \math_sym_COi:Nn \math_isym_COi:Nn + \cs_set_eq:NN \math_sym_DeL:Nn \math_isym_DeL:Nn + \cs_set_eq:NN \math_sym_DeR:Nn \math_isym_DeR:Nn + \cs_set_eq:NN \math_sym_DeB:Nn \math_isym_DeL:Nn + \cs_set_eq:NN \math_sym_DeA:Nn \math_isym_DeA:Nn + \cs_set_eq:NN \math_sym_Rad:Nn \math_isym_Rad:Nn + \cs_set_eq:NN \math_sym_Acc:Nn \math_isym_DeL:Nn + \cs_set_eq:NN \math_csym_Ord:Nn \math_icsym_Ord:Nn + \cs_set_eq:NN \math_csym_Var:Nn \math_icsym_Var:Nn + \cs_set_eq:NN \math_csym_Bin:Nn \math_icsym_Bin:Nn + \cs_set_eq:NN \math_csym_Rel:Nn \math_icsym_Rel:Nn + \cs_set_eq:NN \math_csym_Pun:Nn \math_icsym_Pun:Nn + \cs_set_eq:NN \math_csym_COi:Nn \math_icsym_COi:Nn + \cs_set_eq:NN \math_csym_COs:Nn \math_icsym_COs:Nn + \cs_set_eq:NN \math_csym_DeL:Nn \math_icsym_DeL:Nn + \cs_set_eq:NN \math_csym_DeR:Nn \math_icsym_DeR:Nn + \cs_set_eq:NN \math_csym_DeB:Nn \math_icsym_DeB:Nn + \cs_set_eq:NN \math_csym_DeA:Nn \math_icsym_DeA:Nn + \cs_set_eq:NN \math_csym_Acc:Nn \math_icsym_Acc:Nn + \cs_set_eq:NN \math_csym_Ope:Nn \math_icsym_Ope:Nn + \cs_set_eq:NN \math_csym_Clo:Nn \math_icsym_Clo:Nn + \cs_set_eq:NN \math_csym_Inn:Nn \math_icsym_Inn:Nn +} + +\cs_set:Npn \math_setup_display_symbols:{ + \cs_set_eq:NN \math_sym_Ord:Nn \math_dsym_Ord:Nn + \cs_set_eq:NN \math_sym_Var:Nn \math_dsym_Var:Nn + \cs_set_eq:NN \math_sym_Bin:Nn \math_dsym_Bin:Nn + \cs_set_eq:NN \math_sym_Rel:Nn \math_dsym_Rel:Nn + \cs_set_eq:NN \math_sym_Pun:Nn \math_dsym_Pun:Nn + \cs_set_eq:NN \math_sym_COs:Nn \math_dsym_COs:Nn + \cs_set_eq:NN \math_sym_COi:Nn \math_dsym_COi:Nn + \cs_set_eq:NN \math_sym_DeL:Nn \math_dsym_DeL:Nn + \cs_set_eq:NN \math_sym_DeR:Nn \math_dsym_DeR:Nn + \cs_set_eq:NN \math_sym_DeB:Nn \math_dsym_DeL:Nn + \cs_set_eq:NN \math_sym_DeA:Nn \math_dsym_DeA:Nn + \cs_set_eq:NN \math_sym_Rad:Nn \math_dsym_Rad:Nn + \cs_set_eq:NN \math_sym_Acc:Nn \math_dsym_DeL:Nn + \cs_set_eq:NN \math_csym_Ord:Nn \math_dcsym_Ord:Nn + \cs_set_eq:NN \math_csym_Var:Nn \math_dcsym_Var:Nn + \cs_set_eq:NN \math_csym_Bin:Nn \math_dcsym_Bin:Nn + \cs_set_eq:NN \math_csym_Rel:Nn \math_dcsym_Rel:Nn + \cs_set_eq:NN \math_csym_Pun:Nn \math_dcsym_Pun:Nn + \cs_set_eq:NN \math_csym_COi:Nn \math_dcsym_COi:Nn + \cs_set_eq:NN \math_csym_COs:Nn \math_dcsym_COs:Nn + \cs_set_eq:NN \math_csym_DeL:Nn \math_dcsym_DeL:Nn + \cs_set_eq:NN \math_csym_DeR:Nn \math_dcsym_DeR:Nn + \cs_set_eq:NN \math_csym_DeB:Nn \math_dcsym_DeB:Nn + \cs_set_eq:NN \math_csym_DeA:Nn \math_dcsym_DeA:Nn + \cs_set_eq:NN \math_csym_Acc:Nn \math_dcsym_Acc:Nn + \cs_set_eq:NN \math_csym_Ope:Nn \math_dcsym_Ope:Nn + \cs_set_eq:NN \math_csym_Clo:Nn \math_dcsym_Clo:Nn + \cs_set_eq:NN \math_csym_Inn:Nn \math_dcsym_Inn:Nn +} +\math_setup_inline_symbols: +\edef\tmp{\catcode\z@=\the\catcode\z@} +\catcode\z@=\active \def\DeclareFlexSymbol#1#2#3#4{% \begingroup - \edef\@tempb{\@nx\@sym\@nx#1\@xnce{m@#2}\@xnce{mg@#3}#4}% - \ifcat\@nx#1\relax + \cs_set:Npx\@tempb{\exp_not:N\@sym\exp_not:N#1\exp_not:c{math_sym_#2:Nn}\exp_not:c{mg@#3}{#4}}% + \ifcat\exp_not:N#1\relax \sym@global\let#1\@tempb \else \sym@global\mathcode`#1="8000\relax - \lccode`\~=`#1\relax - \lowercase{\sym@global\let~\@tempb}% + \lccode\z@=`#1\relax + \lowercase{\sym@global\let^^@\@tempb}% zero char \fi \endgroup } +\tmp % restore catcode +\cs_set:Npn \DeclareFlexDelimiter #1#2#3#4#5#6{ + \DeclareFlexSymbol{#1}{#2}{#3}{#4} + \cs_gset:cpx{sd@\use:c{mg@#3}#4}{\exp_not:c{mg@#5}{#6}} +} + \def\DeclareFlexCompoundSymbol#1#2#3{% - \@xp\DeclareRobustCommand\@xp#1\@xp{\csname @sym#2\endcsname#1{#3}}% + \exp_args:NNo \DeclareRobustCommand#1{\csname math_csym_#2:Nn\endcsname#1{#3}}% \sym@global\let#1#1\relax } \DeclareRobustCommand\textchar{\text@char\textfont} \DeclareRobustCommand\scriptchar{\text@char\scriptfont}% -\def\text@char@a{\?\endgroup}% -\def\text@char@sym#1#2#3{% +\def\text@char@sym#1#2#3#4{% #3=fam, #4=slot \begingroup - \let\@sym\relax % defense against infinite loops - \the\text@script@char#3% - \afterassignment\text@char@a - \chardef\?="% + \cs_set_eq:NN \@sym \prg_do_nothing: % defense against infinite loops + \the\text@script@char#3% + \char"#4\endgroup } -\def\text@char#1#2{\begingroup\check@mathfonts - \let\text@script@char#1\let\@sym\text@char@sym - \let\@symtype\@secondoftwo \let\OrdSymbol\@firstofone - \let\ifmmode\iftrue \everymath{$\@gobble}%$ - \def\mkern{\muskip\z@}\let\mskip\mkern - \ifcat\relax\noexpand#2#2% +\edef\tmp{\catcode\z@=\the\catcode\z@} +\catcode\z@=\active +\def\text@char#1#2{\begingroup + \check@mathfonts + \cs_set_eq:NN \text@script@char#1 + \cs_set_eq:NN \@sym\text@char@sym + \cs_set_eq:NN \@symtype\use_ii:nn + \cs_set_eq:NN\OrdSymbol\use:n + \cs_set_eq:NN\ifmmode\iftrue + \everymath{$\use_none:n}%$ + \def\mkern{\muskip\z@} + \cs_set_eq:NN\mskip\mkern + \ifcat\relax\noexpand#2% true if #2 is a cs. + #2% \else - \lccode`\~=\expandafter`\string#2\relax - \lowercase{~}% + \lccode\z@=\expandafter`\string#2\relax + \lowercase{^^@}% \fi \endgroup } +\tmp % restore catcode \providecommand\textprime{} \DeclareRobustCommand\textprime{\leavevmode \raise.8ex\hbox{\text@char\scriptfont\prime}% @@ -186,38 +300,39 @@ } \@ifundefined{rightarrowfill@}{}{% \def\rightarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ - $#1\copy\z@\mkern-6mu\cleaders + $#1\copy\z@\mkern-7mu\cleaders \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill \mkern-6mu\OrdSymbol{\rightarrow}$} \def\leftarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ $#1\OrdSymbol{\leftarrow}\mkern-6mu\cleaders \hbox{$#1\mkern-2mu\copy\z@\mkern-2mu$}\hfill - \mkern-6mu\box\z@$} + \mkern-7mu\box\z@$} \def\leftrightarrowfill@#1{\m@th\setboxz@h{$#1\relbar$}\ht\z@\z@ $#1\OrdSymbol{\leftarrow}\mkern-6mu\cleaders \hbox{$#1\mkern-2mu\box\z@\mkern-2mu$}\hfill \mkern-6mu\OrdSymbol{\rightarrow}$} } -\def\binrel@sym#1#2#3#4#5{% +\def\binrel@sym#1#2#3#4{% \xdef\binrel@@##1{% - \ifx\m@Ord#2\@nx\@symOrd - \else\ifx\m@Var#2\@nx\@symVar - \else\ifx\m@COs#2\@nx\@symCOs - \else\ifx\m@COi#2\@nx\@symCOi - \else\ifx\m@Bin#2\@nx\@symBin - \else\ifx\m@Rel#2\@nx\@symRel - \else\ifx\m@Pun#2\@nx\@symPun - \else\@nx\@symErr \fi\fi\fi\fi\fi\fi\fi - ?{\@nx\OrdSymbol{##1}}}% + \ifx\math_sym_Ord:Nn #2 \math_csym_Ord:Nn + \else\ifx\math_sym_Var:Nn#2 \math_csym_Var:Nn + \else\ifx\math_sym_COs:Nn#2 \math_csym_COs:Nn + \else\ifx\math_sym_COi:Nn#2 \math_csym_COi:Nn + \else\ifx\math_sym_Bin:Nn#2 \math_csym_Bin:Nn + \else\ifx\math_sym_Rel:Nn#2 \math_csym_Rel:Nn + \else\ifx\math_sym_Pun:Nn#2 \math_csym_Pun:Nn + \else\exp_not:N\@symErr \fi\fi\fi\fi\fi\fi\fi + ?{\exp_not:N\OrdSymbol{##1}}}% } + \def\binrel@a{% - \def\@symOrd##1##2{\gdef\binrel@@####1{\@symOrd##1{\OrdSymbol{####1}}}}% - \def\@symVar##1##2{\gdef\binrel@@####1{\@symVar##1{\OrdSymbol{####1}}}}% - \def\@symCOs##1##2{\gdef\binrel@@####1{\@symCOs##1{\OrdSymbol{####1}}}}% - \def\@symCOi##1##2{\gdef\binrel@@####1{\@symCOi##1{\OrdSymbol{####1}}}}% - \def\@symBin##1##2{\gdef\binrel@@####1{\@symBin##1{\OrdSymbol{####1}}}}% - \def\@symRel##1##2{\gdef\binrel@@####1{\@symRel##1{\OrdSymbol{####1}}}}% - \def\@symPun##1##2{\gdef\binrel@@####1{\@symPun##1{\OrdSymbol{####1}}}}% + \def\math_sym_Ord:Nn##1##2{\gdef\binrel@@####1{\math_sym_Ord:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_Var:Nn##1##2{\gdef\binrel@@####1{\math_sym_Var:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_COs:Nn##1##2{\gdef\binrel@@####1{\math_sym_COs:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_COi:Nn##1##2{\gdef\binrel@@####1{\math_sym_COi:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_Bin:Nn##1##2{\gdef\binrel@@####1{\math_sym_Bin:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_Rel:Nn##1##2{\gdef\binrel@@####1{\math_sym_Rel:Nn##1{\OrdSymbol{####1}}}}% + \def\math_sym_Pun:Nn##1##2{\gdef\binrel@@####1{\math_sym_Pun:Nn##1{\OrdSymbol{####1}}}}% } \def\binrel@#1{% \setbox\z@\hbox{$% @@ -227,26 +342,31 @@ } \def\@symextension{sym} \newcommand\usesymbols[1]{% - \@for\@tempb:=#1\do{% - \@xp\@onefilewithoptions\@xp{\@tempb}[][]\@symextension + \clist_map_variable:nNn{#1}\@tempb{% + \exp_args:No\@onefilewithoptions{\@tempb}[][]\@symextension }% } \newcommand\ProvidesSymbols[1]{\ProvidesFile{#1.sym}} -\DeclareRobustCommand{\not}[1]{\@symRel\not{\OrdSymbol{\notRel#1}}} +\DeclareRobustCommand{\not}[1]{\math_csym_Rel:Nn\not{\OrdSymbol{\notRel#1}}} \DeclareRobustCommand{\OrdSymbol}[1]{% \begingroup\mathchars@reset#1\endgroup } \def\mathchars@reset{\let\@sym\@sym@ord \let\@symtype\@symtype@ord \let\OrdSymbol\relax} \def\@symtype@ord#1#{}% a strange sort of \@gobble -\def\@sym@ord#1#2{\@xp\@sym@ord@a\string#2\@nil}% +\def\@sym@ord#1#2{\exp_after:wN\@sym@ord@a\string#2\@nil}% \begingroup -\lccode`\.=`\@ \lowercase{\endgroup -\def\@sym@ord@a#1.}#2#3\@nil#4#5#6{% - \csname MathChar \endcsname"0% - \if D#2\@xp\delim@b\csname sd@#4#5#6\endcsname#4#5#6 - \else #4#5#6 - \fi +\lccode`\.=`\_ \lowercase{\endgroup +\def\@sym@ord@a#1.#2.}#3#4\@nil#5#6{% + \if D#3 + %\math_ord_delim_aux:Nn #5{#6} + \math_sd_del_aux:Nnn 0 #5{#6}% check if this works! + \else + \math_char:NNn 0 #5{#6} + \fi +} +\cs_set:Nn \math_ord_delim_aux:Nn { + \math_sd_aux:nn { \math_char:NNn 0 } {#1{#2}} } \@ifpackageloaded{amsmath}{% \begingroup @@ -260,15 +380,19 @@ }{} \AtBeginDocument{% \def\newmcodes@{% - \mathcode `\'39\mathcode `\*42\mathcode `\."613A - \ifnum\mathcode`\-=45 + \mathcode `\'39\space + \mathcode `\*42\space + \mathcode `\."613A\space + \ifnum\mathcode`\-=45\space \else - \ifnum\mathcode`\-=32768 + \ifnum\mathcode`\-=32768\space \else \mathchardef \std@minus \mathcode `\-\relax \fi \fi - \mathcode `\-45 \mathcode `\/47\mathcode `\:"603A\relax + \mathcode `\-45\space + \mathcode `\/47\space + \mathcode `\:"603A\space\relax }% } \DeclareOption{mathstyleoff}{% |