Debian Codegraph @

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

raw
1 %%
2 %% This is file `doafter.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% doafter.dtx (with options: `package,latex2e')
8 %%
9 %% IMPORTANT NOTICE
10 %%
11 %% doafter package -- insert a token really after a group
12 %% Copyright (c) 1996 Peter Schmitt and 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{doafter}
30 [1996/05/08 1.2 Aftergroup hacking (PS/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 \let\@@aftergroup\aftergroup
48 \def\doafter#1{%
49 \def\@tempa{\@@aftergroup#1}%
50 \afterassignment\doafter@i\let\@let@token%
51 }
52 \def\doafter@i{%
53 \@let@token%
54 \let\aftergroup\@my@aftergroup%
55 \@@aftergroup\@prepare@after\@tempa%
56 }
57 \def\ag@cnt@local{0 }
58 \let\ag@cnt@global\ag@cnt@local
59 \def\@my@aftergroup{%
60 \begingroup%
61 \count@\ag@cnt@local%
62 \advance\count@\@ne%
63 \xdef\ag@cnt@global{\the\count@\space}%
64 \endgroup%
65 \let\ag@cnt@local\ag@cnt@global%
66 \@@aftergroup\@after@token\@@aftergroup%
67 }
68 \def\@after@token{%
69 \@start@after@group%
70 \@after@token%
71 }
72 \def\@start@after@group{%
73 \begingroup%
74 \count@\ag@cnt@global%
75 \clubpenalty\ag@cnt@local%
76 \let\@after@token\@after@token@i%
77 }
78 \def\@after@token@i{%
79 \advance\count@\m@ne%
80 \ifnum\count@=\clubpenalty%
81 \global\let\ag@cnt@global\ag@cnt@local%
82 \expandafter\@after@aftertoken\expandafter\@after@all%
83 \else%
84 \expandafter\@@aftergroup%
85 \fi%
86 }
87 \let\@after@all\endgroup
88 \def\@prepare@after{%
89 \ifx\ag@cnt@local\ag@cnt@global\else%
90 \expandafter\@prepare@after@i%
91 \fi%
92 }
93 \def\@prepare@after@i#1{%
94 \@start@after@group%
95 \def\@after@all{\@@aftergroup#1\endgroup}%
96 }
97 \def\@after@aftertoken#1{%
98 \let\bgroup\relax\let\egroup\relax%
99 \toks@{#1}%
100 \futurelet\@let@token\@after@aftertoken@i%
101 }
102 \def\@after@aftertoken@i{%
103 \ifcat\noexpand\@let@token{%
104 \@@aftergroup{%
105 \else\ifcat\noexpand\@let@token}%
106 \@@aftergroup}%
107 \else%
108 \def\@tempa##1{\@@aftergroup##1\the\toks@}%
109 \expandafter\expandafter\expandafter\@tempa%
110 \fi\fi%
111 }
112 \endinput
113 %%
114 %% End of file `doafter.sty'.