]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/papers/mh6.5/lcustom.tex
Tweaked check of -outfile in test-mhstore.
[nmh] / docs / historical / mh-6.8.5 / papers / mh6.5 / lcustom.tex
1 % LaTeX customization
2
3
4 \makeatletter % for a little while
5
6
7 % plain TeX compatibility
8
9 \def\oldstyle{\xdef\@oldstyle{\the\textfont\@ne}\mit\@oldstyle}
10
11
12 % PhD-TeX compatibility
13
14 \def\showsummary{%
15 \begingroup
16 \def\note##1{%
17 \ifcase\value{##1}no ##1s\or
18 1 ##1\else
19 \the\value{##1} ##1s\fi
20 }%
21 \typeout{LaTeX summary: \note{figure}, \note{table}, \note{footnote}.}%
22 \endgroup
23 }
24
25 \def\smaller{\footnotesize}
26
27
28 % Float Support
29
30 % \tagfigure*[FLOAT]{FILE}{CAPTION}{LABEL}
31 % * optional
32 % FLOAT float options
33 % FILE reads TPIC output in file figureFILE
34 % CAPTION for list of figures
35 % LABEL for \ref and \pageref
36 \def\tagfigure{\@ifstar{\@stagfigure}{\@tagfigure}}
37 \def\@tagfigure{\@ifnextchar[{\@@tagfigure}{\@@tagfigure[t]}}
38 \def\@stagfigure{\@ifnextchar[{\@@stagfigure}{\@@stagfigure[t]}}
39
40 \def\@@tagfigure[#1]#2{%
41 \@@@tagfigure[#1]{\input figure#2\relax\centerline{\box\graph}}}
42 \def\@@stagfigure[#1]#2{%
43 \@@@stagfigure[#1]{\input figure#2\relax\centerline{\box\graph}}}
44
45
46 % \tagdiagram*[FLOAT]{FILE}{CAPTION}{LABEL}
47 % * optional
48 % FLOAT float options
49 % FILE reads LaTeX input in file diagramFILE
50 % CAPTION for list of figures
51 % LABEL for \ref and \pageref
52 \def\tagdiagram{\@ifstar{\@stagdiagram}{\@tagdiagram}}
53 \def\@tagdiagram{\@ifnextchar[{\@@tagdiagram}{\@@tagdiagram[t]}}
54 \def\@stagdiagram{\@ifnextchar[{\@@stagdiagram}{\@@stagdiagram[t]}}
55
56 \def\@@tagdiagram[#1]#2{\@@@tagfigure[#1]{\input diagram#2\relax}}
57 \def\@@stagdiagram[#1]#2{\@@@stagfigure[#1]{\input diagram#2\relax}}
58
59 \def\@@@tagfigure[#1]#2#3#4{%
60 \begin{figure}[#1]
61 \hrule
62 \vskip .5\baselineskip
63 \begin{minipage}\columnwidth
64 \small#2%
65 \end{minipage}
66 \vskip .5\baselineskip plus .5\baselineskip
67 \caption{#3}%
68 \label{#4}%
69 \vskip 2pt
70 \hrule
71 \end{figure}
72 }
73
74 \def\@@@stagfigure[#1]#2#3#4{%
75 \begin{figure*}[#1]
76 \hrule
77 \vskip .5\baselineskip
78 \begin{minipage}\textwidth
79 \small#2%
80 \end{minipage}
81 \vskip .5\baselineskip plus .5\baselineskip
82 \caption{#3}%
83 \label{#4}%
84 \vskip 2pt
85 \hrule
86 \end{figure*}
87 }
88
89
90 % \tagtable*[FLOAT]{FILE}{CAPTION}{LABEL}
91 % * optional
92 % FILE read LaTeX input in file tableFILE
93 % FLOAT float options
94 % CAPTION for list of tables
95 % LABEL for \ref and \pageref
96 \def\tagtable{\@ifstar{\@stagtable}{\@tagtable}}
97 \def\@tagtable{\@ifnextchar[{\@@tagtable}{\@@tagtable[t]}}
98 \def\@stagtable{\@ifnextchar[{\@@stagtable}{\@@stagtable[t]}}
99
100 \def\@@tagtable[#1]#2#3#4{%
101 \begin{table}[#1]
102 \hrule
103 \vskip .5\baselineskip
104 \begin{minipage}\textwidth
105 \small\input table#2\relax
106 \end{minipage}
107 \vskip .5\baselineskip plus .5\baselineskip
108 \caption{#3}%
109 \label{#4}%
110 \vskip 2pt
111 \hrule
112 \end{table}
113 }
114
115 \def\@@stagtable[#1]#2#3#4{%
116 \begin{table*}[#1]
117 \hrule
118 \vskip .5\baselineskip
119 \begin{minipage}\columnwidth
120 \small\input table#2\relax
121 \end{minipage}
122 \vskip .5\baselineskip plus .5\baselineskip
123 \caption{#3}%
124 \label{#4}%
125 \vskip 2pt
126 \hrule
127 \end{table*}
128 }
129
130
131 % Document style options:
132 % 10pt - Makes ten-point type the normal (default) type size
133 % draftnote - Customized draft option
134
135 \@namedef{ds@10pt}{\def\@ptsize{0}} %%% for orthogonality
136
137
138 \newif\ifdraft \draftfalse
139
140 \def\draftstring{{\ifdraft \tt Draft\fi}}
141
142 \def\draftext{%
143 \ifdraft
144 \begingroup
145 \tt
146 \ifodd\thepage
147 \LaTeX set \today\ with \fmtname\ v\fmtversion
148 \else
149 Draft \versiontag/ of \versiondate/
150 \fi
151 \endgroup
152 \fi
153 }
154
155 \def\versiontag/{%
156 \gdef\versiontag/{\#0}%
157 \gdef\versiondate/{\today}%
158 \@input{\jobname.vrsn}%6
159 \versiontag/%
160 }
161 \def\versiondate/{%
162 \gdef\versiontag/{\#0}%
163 \gdef\versiondate/{\today}%
164 \@input{\jobname.vrsn}%
165 \versiondate/%
166 }
167
168 \def\ds@draftnote{%
169 \drafttrue
170 \@ifundefined{ds@draft}{}{\ds@draft}%
171 \def\ps@plain{%
172 \def\@oddhead{\draftext\hfil}%
173 \def\@oddfoot{\draftstring\hfil\rm\thepage\hfil\draftstring}%
174 \let\@evenhead=\@oddhead
175 \let\@evenfoot=\@oddfoot
176 }%
177 }
178
179
180 % The Title
181
182 \def\title#1{%
183 \gdef\@title{#1}%
184 \gdef\banner{%
185 \newpage\setcounter{page}{1}%
186 \begin{center}\Large#1\end{center}%
187 }%
188 }
189
190
191 % Miscellany
192
193 \def\implies{\quad\supset\ }
194
195 \def\tdots{\ldots\thinspace}
196
197 \def\boxit#1{\fbox{\sc#1}}
198
199 \def\note#1{\ifdraft\marginpar{\tt#1}\fi}
200
201
202 % Fractions (from The TUGboat v6 n1, 1985)
203
204 \def\myfrac#1/#2{%
205 \leavevmode\kern.1em
206 \raise.5ex\mbox{\the\scriptfont\z@ #1}\kern-.1em
207 /\kern-.15em\lower.25ex\mbox{\the\scriptfont\z@ #2}%
208 }
209
210
211 % Trademarks...
212
213 \input trademark
214
215
216 % Startup
217
218 \xdef\today{%
219 \ifcase\month
220 \number\month\or
221 January\or February\or March\or April\or May\or June\or
222 July\or August\or September\or October\or November\or December\else
223 \number\month\fi
224 \space\number\day, {\noexpand\mit\number\year}%
225 }
226
227 \begingroup
228 \count0=\time
229 \count1=\count0
230 \divide\count0 by 60
231 \count2=\count0
232 \multiply\count0 by 60
233 \advance\count1 by -\count0
234 \ifnum\count2>11
235 \ifnum\count2>12 \advance\count2 by -12\fi
236 \def\ampm{pm}%
237 \else
238 \ifnum\count2=0 \advance\count2 by 12\fi
239 \def\ampm{am}%
240 \fi
241 \xdef\daytime{%
242 \ifnum\count2<10 0\fi \the\count2:%
243 \ifnum\count1<10 0\fi \the\count1
244 \ampm
245 }%
246 \endgroup
247
248
249 \makeatother % back to normal