blob: c6d8f480597f1a76dfe8a7a6bd396be6f1b340b9 (
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
%%
%% This is file `intex.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% intex.dtx (with options: `intex')
%%
%% This is a generated file.
%%
%% Copyright (C) 2005--2008 by Martin Thorsen Ranang <mtr@ranang.org>
%%
%% 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.
%%
\def\filename{intex}%
\ProvidesPackage{intex}[2008/10/13 v1.1
Support for concept, acronym, and proper-name typesetting and indexing]%
\newif\if@itx@index%
\@itx@indextrue%
\DeclareOption{noindex}{\@itx@indexfalse}%
\newif\if@itx@warn@undef%
\@itx@warn@undeftrue%
\DeclareOption{nowarnundef}{\@itx@warn@undeffalse}%
\newif\if@itx@margin@plain%
\newif\if@itx@margin@acronym%
\newif\if@itx@margin@person%
\@itx@margin@plaintrue%
\@itx@margin@acronymtrue%
\@itx@margin@persontrue%
\DeclareOption{nomarginplain}{\@itx@margin@plainfalse}%
\DeclareOption{nomarginacronym}{\@itx@margin@acronymfalse}%
\DeclareOption{nomarginperson}{\@itx@margin@personfalse}%
\ProcessOptions%
\if@itx@index%
\RequirePackage{index}%
\makeindex%
\newindex{raw}{rix}{rid}{Index}%
\else%
\def\@nearverbatim{\expandafter\strip@prefix\meaning}%
\fi%
\if@itx@margin@plain%
\RequirePackage{marginnote}[2006/10/26]%
\fi%
\if@itx@margin@acronym%
\RequirePackage{marginnote}[2006/10/26]%
\fi%
\if@itx@margin@person%
\RequirePackage{marginnote}[2006/10/26]%
\fi%
\RequirePackage{acronym}[2008/05/28]%
\RequirePackage{ifthen}%
\newcommand*{\InTeX}{\textsl{In}\kern-.07em\TeX}%
\newcommand\itxplaindeffont[1]{\emph{#1}}%
\newcommand\itxplainfollowfont[1]{#1}%
\newcounter{itxpl}%
\newcommand\@itxbasemarginfont[1]{%
\stepcounter{itxpl}%
\ifthenelse{\isodd{\pageref{itxpl-\theitxpl}}}{%
\raggedright\hspace{0pt}\footnotesize\textsf{#1}% odd
}{%
\raggedleft\hspace{0pt}\footnotesize\textsf{#1}% even
}%
\label{itxpl-\theitxpl}%
}%
\newcommand\itxplainmarginfont[1]{%
\@itxbasemarginfont{#1}%
}%
\newcommand{\itxacronymdeffont}[1]{#1}%
\newcommand{\itxacronymdefshortfont}[1]{\emph{#1}}%
\newcommand{\itxacronymshortfont}[1]{#1}%
\newcommand{\itxacronymmarginfont}[1]{%
\@itxbasemarginfont{#1}%
%\raggedleft\hspace{0pt}\footnotesize\textsf{#1}%
}%
\newcommand{\itxpersondeffont}[1]{\emph{#1}}%
\newcommand{\itxpersonfirstfont}[1]{#1}%
\newcommand{\itxpersonlastfont}[1]{#1}%
\newcommand{\itxpersonmarginfont}[1]{%
\@itxbasemarginfont{#1}%
%\raggedleft\hspace{0pt}\footnotesize\textsf{#1}%
}%
\newcounter{co@serial}%
\newcounter{co@type}%
\newcommand*\itxundefcomment[1]{\emph{(undefined concept ``#1'')}}%
\long\def\@firstofthree#1#2#3{#1}%
\long\def\@secondofthree#1#2#3{#2}%
\def\ITX@reset#1{%
\global\expandafter\let\csname itx@#1\endcsname\relax}%
\newcommand*\@itxmarginlabel[2]{%
\hspace{0pt}%
\ifcase#1%
% \ldots plain concept, \ldots
\if@itx@margin@plain%
\marginpar{\itxplainmarginfont{\ITX@itxs{#1}{#2}}}%
%\marginnote{\itxplainmarginfont{\ITX@itxs{#1}{#2}}}%
\fi%
\or%
% \ldots an acronym, \ldots
\if@itx@margin@acronym%
\marginpar{\itxacronymmarginfont{\ITX@itxs{#1}{#2}}}%
\fi%
\or%
% \ldots or a person's name.
\if@itx@margin@person%
\marginpar{\itxpersonmarginfont{\ITX@itxl{#1}{#2}}}%
\fi%
\fi%
}%
\newcommand*\ITX@used{@<>@<>@}%
\newcommand*\ITX@get[2]{%
\ifx#1\relax%
\else%
\expandafter#2#1%
\fi%
}%
\newcommand*\itxplainarea{\thesubparagraph:\thepage}%
\newcommand*\itxacronymarea{\thechapter}%
\newcommand*\itxpersonarea{\thesubsubsection}%
\newcommand*\@itxarea[1]{%
\ifcase#1%
{\itxplainarea}%
\or%
{\itxacronymarea}%
\or%
{\itxpersonarea}%
\fi%
}%
\def\itx@last@pos0{}%
\def\itx@last@pos1{}%
\def\itx@last@pos2{}%
\newcommand*\ITX@itxs[2]{%
\csname fnss@\number#2\endcsname%
}%
\newcommand*\ITX@itxl[2]{%
\csname fnsl@\number#2\endcsname%
}%
\newcommand*{\itxs}[2]{%
\texorpdfstring{\protect\@itxs{#1}{#2}}{#1}}%
\newcommand*{\@itxs}[2]{%
\ifcase\number#1%
\itxplainfollowfont{\ITX@itxs{#1}{#2}}%
\or%
\itxacronymshortfont{\ITX@itxs{#1}{#2}}%
\or%
\itxpersonlastfont{\ITX@itxl{#1}{#2}}%
\fi%
}%
\newcommand*{\itxl}{\protect\@itxl}%
\newcommand*{\@itxl}[2]{%
%\ITX@itxl{#1}{#2}%
\ifcase\number#1%
\itxplainfollowfont{\ITX@itxs{#1}{#2}}\nolinebreak %
\or%
\itxacronymdeffont{\ITX@itxl{#1}{#2}}%
\or%
\itxpersondeffont{%
\itxpersonfirstfont{\ITX@itxs{#1}{#2}} %
%\nolinebreak[3] %
\itxpersonlastfont{\ITX@itxl{#1}{#2}}%
}%
\fi%
}%
\newcommand*{\itxf}[2]{%
\texorpdfstring{\protect\@itxf{#1}{#2}}{\ITX@itxl{#1}{#2} (#1)}%
}%
\newcommand*{\@itxf}[2]{%
\ifcase\number#1%
\@itxmarginlabel{#1}{#2}%
\itxplaindeffont{\ITX@itxs{#1}{#2}}\nolinebreak %
\or%
\itxacronymdeffont{%
\ITX@itxl{#1}{#2} %
%\nolinebreak[3] %
\@itxmarginlabel{#1}{#2}%
\itxacronymdefshortfont{%
\itxacronymshortfont{(\ITX@itxs{#1}{#2})}}%
}%
\or%
\itxpersondeffont{%
\itxpersonfirstfont{%
\ITX@itxs{#1}{#2}} %
%\nolinebreak[3] %
\@itxmarginlabel{#1}{#2}%
\itxpersonlastfont{%
\ITX@itxl{#1}{#2}%
}%
}%
\fi%
\expandafter\ifx\csname itx@#2\endcsname\ITX@used%
%\relax%
\else%
\global\expandafter\let\csname itx@#2\endcsname\ITX@used%
%\ITX@addtoclearlist{#2}% MTR
\fi%
%\ITX@logged{#2} MTR
}%
\newcommand*{\@itxrecordarea}[2]{%
% Record this area:
\edef\curr@pos{\@itxarea{#1}}%
%\PackageWarning{InTeX}{Current position for type "#1" is "\curr@pos"}%
% Remember the last area where this concept (second argument) was used.
\edef\last@pos{\csname itx@last@pos#1@#2\endcsname}%
\ifx\curr@pos\last@pos%
% We're still in the same area. Hence, we do nothing.
\else%
% The area has changed.
\ITX@reset{#2}%
\fi%
\expandafter\xdef\csname itx@last@pos#1@#2\endcsname{\curr@pos}%
}%
\newcommand\@itx@init@nonbookmode{%
\newcommand*{\@itxtypeset}[3]{% Article-mode.
\ifx##3A%
%\PackageWarning{InTeX}{Typesetting format is automatic}%
\expandafter\ifx\csname itx@##2\endcsname\ITX@used%
\itxs{##1}{##2}%
\else%
\itxf{##1}{##2}%
\fi%
\else%
%\PackageWarning{InTeX}{Typesetting format = "##3"}%
\ifx##3S\itxs{##1}{##2}\fi%
\ifx##3L\itxl{##1}{##2}\fi%
\ifx##3F\itxf{##1}{##2}\fi%
\fi%
}%
}%
\newcommand\@itx@init@bookmode{%
\PackageInfo{InTeX}{Adjusting behavior to suite book/report document
classes\@gobble}%
\newcommand*{\@itxtypeset}[3]{% Book/report-mode.
\ifx##3A%
%\PackageWarning{InTeX}{Typesetting format is automatic}%
\if@mainmatter%
\expandafter\ifx\csname itx@##2\endcsname\ITX@used%
\itxs{##1}{##2}%
\else%
\itxf{##1}{##2}%
\fi%
\else%
\itxl{##1}{##2}%
\fi%
\else%
%\PackageWarning{InTeX}{Typesetting format = "##3"}%
\ifx##3S\itxs{##1}{##2}\fi%
\ifx##3L\itxl{##1}{##2}\fi%
\ifx##3F\itxf{##1}{##2}\fi%
\fi%
}%
}
\newif\if@itx@bookmode%
\@itx@bookmodetrue%
\@ifclassloaded{article}{%
\PackageInfo{InTeX}{Adjusting behavior to suite the article document
class\@gobble}%
\@itx@init@nonbookmode%
\@itx@bookmodefalse%
}{}%
\@ifclassloaded{beamer}{%
\PackageInfo{InTeX}{Adjusting behavior to suite the beamer document
class\@gobble}%
\@itx@init@nonbookmode%
\@itx@bookmodefalse%
\renewcommand*\itxacronymarea{0}%
\@itx@margin@plainfalse%
\@itx@margin@acronymfalse%
\@itx@margin@personfalse%
}{}%
\if@itx@bookmode%
\@itx@init@bookmode%
\fi%
\newcommand*{\@itxplain}[3]{%
\@itxrecordarea{#1}{#2}%
\@itxtypeset{#1}{#2}{#3}%
}%
\newcommand*{\@itxalias}[2]{%
\edef\@mainserial{\expandafter\@firstoftwo#2}%
\edef\@equivserial{\expandafter\@secondoftwo#2}%
%\@itxrecordarea{#1}{\@mainserial}%
\@itxplain{#1}{\@equivserial}%
}%
\newcommand{\@itx@fakeindex}[1]{%
\begingroup%
\edef\@tempa{%
\write\@auxout{%
\string\@writefile{raw}{%
\string\indexentry{#1}{\thepage}%
}%
}%
}%
\expandafter\endgroup\@tempa%
}%
\newcommand{\co}{\@itx}%
\newcommand{\coS}[1]{\@itx[S]{#1}}%
\newcommand{\coL}[1]{\@itx[L]{#1}}%
\newcommand{\coF}[1]{\@itx[F]{#1}}%
\DeclareRobustCommand*{\@itx}[2][A]{%
\def\@tempa{#2}%
\edef\@tempb{\@nearverbatim\@tempa}%
\if@itx@index%
\index[raw]{#2}%
\else%
\@itx@fakeindex{\@tempb}%
\fi%
\newif\iffound%
\setcounter{co@type}{0}%
\loop\ifnum\theco@type<3%
\expandafter\ifx\csname fn\number\theco@type e@\@tempb\endcsname\relax%
\expandafter\ifx\csname fn\number\theco@type @\@tempb\endcsname\relax%
% \PackageWarning{InTeX}{Main AND alias reference `#2' occurred}%
% The reference refers to both main _and_ alias entries. Do
% nothing, this will be resolved through the |else|-cases
% immediately below.
\else%
%\PackageInfo{InTeX}{Main reference `#2' occurred}%
\edef\co@id{\csname fn\number\theco@type @\@tempb\endcsname}%
\@itxplain{\number\theco@type}{\co@id}{#1}%
\foundtrue%
\fi%
\fi%
\stepcounter{co@type}%
\repeat%
\iffound%
\else%
\PackageWarning{InTeX}{Reference `#2' to undefined concept}%
\if@itx@warn@undef%
\textbf{\itxundefcomment{#2}}%
\else%
#2%
\fi%
\fi%
}%
\newcommand*{\personused}[1]{%
\expandafter\ifx\csname pnused@#1\endcsname\PN@used%
\relax%
\else%
\global\expandafter\let\csname pnused@#1\endcsname\PN@used%
\global\let\PN@populated\PN@used%
\fi%
}%
\newcommand\@itxdefineforms[3]{%
\expandafter\gdef\csname fnss@\number#1\endcsname{#2}%
\expandafter\gdef\csname fnsl@\number#1\endcsname{#3}%
}%
\newcommand\@newentry[4]{%
\def\@tempa{#2}%
\edef\@tempb{\@nearverbatim\@tempa}%
%
\stepcounter{co@serial}%
%\PackageWarning{init}{serial counter = \expandafter\theco@serial}%
\expandafter\xdef\csname fn\number#1@\@tempb\endcsname{%
\number\theco@serial}%
%\PackageWarning{init}{Def: \meaning\csname fn\number#1@\@tempb\endcsname}%
\@itxdefineforms{\theco@serial}{#3}{#4}%
}%
\newcommand*\newconcept[3]{%
\@newentry{0}{#1}{#2}{#3}%
}%
\newcommand*\newacronym[3]{%
\@newentry{1}{#1}{#2}{#3}%
}%
\newcommand*\newperson[3]{%
\@newentry{2}{#1}{#2}{#3}%
}%
\newcommand*\@newentryequiv[5]{%
\newif\iffound%
\def\@tempa{#2}%
\edef\@tempb{\@nearverbatim\@tempa}%
\expandafter\ifx\csname fn\number#1 @\@tempb\endcsname\relax%
\else%
\foundtrue%
\edef\co@id{\csname fn\number#1@\@tempb\endcsname}%
%\PackageWarning{init}{Found `\@tempb' (type=\number#1, serial=\co@id)}%
\stepcounter{co@serial}%
\@itxdefineforms{\theco@serial}{#3}{#5}%
\def\@tempa{#4}%
\edef\@tempb{\@nearverbatim\@tempa}%
\expandafter\xdef\csname fn\number#1 e@\@tempb\endcsname{%
{\co@id}{\theco@serial}}%
\fi%
\iffound%
\else%
%\PackageWarning{InTeX}{Can't find `#2' for sub-concept `#3'}%
\fi%
}%
\newcommand*\newconceptequiv[4]{%
\@newentryequiv{0}{#1}{#2}{#3}{#4}%
}%
\newcommand*\newacronymequiv[4]{%
\@newentryequiv{1}{#1}{#2}{#3}{#4}%
}%
\newcommand*\newpersonequiv[4]{%
\@newentryequiv{2}{#1}{#2}{#3}{#4}%
}%
\AtBeginDocument{\@input{\jobname.ito}}%
\endinput%
\endinput
%%
%% End of file `intex.sty'.
|