blob: a85231d2c00004a67f5aef13c478a9a42ddbec7c (
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
%%
%% This is file `xcomment.sty', generated
%% on <1993/2/17> with the docstrip utility (2.0r).
%%
%% The original source files were:
%%
%% xcomment.doc
%%
\def\fileversion{1.2}
\def\filedate{93/02/12}
%%
%% Style option `xcomment' for use with LaTeX v2.09.
%% This is a style for comment and "inverse" comment environments.
%%
%% COPYRIGHT 1992, 1993 by Timothy Van Zandt, Timothy.VAN-ZANDT@insead.edu
%%
%% Input file: xcomment.sty.
%% Documented code: xcomment.doc.
%% For printing documentation: xcomment.tex.
%%
%% You may find xcomment.doc and xcomment.tex appended to xcomment.sty.
%%
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version. The latest version of this
%% license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%%
%%
\@ifundefined{xcomment@@@}{}{\endinput}
\typeout{Style-Option: `xcomment' v\fileversion \space <\filedate> (tvz) }
\def\newxcomment{\@ifnextchar [{\@newxcommentwitharg}%
{\@newxcomment}}
\def\@newxcomment#1{%
\expandafter\def\csname #1\endcsname##1{\@xcomment{#1}{##1}}}%
\def\@newxcommentwitharg[#1]#2{%
\expandafter\def\csname #2\endcsname{\@xcomment{#2}{#1}}}
\newxcomment{xcomment}
\def\envirsep{\par}
\def\rescanfile#1{\def\@rescanfile{#1}}
\rescanfile{\jobname.tmp}
\def\norescanfile{\let\@rescanfile\relax}
\def\@nofloat#1{\hrule height\z@\nobreak\vfill\vbox\bgroup\def\@captype{#1}}
\def\end@nofloat{\egroup\nobreak\vfill\nobreak\hrule height\z@\medbreak}
\def\nofloat#1{\@for\@tempa:=#1\do{\@namedef{#1}{\@nofloat{#1}}%
\@namedef{end#1}{\end@nofloat}}}
\def\xc@makeother#1{%
\ifnum\the\catcode`#1=0\catcode`#112%
\else \ifnum\the\catcode`#1=1\catcode`#112%
\else \ifnum\the\catcode`#1=2\catcode`#112%
\else \ifnum\the\catcode`#1=6\catcode`#112%
\fi\fi\fi\fi\relax}
\newwrite\tokout
\newread\tokin
\def\rescan#1{%
\ifx\@rescanfile\relax\else
\ifx\@rescanfile\@empty #1{}\else
\immediate\openout\tokout=\@rescanfile
\immediate\write\tokout{{\the#1}\relax}%
\immediate\closeout\tokout
\openin\tokin=\@rescanfile
\read\tokin to\@tempd
\closein\tokin
\expandafter#1\@tempd%
\fi\fi}
\def\@xcomment#1#2{%
\ifx\@preamblecmds\@notprerr
\def\xc@csname{#1}%
\edef\xc@envirlist{#2}%
\ifx\xc@envirlist\@empty \@bsphack \else
\begingroup
\def\@envirsep{}%
\@ifundefined{normal@begin}{\let\normal@begin\begin}{}%
\@ifundefined{normal@end}{\let\normal@end\end}{}%
\def\begin##1{\do@begin{##1}\normal@begin{##1}}%
\def\end##1{\normal@end{##1}\do@end}%
\def\do@begin##1{\@ifundefined{##1}{}{\def\do@end{}}}%
\let\do@end\xc@begin
\fi
\let\next\xc@begin
\else
\expandafter\@temptokena\expandafter{\document\@xcomment{@@@}{#2}}%
\edef\document{\the\@temptokena}%
\let\next\relax
\fi
\next}
\def\end@xcomment{\ifx\xc@envirlist\@empty \@esphack \else \endgroup \fi}%
\def\xc@begin{%
\begingroup
\let\do\xc@makeother
\dospecials
\ifx\xcommentchar\@empty\else
\expandafter\catcode\expandafter`\xcommentchar=14
\fi
\catcode`\^^M\active
\xcomment@}
\def\xcommentchar{\%}
\begingroup
\catcode`\!=12
\catcode`\[=12
\catcode`\]=12
\catcode`\"=12
\lccode`\!=`\\
\lccode`\[=`\{
\lccode`\]=`\}
\lccode`\"=`\%
\catcode`\~=\active
\lccode`\~=`\^^M
\lowercase{
\gdef\xcomment@#1~{\xcomment@@#1\@nnil!\@nil}
\gdef\xcomment@@#1!{\xcomment@@@}
\gdef\xcomment@@@#1\@nil{%
\def\@tempa{#1}%
\ifx\@tempa\@empty
\let\next\xcomment@
\else
\def\next{\xcomment@@#1\@nil}%
\@testtrue
\xc@checkbegin#1\relax begin[]\relax\relax
\if@test
\xc@checkend#1\relax end[]\relax\relax
\if@test
\xc@checkinput#1\relax input[]\relax\relax
\if@test
\xc@checkinclude#1\relax include[]\relax\relax
\if@test
\xc@checkendinput#1\relax endinputss\relax\relax
\fi\fi\fi\fi\fi
\next}
\gdef\xc@checkbegin#1begin[#2]#3\relax#4\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty
\def\@tempa{#2}%
\@for\@tempb:=\xc@envirlist\do{%
\ifx\@tempa\@tempb\def\next{\xc@end{#2}#3\@nil}\fi}%
\fi}
\gdef\xc@checkend#1end[#2]#3\relax#4\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty
\@testfalse
\def\@tempa{#2}\def\@tempb{document}%
\ifx\@tempa\@tempb
\def\next{\endgroup\end@xcomment\end{document}}%
\else
\ifx\@tempa\xc@csname
\def\next{\end@@xcomment{#2}#3\@nil}%
\fi\fi\fi}
\gdef\xc@checkinput#1input[#2]#3\relax#4\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty
\def\next{\expandafter\xcomment@\@@input #2 \xcomment@@#3\@nil}%
\@testfalse
\fi}
\gdef\xc@checkendinput#1endinput#2#3\relax#4\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty\ifcat\noexpand#2a\relax\else
\let\next\endinput
\fi\fi}
\gdef\xc@checkinclude#1include[#2]#3\relax#4\relax{%
\def\@tempa{#1}%
\ifx\@tempa\@empty
\def\next{%
\global\let\xc@savedinput\@@input
\def\@@input{%
\global\let\@@input\xc@savedinput
\expandafter\xcomment@\@@input}%
\include{#2}%
\global\let\@@input\xc@savedinput
\xcomment@@#3\@nil}%
\@testfalse
\fi}
\gdef\end@@xcomment#1#2\@nnil!\@nil{%
\endgroup
\toks@{#2 }\rescan{\toks@}%
\edef\next{\noexpand\end@xcomment\noexpand\end{#1}\the\toks@}%
\next}%
\gdef\xc@end#1#2\@nnil!\@nil{%
\endgroup
\@envirsep \let\@envirsep\envirsep
\toks@{#2 }\rescan{\toks@}%
\edef\next{\noexpand\normal@begin{#1}\the\toks@}%
\next}%
}% END OF LOWERCASE
\endgroup
\endinput
%%
%% End of file `xcomment.sty'.
|