Debian Codegraph @

texmf-dist/tex/latex/mdwtools/at.sty

raw
1 %%
2 %% This is file `at.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% at.dtx (with options: `package')
8 %%
9 %% IMPORTANT NOTICE
10 %%
11 %% at package -- support for `@' commands'
12 %% Copyright (c) 1996 Mark Wooding
13 %%
14 %% This program is free software; you can redistribute it and/or modify
15 %% it under the terms of the GNU General Public License as published by
16 %% the Free Software Foundation; either version 2 of the License, or
17 %% (at your option) any later version.
18 %%
19 %% This program is distributed in the hope that it will be useful,
20 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
21 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 %% GNU General Public License for more details.
23 %%
24 %% You should have received a copy of the GNU General Public License
25 %% along with this program; if not, write to the Free Software
26 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 %%
28 \NeedsTeXFormat{LaTeX2e}
29 \ProvidesPackage{at}
30 [1996/05/02 1.3 @-command support (MDW)]
31 %% \CharacterTable
32 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
33 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
34 %% Digits \0\1\2\3\4\5\6\7\8\9
35 %% Exclamation \! Double quote \" Hash (number) \#
36 %% Dollar \$ Percent \% Ampersand \&
37 %% Acute accent \' Left paren \( Right paren \)
38 %% Asterisk \* Plus \+ Comma \,
39 %% Minus \- Point \. Solidus \/
40 %% Colon \: Semicolon \; Less than \<
41 %% Equals \= Greater than \> Question mark \?
42 %% Commercial at \@ Left bracket \[ Backslash \\
43 %% Right bracket \] Circumflex \^ Underscore \_
44 %% Grave accent \` Left brace \{ Vertical bar \|
45 %% Right brace \} Tilde \~}
46 %%
47 \def\atallowdigits{\let\ifat@digits\iftrue}
48 \def\atdisallowdigits{\let\ifat@digits\iffalse}
49 \DeclareOption{digits}{\atallowdigits}
50 \DeclareOption{nodigits}{\atdisallowdigits}
51 \ExecuteOptions{nodigits}
52 \ProcessOptions
53 \begingroup
54 \catcode`\<1
55 \catcode`\>2
56 \catcode`\{12
57 \catcode`\}12
58 \gdef\at@lb<{>
59 \gdef\at@rb<}>
60 \gdef\at@spc< >
61 \endgroup
62 \def\at@test#1\then{%
63 #1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi%
64 }
65 \def\at@ifcat#1{\at@test\ifcat#1\noexpand\@let@token\then}
66 \def\at@ifletter#1#2{%
67 \at@ifcat x%
68 {\at@ifletter@ii{#1}}%
69 {\at@ifcat 0%
70 {\at@ifletter@i{#1}{#2}}%
71 {#2}%
72 }%
73 }
74 \def\at@ifletter@i#1#2#3{%
75 \at@test\if%
76 \ifat@digits1\else0\fi%
77 \ifnum`#3<`0x\else\ifnum`#3>`9x\else1\fi\fi%
78 \then%
79 {\at@ifletter@ii{#1}{#3}}%
80 {#2#3}%
81 }
82 \def\at@ifletter@ii#1#2{\toks@\expandafter{\the\toks@#2}#1}
83 \def\at@read@name#1{%
84 \let\at@next=#1%
85 \toks@{}%
86 \futurelet\@let@token\at@rn@i%
87 }
88 \def\at@rn@i{%
89 \def\@tempa{\afterassignment\at@rn@iv\let\@let@token= }%
90 \at@ifletter%
91 {\futurelet\@let@token\at@rn@iii}%
92 {\at@ifcat\bgroup%
93 {\toks@\expandafter{\at@lb}\@tempa}%
94 {\at@ifcat\egroup%
95 {\toks@\expandafter{\at@rb}\@tempa}%
96 {\at@ifcat\at@spc%
97 {\toks@{ }\@tempa}%
98 {\at@rn@ii}%
99 }%
100 }%
101 }%
102 }
103 \def\at@rn@ii#1{%
104 \toks@\expandafter{\string#1}%
105 \at@rn@iv%
106 }
107 \def\at@rn@iii{%
108 \at@ifletter%
109 {\futurelet\@let@token\at@rn@iii}%
110 {\@ifnextchar.\at@rn@iv\at@rn@iv}%
111 }
112 \def\at@rn@iv{%
113 \let\@let@token\relax%
114 \expandafter\at@next\csname at.\the\toks@\endcsname%
115 }
116 \def\at@cmdname#1{\expandafter\at@cmdname@i\string#1\@@foo}
117 \def\at@cmdname@i#1.#2\@@foo{#2}
118 \def\at@decode#1{%
119 \at@test\ifx#1\relax\then{%
120 \PackageError{at}{Unknown @-command `@\at@cmdname#1'}{%
121 The @-command you typed wasn't recognised, so I've ignored it.
122 }%
123 }{%
124 #1%
125 }%
126 }
127 \def\@at{%
128 \def\@tempa{\at@read@name\at@decode}%
129 \ifmmode\ifx\Iat\not@@defined\else%
130 \let\@tempa\Iat%
131 \fi\fi%
132 \@tempa%
133 }
134 \def\at@buildcmd#1#2{%
135 \expandafter\def\csname\expandafter
136 \@gobble\string#1@decode\endcsname##1{#2##1}%
137 \edef#1{%
138 \noexpand\at@read@name%
139 \expandafter\noexpand%
140 \csname\expandafter\@gobble\string#1@decode\endcsname%
141 }%
142 }
143 \at@buildcmd\newatcommand\newcommand
144 \at@buildcmd\renewatcommand\renewcommand
145 \at@buildcmd\provideatcommand\providecommand
146 \at@buildcmd\atdef\def
147 \at@buildcmd\atshow\show
148 \def\atlet{%
149 \begingroup%
150 \@makeother\@%
151 \at@read@name\atlet@i%
152 }
153 \def\atlet@i#1{%
154 \def\at@temp{#1}%
155 \@ifnextchar=\atlet@ii{\atlet@ii=}%
156 }
157 \def\atlet@ii#1{\afterassignment\atlet@iii\global\let\at@gnext=}
158 \def\atlet@iii{%
159 \if @\noexpand\at@gnext%
160 \expandafter\at@read@name\expandafter\atlet@iv%
161 \else%
162 \expandafter\endgroup%
163 \expandafter\let\at@temp= \at@gnext%
164 \fi%
165 }
166 \def\atlet@iv#1{%
167 \expandafter\endgroup%
168 \expandafter\let\at@temp=#1%
169 }
170 \def\at{\ifx\protect\@typeset@protect\else\at@protect\fi\@at}
171 \def\at@protect\fi#1{%
172 \fi%
173 \ifx\protect\string%
174 \expandafter\at@protect@string%
175 \else%
176 \expandafter\at@protect@noexpand%
177 \fi%
178 }
179 \def\at@protect@string{@\string}
180 \def\at@protect@noexpand{\noexpand\@at@ @\noexpand}
181 \def\@at@#1{\at}
182 \def\aton{%
183 \ifnum\catcode`\@=\active\else%
184 \edef\atoff{\catcode`\noexpand\@\the\catcode`\@}%
185 \catcode`\@\active%
186 \lccode`\~`\@%
187 \lowercase{\let~\at}%
188 \fi%
189 }
190 \def\atoff{\catcode`\@12}
191 \let\makeatother\aton
192 \AtBeginDocument{\aton}
193 \expandafter\def\expandafter\dospecials\expandafter{\dospecials\do\@}
194 \expandafter\def\expandafter\@sanitize\expandafter{%
195 \@sanitize\@makeother\@}
196 \expandafter\chardef\csname at.@\endcsname=`\@
197 \atdef*#1*{\ifmmode\mathbf{#1}\else\textbf{#1}\fi}
198 \atdef/#1/{\ifmmode\mathit{#1}\else\emph{#1}\fi}
199 \atlet i=\index
200 \atdef I#1{#1\index{#1}}
201 \endinput
202 %%
203 %% End of file `at.sty'.