diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/supp-lat.mkii')
-rw-r--r-- | Master/texmf-dist/tex/context/base/supp-lat.mkii | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/supp-lat.mkii b/Master/texmf-dist/tex/context/base/supp-lat.mkii new file mode 100644 index 00000000000..576121327cb --- /dev/null +++ b/Master/texmf-dist/tex/context/base/supp-lat.mkii @@ -0,0 +1,59 @@ +%D \module +%D [ file=syst-ltx, +%D version=2009.10.13, +%D title=\CONTEXT\ System Macros, +%D subtitle=General, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The bib module assumes that sometimes this command is used but +%D in \MKIV\ we no longer assume that. +%D +%D \macros +%D {newcommand} +%D +%D This module replaces \type {t-bibltx} and implements the +%D \LATEX\ newcommand (sort of). This command is not to be +%D used directly but only is there for the occasional +%D \BIBTEX\ file that uses it. +%D +%D \starttyping +%D \newcommand\oeps {oeps} +%D \newcommand\oeps[6] {oeps[#1]#6} +%D \newcommand\oeps[6][whatever]{oeps[#1]#6} +%D \stoptyping + +\unprotect + +\def\newcommand#1% + {\dotripleempty\donewcommand[#1]} + +\def\donewcommand + {\ifthirdargument + \expandafter\donewcommandtwo + \else\ifsecondargument + \expandafter\expandafter\expandafter\donewcommandone + \else + \expandafter\expandafter\expandafter\donewcommandzero + \fi\fi} + +\def\donewcommandzero[#1][#2][#3]% + {\long\def#1} + +\def\donewcommandone[#1][#2][#3]% + {\scratchtoks{\long\def#1}% + \dorecurse{#2}{\scratchtoks\expandafter{\the\scratchtoks######1}}% + \the\scratchtoks} + +\def\donewcommandtwo[#1][#2][#3]% + {\long\def#1{\doifnextcharelse[{\getvalue{>>\string#1>>}}{\getvalue{>>\string#1>>}[#3]}}% + \scratchtoks{\long\setvalue{>>\string#1>>}[##1]}% + \dostepwiserecurse{2}{#2}{1}{\scratchtoks\expandafter{\the\scratchtoks######1}}% + \the\scratchtoks} + +\protect \endinput |