summaryrefslogtreecommitdiff
path: root/macros/generic/cptex/lamac.tex
blob: ca8718a95cffd66833798010b4dfae88abd4090c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%
% TeX-Definitionen aus `LaTeX Version 2.09 <25 March 1992>,
% (C) 1992 by Leslie Lamport' zur Verwendung von LaTeX-Makros in Plain-TeX
%
% Makrozusammenstellung und Anpassung:
% 1994 FuturaSoft (Martin Kr„mer, D-49179 Ostercappeln)
%

\def\@whilenoop#1{}
\def\@whilenum#1\do #2{\ifnum #1\relax #2\relax\@iwhilenum{#1\relax
     #2\relax}\fi}
\def\@iwhilenum#1{\ifnum #1\let\@nextwhile\@iwhilenum
         \else\let\@nextwhile\@whilenoop\fi\@nextwhile{#1}}

\def\@whiledim#1\do #2{\ifdim #1\relax#2\@iwhiledim{#1\relax#2}\fi}
\def\@iwhiledim#1{\ifdim #1\let\@nextwhile\@iwhiledim
        \else\let\@nextwhile\@whilenoop\fi\@nextwhile{#1}}

\long\def\@whileswnoop#1\fi{}
\long\def\@whilesw#1\fi#2{#1#2\@iwhilesw{#1#2}\fi\fi}
\long\def\@iwhilesw#1\fi{#1\let\@nextwhile\@iwhilesw
         \else\let\@nextwhile\@whileswnoop\fi\@nextwhile{#1}\fi}

\def\@nnil{\@nil}
\def\@empty{}
\def\@fornoop#1\@@#2#3{}

\def\@for#1:=#2\do#3{\edef\@fortmp{#2}\ifx\@fortmp\@empty \else
    \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi}

\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
       #5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi}

\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
       \let\@nextwhile\@fornoop \else
      #4\relax\let\@nextwhile\@iforloop\fi\@nextwhile#2\@@#3{#4}}

\def\@gobble#1{}
\let\protect\relax

\newwrite\@unused
\newcount\@tempcnta
\newdimen\@tempdima
\newdimen\@tempdimb

\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\typeout{Macro Extensions from LaTeX Version 2.09 (25 Mar 1992) <25 Mar 1994>.}
\def\@@warning#1{\typeout{(La)TeX Warning: #1.}}
\def\@warning#1{\@@warning{#1\on@line}}
\def\@namedef#1{\expandafter\def\csname #1\endcsname}
\def\@nameuse#1{\csname #1\endcsname}

\def\@car#1#2\@nil{#1}
\def\@cdr#1#2\@nil{#2}
\def\@carcube#1#2#3#4\@nil{#1#2#3}

\long\def\@ifdefinable #1#2{\edef\@tempa{\expandafter\@cdr\string #1\@nil}%
\@ifundefined{\@tempa}{\edef\@tempb{\expandafter\@carcube \@tempa xxxx\@nil}%
\ifx \@tempb\@qend \@notdefinable\else
\ifx \@tempa\@qrelax \@notdefinable\else  #2\fi\fi}{\@notdefinable}}

\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname
  #1\endcsname\relax#2\else#3\fi}

\edef\@qend{\expandafter\@cdr\string\end\@nil}
\edef\@qrelax{\expandafter\@cdr\string\relax\@nil}

\def\@ifnextchar#1#2#3{\let\@tempe #1\def\@tempa{#2}\def\@tempb{#3}\futurelet
    \@tempc\@ifnch}
\def\@ifnch{\ifx \@tempc \@sptoken \let\@tempd\@xifnch
      \else \ifx \@tempc \@tempe\let\@tempd\@tempa\else\let\@tempd\@tempb\fi
      \fi \@tempd}

\def\^^01{\let\@sptoken= } \^^01  % this makes \@sptoken a space token
\def\^^01{\@xifnch} \expandafter\def\^^01 {\futurelet\@tempc\@ifnch}

\def\@ifstar#1#2{\@ifnextchar *{\def\@tempa*{#1}\@tempa}{#2}}

\newlinechar`\^^J

\def\@latexerr#1#2{%
\edef\@tempc{#2}\errhelp\expandafter{\@tempc}%
\typeout{(La)TeX error. \space See (La)TeX manual for explanation.^^J
 \space\@spaces\@spaces\@spaces Type \space H <return> \space for
 immediate help.}\errmessage{#1}}
\def\@spaces{\space\space\space\space}
\def\@ehc{Try typing \space <return>
  \space to proceed.^^JIf that doesn't work, type \space X <return> \space to
  quit.}
\def\@notdefinable{\@latexerr{Command name '\@tempa' already used}\@eha}