summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/lcustom.tex
blob: c76a75ad8e730296dc0b1c73a07d9aa01b6544ff (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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
% LaTeX customization
 
 
\makeatletter				% for a little while
 
\def\inputverbatim#1{%
\begingroup \catcode``=13 \@noligs \tt \let\do\@makeother \dospecials
\obeylines \obeyspaces \frenchspacing \input #1 \endgroup }
 
% plain TeX compatibility
 
\def\oldstyle{\xdef\@oldstyle{\the\textfont\@ne}\mit\@oldstyle}
 
 
% PhD-TeX compatibility
 
\def\showsummary{%
    \begingroup
	\def\note##1{%
	    \ifcase\value{##1}no ##1s\or
		1 ##1\else
		\the\value{##1} ##1s\fi
	}%
	\typeout{LaTeX summary: \note{figure}, \note{table}, \note{footnote}.}%
    \endgroup
}
 
\def\smaller{\footnotesize}
 
 
% Float Support
 
\def\topfraction{0.85}
\def\textfraction{0.20}
\def\floatpagefraction{0.85}
\def\dbltopfraction{0.85}
\def\dblfloatpagefraction{0.85}
 
 
% \tagfigure*[FLOAT]{FILE}{CAPTION}{LABEL}
%    *		optional
%    FLOAT	float options
%    FILE	reads TPIC output in file figureFILE
%    CAPTION	for list of figures
%    LABEL	for \ref and \pageref
\def\tagfigure{\@ifstar{\@stagfigure}{\@tagfigure}}
\def\@tagfigure{\@ifnextchar[{\@@tagfigure}{\@@tagfigure[t]}}
\def\@stagfigure{\@ifnextchar[{\@@stagfigure}{\@@stagfigure[t]}}
 
\def\@@tagfigure[#1]#2{%
    \@@@tagfigure[#1]{\input figure#2\relax\centerline{\box\graph}}}
\def\@@stagfigure[#1]#2{%
    \@@@stagfigure[#1]{\input figure#2\relax\centerline{\box\graph}}}
 
 
% \tagdiagram*[FLOAT]{FILE}{CAPTION}{LABEL}
%    *		optional
%    FLOAT	float options
%    FILE	reads LaTeX input in file diagramFILE
%    CAPTION	for list of figures
%    LABEL	for \ref and \pageref
\def\tagdiagram{\@ifstar{\@stagdiagram}{\@tagdiagram}}
\def\@tagdiagram{\@ifnextchar[{\@@tagdiagram}{\@@tagdiagram[t]}}
\def\@stagdiagram{\@ifnextchar[{\@@stagdiagram}{\@@stagdiagram[t]}}
 
\def\@@tagdiagram[#1]#2{\@@@tagfigure[#1]{\input diagram#2\relax}}
\def\@@stagdiagram[#1]#2{\@@@stagfigure[#1]{\input diagram#2\relax}}
 
 
% \tagverbatim*[FLOAT]{FILE}{CAPTION}{LABEL}
%    *		optional
%    FLOAT	float options
%    FILE	reads LaTeX input in file FILE and inserts in in verbatim mode.
%    CAPTION	for list of figures
%    LABEL	for \ref and \pageref
\def\tagverbatim{\@ifstar{\@stagverbatim}{\@tagverbatim}}
\def\@tagverbatim{\@ifnextchar[{\@@tagverbatim}{\@@tagverbatim[t]}}
\def\@stagverbatim{\@ifnextchar[{\@@stagverbatim}{\@@stagverbatim[t]}}
 
\def\@@tagverbatim[#1]#2{\@@@tagfigure[#1]{\inputverbatim{#2}}}
\def\@@stagverbatim[#1]#2{\@@@stagfigure[#1]{\inputverbatim{#2}}}
 
 
\def\@@@tagfigure[#1]#2#3#4{%
    \begin{figure}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\columnwidth
	    \small#2%
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{figure}
}
 
\def\@@@stagfigure[#1]#2#3#4{%
    \begin{figure*}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\textwidth
	    \small#2%
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{figure*}
}
 
 
% \tagtable*[FLOAT]{FILE}{CAPTION}{LABEL}
%    *		optional
%    FILE	read LaTeX input in file tableFILE
%    FLOAT	float options
%    CAPTION	for list of tables
%    LABEL	for \ref and \pageref
\def\tagtable{\@ifstar{\@stagtable}{\@tagtable}}
\def\@tagtable{\@ifnextchar[{\@@tagtable}{\@@tagtable[t]}}
\def\@stagtable{\@ifnextchar[{\@@stagtable}{\@@stagtable[t]}}
 
\def\@@tagtable[#1]#2#3#4{%
    \begin{table}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\textwidth
	    \small\input table#2\relax
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{table}
}
 
\def\@@stagtable[#1]#2#3#4{%
    \begin{table*}[#1]
	\hrule
	\vskip .5\baselineskip
	\begin{minipage}\columnwidth
	    \small\input table#2\relax
	\end{minipage}
	\vskip .5\baselineskip plus .5\baselineskip
	\begingroup
	    \setbox\z@=\hbox{#4}%
	    \ifdim\wd\z@>\z@
		\caption{#3}%
		\label{#4}%
	    \else
		\captcont{#3}%
	    \fi
	\endgroup
	\vskip 2pt
	\hrule
    \end{table*}
}
 
 
% Environments:
 
% DESCRIBE - similar to DESCRIPTION, but indents extra on left margin of
%	outer list
 
\def\describe{\list{}{\labelwidth\z@ \itemindent-\leftmargin
	\ifnum\@listdepth=1 \advance\leftmargin by2em\fi
	\let\makelabel\descriptionlabel}}
\let\enddescribe=\endlist
 
 
% Document style options:
%	     10pt - Makes ten-point type the normal (default) type size
%	draftnote - Customized draft option
 
\@namedef{ds@10pt}{\def\@ptsize{0}}	%%% for orthogonality
 
 
\newif\ifdraft	\draftfalse
 
\def\draftstring{{\ifdraft \tt Draft\fi}}
 
\def\draftext{%
    \ifdraft
	\begingroup
	    \tt
	    \ifodd\c@page
		\LaTeX set \today\ with \fmtname\ v\fmtversion
	    \else
		Draft \versiontag/ of \versiondate/
	    \fi
	\endgroup
    \fi
}
 
\def\ds@draftnote{%
    \drafttrue
    \@ifundefined{ds@draft}{}{\ds@draft}%
    \def\ps@plain{%
	\let\@mkboth=\@gobbletwo
	\def\@oddhead{\draftext\hfil}%
	\def\@oddfoot{\draftstring\hfil\rm\thepage\hfil\draftstring}%
	\def\@evenhead{\hfil\draftext}%
	\let\@evenfoot=\@oddfoot
    }%
    \let\ps@@headings=\ps@headings
    \def\ps@headings{%
	\ps@@headings
	\def\@oddfoot{\draftext\hfil}%
	\def\@evenfoot{\hfil\draftext}%
     }%
}
 
 
% Page Styles
 
% \pagestyle{myfootings} similar to the myheadings command but also permits
% the user to define foot information as well as head information
%	\markleftfoot{left_foot}	specifies the foot for odd-numbered
%					pages
%	\markrightfoot{right_foot}	specifies the foot for even-numbered
%					pages
% N.B.	DOES NOT USE MARKS TO ACCOMPLISH THIS, OWING TO CONFLICT WITH HEADING
%	ROUTINES
 
\def\ps@myfootings{\ps@myheadings}
 
\def\markleftfoot#1{\def\@evenfoot{\hbox{}\sl#1\hfil}}
\def\markrightfoot#1{\def\@oddfoot{\hfil\sl#1\hbox{}}}
 
 
% \pagestyle{reprint} similar to plain page style in draft mode
 
\let\reprintext=\draftext
\let\reprintstring=\draftstring
 
\def\ps@reprint{%
    \def\draftext{%
	\ifdraft
	    \begingroup
		\tt
		\ifodd\c@page
		    \LaTeX set \today
		\else
		    Draft \versiontag/
		\fi
	    \endgroup
	\fi
    }%
    \def\@oddhead{\reprintext\hfil\draftext}%
    \def\@oddfoot{\reprintstring\hfil\rm\thepage}%
    \def\@evenhead{\draftext\hfil\reprintext}%
    \def\@evenfoot{\rm\thepage\hfil\reprintstring}%
}
 
 
% The Title
 
\def\title#1{%
    \gdef\@title{#1}%
    \gdef\banner{%
	\newpage\setcounter{page}{1}%
	\begin{center}\Large#1\end{center}%
    }%
}
 
 
% Miscellany
 
\def\implies{\quad\supset\ }
 
\def\tdots{\ldots\thinspace}
 
\def\boxit#1{\fbox{\sc#1}}
 
\def\note#1{\ifdraft\marginpar{\tt#1}\fi}
 
 
% Fractions (from The TUGboat v6 n1, 1985)
 
\def\myfrac#1/#2{%
    \leavevmode\kern.1em
    \raise.5ex\mbox{\the\scriptfont\z@ #1}\kern-.1em
    /\kern-.15em\lower.25ex\mbox{\the\scriptfont\z@ #2}%
}
 
 
% Trademarks...
 
\input trademark.sty
 
 
% Continuation Captions...
 
\input captcont.sty
 
 
% Startup
 
\xdef\today{%
    \ifcase\month
	\number\month\or
	January\or February\or March\or April\or May\or June\or
	July\or August\or September\or October\or November\or December\else
	\number\month\fi
    \space\number\day, {\noexpand\mit\number\year}%
}
 
\begingroup
    \count0=\time
    \count1=\count0
    \divide\count0 by 60
    \count2=\count0
    \multiply\count0 by 60
    \advance\count1 by -\count0
    \ifnum\count2>11
	\ifnum\count2>12 \advance\count2 by -12\fi
	\def\ampm{pm}%
    \else
	\ifnum\count2=0 \advance\count2 by 12\fi
	\def\ampm{am}%
    \fi
    \xdef\daytime{%
	\ifnum\count2<10 0\fi \the\count2:%
	\ifnum\count1<10 0\fi \the\count1
	\ampm
    }%
\endgroup
 
 
\makeatother				% back to normal
 
%
%Mail-From: BEEBE created at  3-Dec-86 11:41:39
%Date: Wed 3 Dec 86 11:41:39-MST
%From: "Nelson H.F. Beebe" <Beebe@UTAH-SCIENCE.ARPA>
%Subject: Funny behaviour of itemize with long item keys
%To: jrp%nplpsg%uucp@CS.UCL.AC.UK
%cc: BEEBE@UTAH-SCIENCE.ARPA
%X-US-Mail: "Center for Scientific Computation, South Physics,
%University of Utah, Salt Lake City, UT 84112"
%X-Telephone: (801) 581-5254
%Message-ID: <12259892637.20.BEEBE@UTAH-SCIENCE.ARPA>
%ReSent-Date: Wed 3 Dec 86 16:31:14-MST
%ReSent-From: "Nelson H.F. Beebe" <Beebe@UTAH-SCIENCE.ARPA>
%ReSent-To: jrp%nplpsg%uucp@SEISMO.CSS.GOV
%ReSent-Message-ID: <12259945355.20.BEEBE@UTAH-SCIENCE.ARPA>
%
%In TeXHaX #10 you ask for a solution for the itemize
%environment where long keys do not cause a line break, when
%they would look nicer if they did.
%
%I met this problem in writing my TECO manual, and here is my
%solution.  First, I have two environments:
%
%% ======================================================================
%% commandtable generates a list with the item entered into the index
%% and the item label flush left in \tt font.  It is intended for
%% documenting TECO commands.
%\newcommand{\tablelabel}[1]{\mbox{\tt#1}\hfil\INDEX{{\string\tt\space #1}}{#1}}
%\newenvironment{commandtable}{
%    \begin{list}{}
%    {
%      \let\makelabel\tablelabel
%      \setlength{\labelwidth}{30pt}
%      \setlength{\leftmargin}{1.1\labelwidth}
%    }
%  }{\end{list}}
%
%% ======================================================================
%% commandentry generates a list with the item label flush left in \sf
%% font.  It is intended for the TECO command descriptions.
%
%\newcommand{\entrylabel}[1]{\mbox{\sf#1:}\hfil}
%\newenvironment{commandentry}{
%    \begin{list}{}
%    {
%      \let\makelabel\entrylabel
%      \setlength{\labelwidth}{40pt}
%      \setlength{\leftmargin}{1.1\labelwidth}
%    }
%  }{\end{list}}
%
%Then I have a newline macro:
%\newcommand{\NEWLINE}{\mbox{}\\ \vspace*{-\baselineskip}}
%
%Here is how they are used:
% \begin{commandtable}
% \item[\protect\CTL{\BS{}}]\NEWLINE{}
%	\begin{commandentry}
%        \item[Action]
%		Returns from a function.  If issued at top-level,
%		the interpreter simply terminates, just as if
%		end of input had been reached.
%        \item[Errors]
%		None.
%        \item[Return values]
%		Any arguments in effect are passed back to the
%		caller.
%        \end{commandentry}
% ...etc...
% \end{commandtable}
%
%The other two macros listed are unimportant, but here they are:
%\newcommand{\BS}{{\tt\symbol{92}}}      % ASCII backslash
%\newcommand{\NEWLINE}{\mbox{}\\ \vspace*{-\baselineskip}}