Debian Codegraph @

texmf-dist/source/latex/uiucredborder/uiucredborder.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2000 Scott Pakin <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This package may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.2
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in
10 % http://www.latex-project.org/lppl.txt
11 % and version 1.2 or later is part of all distributions of LaTeX
12 % version 1999/12/01 or later.
13 %
14 % \fi
15 % \iffalse
16 %% File: uiucredborder.dtx Copyright (C) 2000 Scott Pakin <[email protected]>
17 %
18 %<class>\NeedsTeXFormat{LaTeX2e}
19 %<class>\ProvidesClass{uiucredborder}
20 %<class> [2000/11/02 v1.00 UIUC red-bordered form class (SDP)]
21 %<class>\setlength{\paperwidth}{8.5in}
22 %<class>\setlength{\paperheight}{11in}
23 %<class>\RequirePackage{geometry}
24 %
25 %<*driver>
26 \documentclass{ltxdoc}
27 \EnableCrossrefs
28 \CodelineIndex
29 \begin{document}
30 \title{The \textsf{uiucredborder} class}
31 \author{Scott Pakin\\[email protected]}
32 \date{November 3, 2000}
33 \maketitle
34 \DocInput{uiucredborder.dtx}
35 \end{document}
36 %</driver>
37 % \fi
38 %
39 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 %
41 % \changes{v1.00}{2000/11/02}{Initial version}
42 %
43 % \CheckSum{145}
44 %% \CharacterTable
45 %% {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
46 %% 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
47 %% Digits \0\1\2\3\4\5\6\7\8\9
48 %% Exclamation \! Double quote \" Hash (number) \#
49 %% Dollar \$ Percent \% Ampersand \&
50 %% Acute accent \' Left paren \( Right paren \)
51 %% Asterisk \* Plus \+ Comma \,
52 %% Minus \- Point \. Solidus \/
53 %% Colon \: Semicolon \; Less than \<
54 %% Equals \= Greater than \> Question mark \?
55 %% Commercial at \@ Left bracket \[ Backslash \\
56 %% Right bracket \] Circumflex \^ Underscore \_
57 %% Grave accent \` Left brace \{ Vertical bar \|
58 %% Right brace \} Tilde \~}
59 %%
60 %
61 % \DoNotIndex{\begin,\DeclareOption,\def,\end,\hfil,\hspace}
62 % \DoNotIndex{\input,\MakeUppercase,\newcommand,\newlength,\par,\parbox}
63 % \DoNotIndex{\ProcessOptions,\relax,\renewcommand,\vspace}
64 %
65 % \begin{abstract}
66 % Every UIUC graduate student dreads having to fill out the red-bordered
67 % form that gets attached to his thesis because of all the trial-and-error
68 % necessary to get the text to line up properly. The
69 % \texttt{uiucredborder} class makes it easy to produce proper formatting
70 % on the first try.
71 % \end{abstract}
72 %
73 % \section{Usage}
74 %
75 % \subsection{Commands}
76 %
77 % There are four parameters that must be set in your document's preamble:
78 %
79 % \begin{description}
80 % \item[\cmd{\title}] \DescribeMacro{\title}
81 % The title of your thesis
82 %
83 % \item[\cmd{\author}] \DescribeMacro{\author}
84 % Your full name, exactly as it appears in the Graduate College's
85 % records
86 %
87 % \item[\cmd{\degreemonth}] \DescribeMacro{\degreemonth}
88 % The month (spelled out) in which your degree will be conferred
89 %
90 % \item[\cmd{\degreeyear}] \DescribeMacro{\degreeyear}
91 % The four-digit year in which your degree will be conferred
92 % \end{description}
93 %
94 % \noindent
95 % \DescribeMacro{\msthesis}
96 % \DescribeMacro{\phdthesis}
97 % In addition, you must invoke either \cmd{\msthesis} or
98 % \cmd{\phdthesis}, depending on whether the red-bordered form is for
99 % a Master's thesis or a doctoral dissertation.
100 %
101 % Note that all of the above except for \cmd{\degreemonth} behave
102 % identically in |uiucthesis.sty|. (The thesis title page does not
103 % include the month in which the degree is awarded.) Thus, you can
104 % move all of the above definitions into a separate file which you can
105 % then \cmd{\input} into both your thesis and your red-bordered form.
106 % That way, if you change your thesis title or other information, the
107 % red-bordered form will always be up-to-date.
108 %
109 % \DescribeMacro{\maketitle}
110 % The body of your document should contain only a |\maketitle|, which will
111 % use the above parameters to fill in the red-bordered form.
112 %
113 % \subsection{Class options}
114 %
115 % The |uiucredborder| class accepts the |10pt|, |11pt|, and |12pt| options
116 % for setting the font size, just like in the standard \LaTeX\ classes. (The
117 % default is |10pt|.) In addition, the |linecentered| option centers each of
118 % your name, thesis title, and degree relative within the space provided on
119 % the corresponding line on the form. The default is to center each of those
120 % relative to the thesis title. |linecentered| looks a lot uglier and is
121 % recommended only if you desperately need an extra~3$\:$cm of space for your
122 % name.
123 %
124 % \subsection{Other customizations}
125 %
126 % \DescribeMacro{\formattext}
127 % By default, |uiucredborder| formats each piece of text in bold and
128 % uppercase. To alter that behavior, use |\renewcommand| to
129 % change the definition of |\formattext| to anything that accepts one
130 % argument and formats it appropriately.
131 %
132 % \section{Example}
133 %
134 % The following is typical usage of |uiucredborder|:
135 %
136 % \begin{verbatim}
137 %\documentclass[11pt]{uiucredborder}
138 %
139 %\title{A \LaTeX\ Class for Filling in Red-Bordered Forms}
140 %\author{Scott Pakin}
141 %\degreeyear{2001}
142 %\degreemonth{May}
143 %\phdthesis
144 %
145 %\begin{document}
146 %\maketitle
147 %\end{document}
148 % \end{verbatim}
149 %
150 % \StopEventually{\PrintIndex}
151 %
152 % \section{Implementation}
153 %
154 % This section contains the complete source code for \texttt{uiucredborder}.
155 % Most users will not get much out of it, but it should be of use to
156 % those who need more precise documentation and those who want to extend
157 % the \texttt{uiucredborder} class.
158 %
159 % \begin{macrocode}
160 %<*class>
161 % \end{macrocode}
162 %
163 % \subsection{User parameters}
164 %
165 % \begin{macro}{\phdthesis}
166 % \begin{macro}{\msthesis}
167 % \begin{macro}{\degreeyear}
168 % The following were ripped out of \texttt{uiucthesis.sty}.
169 % \begin{macrocode}
170 \def\phdthesis{\def\@degree{Doctor of Philosophy}}
171 \def\msthesis{\def\@degree{Master of Science}}
172 \def\degreeyear#1{\def\@degreeyear{#1}}
173 % \end{macrocode}
174 % \end{macro}
175 % \end{macro}
176 % \end{macro}
177 %
178 % \begin{macro}{\degreemonth}
179 % We also need to know the graduation month, which \texttt{uiucthesis.sty}
180 % doesn't care about.
181 % \begin{macrocode}
182 \def\degreemonth#1{\def\@degreemonth{#1}}
183 % \end{macrocode}
184 % \end{macro}
185 %
186 % \subsection{Lengths}
187 %
188 % There are four fields the student must fill in on the red-bordered form:
189 %
190 % \begin{itemize}
191 % \item the date (month + year) in which the degree will be conferred,
192 % \item the student's full name, exactly as it appears in UIUC's records,
193 % \item the thesis title, and
194 % \item the degree to be conferred (``M.S.'' or ``Ph.D.,'' spelled out).
195 % \end{itemize}
196 %
197 % \begin{macro}{\date@indent}
198 % \begin{macro}{\author@indent}
199 % \begin{macro}{\title@indent}
200 % \begin{macro}{\degree@indent}
201 % Field indents are measured from the left edge of the paper and specify
202 % the horizontal offset that each field starts at.
203 % \begin{macrocode}
204 \newlength{\date@indent}
205 \newlength{\author@indent}
206 \newlength{\title@indent}
207 \newlength{\degree@indent}
208 % \end{macrocode}
209 % \end{macro}
210 % \end{macro}
211 % \end{macro}
212 % \end{macro}
213 %
214 % \begin{macro}{\date@width}
215 % \begin{macro}{\author@width}
216 % \begin{macro}{\title@width}
217 % \begin{macro}{\degree@width}
218 % Field widths are the width of each field.
219 % \begin{macrocode}
220 \newlength{\date@width}
221 \newlength{\author@width}
222 \newlength{\title@width}
223 \newlength{\degree@width}
224 % \end{macrocode}
225 % \end{macro}
226 % \end{macro}
227 % \end{macro}
228 % \end{macro}
229 %
230 % \begin{macro}{\center@lines}
231 % Specify that each line should be centered individually. This looks a bit
232 % crooked, but may be needed if you have a very, very long name or use an
233 % especially wide font.
234 % \begin{macrocode}
235 \def\center@lines{%
236 \setlength{\date@indent}{127mm}
237 \setlength{\author@indent}{39mm}
238 \setlength{\title@indent}{60mm}
239 \setlength{\degree@indent}{73mm}
240 %
241 \setlength{\date@width}{63mm}
242 \setlength{\author@width}{150mm}
243 \setlength{\title@width}{130mm}
244 \setlength{\degree@width}{118mm}
245 }
246 % \end{macrocode}
247 % \end{macro}
248 %
249 % \begin{macro}{\center@globally}
250 % Specify that the student's name, thesis title, and degree should all be
251 % centered relative to each other. One might think that the degree field,
252 % which is the narrowest and most indented, should determine the indentation
253 % for the other two fields. However, we can actually use the wider and
254 % less-indented title field for this purpose, because we know \textit{a
255 % priori} that the text in the degree field will be short relative to the
256 % length of line on the form.
257 % \begin{macrocode}
258 \def\center@globally{%
259 \setlength{\date@indent}{127mm}
260 \setlength{\author@indent}{60mm}
261 \setlength{\title@indent}{60mm}
262 \setlength{\degree@indent}{60mm}
263 %
264 \setlength{\date@width}{63mm}
265 \setlength{\author@width}{130mm}
266 \setlength{\title@width}{130mm}
267 \setlength{\degree@width}{130mm}
268 }
269 % \end{macrocode}
270 % \end{macro}
271 %
272 % \subsection{Filling in the form}
273 %
274 % \begin{macro}{\formattext}
275 % The |\formattext| macro is applied to each chunk of text we output.
276 % The default is to make the text bold and uppercase, but the user can
277 % change that behavior with |\renewcommand|.
278 % \begin{macrocode}
279 \newcommand{\formattext}[1]{\textbf{\MakeUppercase{#1}}}
280 % \end{macrocode}
281 % \end{macro}
282 %
283 % \begin{macro}{\maketitle}
284 % We define the |\maketitle| macro to fill in the form with the contents
285 % of |\@degreemonth|, |\@degreeyear|, |\@author|, |\@title|, and |\@degree|.
286 % \begin{macrocode}
287 \newcommand{\maketitle}{%
288 \thispagestyle{empty}%
289 \setlength{\baselineskip}{11mm}\setlength{\parindent}{0pt}%
290 \vspace*{65mm}\hspace*{\date@indent}%
291 \parbox[t]{\date@width}{%
292 \hfil\formattext{\@degreemonth{} \@degreeyear}\hfil}\par
293 \vspace*{22mm}\hspace*{\author@indent}%
294 \parbox[t]{\author@width}{%
295 \hfil\formattext{\@author}\hfil}\par
296 \hspace*{\title@indent}%
297 \begin{minipage}[t][3\baselineskip]{\title@width}
298 \begin{center}
299 \setlength{\baselineskip}{11mm}\setlength{\parindent}{0pt}%
300 \formattext{\@title}
301 \end{center}
302 \end{minipage}\par
303 \vspace*{-1mm}\hspace*{\degree@indent}%
304 \parbox[t]{\degree@width}{\hfil\formattext{\@degree}\hfil}
305 }
306 % \end{macrocode}
307 % \end{macro}
308 %
309 % \subsection{Option processing}
310 %
311 % |\center@globally| is the default. The |linecentered| option invokes
312 % |\center@lines|.
313 % \begin{macrocode}
314 \center@globally
315 \DeclareOption{linecentered}{\center@lines}
316 % \end{macrocode}
317 %
318 % Let the user set the font size, just like in the standard \LaTeX\ classes.
319 % Use 10pt by default.
320 % \begin{macrocode}
321 \newcommand{\@ptsize}{0}
322 \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
323 \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
324 \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
325 % \end{macrocode}
326 %
327 % Process our options.
328 % \begin{macrocode}
329 \ProcessOptions\relax
330 \input{size1\@ptsize.clo}
331 % \end{macrocode}
332 %
333 % \subsection{Margins}
334 %
335 % Set the margins to zero, so we can work with absolute lengths.
336 % \begin{macrocode}
337 \geometry{noheadfoot,letterpaper,marginparsep=0pt}
338 \geometry{lmargin=0mm, rmargin=0mm}
339 \geometry{tmargin=0mm, bmargin=0mm}
340 % \end{macrocode}
341 %
342 % \begin{macrocode}
343 %</class>
344 % \end{macrocode}
345 %
346 % \Finale
347 \endinput