summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/techreport.sty
blob: 582cd7f6e75ae897111e1b173d302dbf5795e773 (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
%$% techreport.sty
%$% Technical Report style option to the USC Thesis/Dissertation
%$% document-style.
%$% $Header: techreport.sty,v 1.7 92/08/13 14:25:21 sdc Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @LaTeX-style-file{
%%%    Author              = "Steven Douglas Cochran",
%%%    Version             = "1.7",
%%%    Date                = "13 August 1992",
%%%    Time                = "14:25:21 EDT",
%%%    Filename            = "techreport.sty",
%%%    Address             = "Digital Mapping Laboratory
%%%                           School of Computer Science
%%%                           Carnegie-Mellon University
%%%                           5000 Forbes Avenue
%%%                           Pittsburgh, PA 15213-3890
%%%                           USA",
%%%    Telephone           = "(412) 268-5654",
%%%    FAX                 = "",
%%%    checksum            = "22179 335 1194 11016",
%%%    Email               = "sdc+@CS.CMU.EDU (Internet)",
%%%    CodeTable           = "ISO/ASCII",
%%%    Keywords            = "LaTeX, Technical Report",
%%%    Archives            = "shsu*", 
%%%    Supported           = "yes",
%%%    Abstract            = "LaTeX document-style option to the 
%%%                           USCthesis style for converting a thesis
%%%                           or dissertation into a technical report."
%%%    Note                = "Requires Tomas Rokicki's `rotate' style
%%%                           option (or equivalent) if the spine-art
%%%                           option is used.
%%%    SeeAlso             = "USCthesis.sty",
%%%    DocString           = "The checksum field above contains a CRC-16
%%%                           the checksum as the first value, followed
%%%                           by equivalent of the standard UNIX wc
%%%                           (word count) utility output of lines,
%%%                           words, and characters.  This is produced
%%%                           by Robert Solovay's checksum utility.",
%%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% $Log:	techreport.sty,v $
%$%  Revision 1.7  92/08/13  14:25:21  sdc
%$%  Changed the standard title page to use \@university instead of a
%$%  hardcoded name.  The standard (Thesis/Dissertation) titlepage may
%$%  now be replaced by redefining \customtitlepage.  Cleaned-up the
%$%  code and comments a little. 
%$%
%$%  Revision 1.6  91/03/23  01:36:48  cochran
%$%  Updated to allow the multiple volumes change to USCthesis.
%$%  Corrected bug which caused the chapters to be allowed to begin on
%$%  an even page if the preface section was not processed.
%$% 
%$%  Revision 1.5  1991/03/20  06:03:05  cochran
%$%  Modified to auto-load and use the standard rotate style.
%$%
%$%  Revision 1.4  1991/03/15  04:51:49  cochran
%$%  Modified cover page so that it is centered.  Added a "(top of
%$%  spine)" message to the spine-art page.  (Maybe in the future the
%$%  Printer won't get it upside-down!)
%$%
%$%  Revision 1.3  1991/02/09  01:04:02  cochran
%$%  Fixed bug in interaction with USCthesis and added the ability
%$%  to change the layout of the copyright line.
%$%
%$%  Revision 1.1  90/12/03  12:33:31  cochran
%$%  Initial revision.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%$% Usage:  \documentstyle[...,twoside,techreport,...]{USCthesis}
%%%
%$%   and add the following lines before the \begin{preface}:
%%%
%$%         \reportnumber{IRIS 256}
%$%         \acknowledgment{This research was sponsored by ...}
%$%         \address{Institute for Robotics and Intelligent Systems\\
%$%                  School of Engineering\\
%$%                  ...}
%%%
%%%   An additional command has been added which allows the printing
%%%   of the art for the spine of the document.  It must be used prior
%%%   to the \begin{preface}.
%%%
%%%         \printspinetrue  
%%%
%%%   Also there is an optional argument in the \pageleft macro in the
%%%   USCthesis style which allows the gutter margin to be adjusted
%%%   for paper that is not 8.5in across:
%%%
%%%         \paperleft[-5.75pt]{1.50in}
%%%
%%%   (However, you will have to know how the printer aligns the pages
%%%   to make use of this feature.)
%%%
%%%   If the copyright notice is not correct according to your
%%%   organization's practice.  You can (re)define the \thecopyright
%%%   macro to give the correct form (the variables \@copyrightyrear
%%%   and \@author should have useful values in them).
%%%
%%%   If you want the titlepage (i.e. the page inside the cover) to be
%%%   different than the standard (Thesis/Dissertation) one then you
%%%   can (re)define the \customtitlepage macro to be what you want.
%%%   Currently it creates a page that is a cross between the
%%%   techreport cover and a dissertation titlepage and includes the
%%%   following information: \@reportnumber, \@title, \@author,
%%%   \@university, \@majorfield, \@address, \@submitdate,
%%%   \@acknowledgementtext and either \@mastersdegree or
%%%   \@doctorsdegree (depending on the switch \ifthesis).  \@volume
%%%   is included if non-empty.  One example of a "regular" techreport
%%%   titlepage would be to add the following to your techreport
%%%   between the \documentstyle and the \begin{document}.
%%%
%%%         \makeatletter
%%%         \def\customtitlepage{%
%%%           \vbox{%
%%%             \null
%%%             \vskip 1.69 true in
%%%             \hbox to 4.57in{%
%%%               \vbox to 2.125in{%
%%%                 \vss
%%%                 \begin{center}%
%%%                   \vskip 0.20 true in plus 1fil
%%%                   {\TechTitleSize \@reportnumber \par}%
%%%                   \vskip 0.20 true in plus 2fil
%%%                   {\TechTitleSize \@title\@acknowledgmentmark \par}%
%%%                   \ifx\@volume\@empty\else
%%%                     \vskip 0.20 true in plus 1fil
%%%                     {\TechRegularSize \@volume \par}%
%%%                   \fi
%%%                   \vskip 0.20 true in plus 2fil
%%%                   {\TechRegularSize\sl \@author \par}%
%%%                   \vskip 0.20 true in plus 1fil
%%%                 \end{center}%
%%%                 \vss}}%
%%%             \vfill
%%%             \ifcopyright
%%%               \begin{center}%
%%%                 \thecopyright
%%%               \end{center}%
%%%             \fi
%%%             \@acknowledgmenttext
%%%             \vss}}
%%%         \makeatother
%%%
%%%   With either the default or the above \customtitlepage, you can
%%%   throw out the coverpage and the spine and use a printed cover
%%%   with a cutout box to show through the title, report number and
%%%   author.
%%%
%$% NOTE:  This style requires a local rotate.sty that contains the
%$%        macro \rotr.  If this style option is not available, the
%$%        \printspinetrue option will not work.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%
%% Allow larger font sizes (The normal large sizes are disabled in the
%% USCthesis style.
%%
\def\TechTitleSize{\@setsize\TechTitleSize{25pt}\xxpt\@xxpt}
\def\TechRegularSize{\@setsize\TechRegularSize{18pt}\xivpt\@xivpt}

%%
%%  Now define the functions to handle the titlepage blips.
%%
\def\reportnumber#1{%
  \gdef\@reportnumber{#1}}

\def\@acknowledgmentmark{}
\def\@acknowledgmenttext{}
\def\acknowledgment#1{%
  \gdef\@acknowledgmentmark{$^{1}$}%
  \gdef\@acknowledgmenttext{%
    \vbox{%
      \hrule width 2.5in
      \vskip 3pt
      \parbox{\textwidth}{\footnotesize \qquad $^{1}$#1}}}}

\def\address#1{%
  \gdef\@address{#1}}

%%
%%  Next set up for the control of the spine art
%%
\newif\ifprintspine
\printspinefalse

%%
%%  Allow the copyright message to be changed.
%%
\def\thecopyright{%
  \normalsize Copyright\ \ \copyright\ \ \@copyrightyear\ \ \@author}

%%
%%  Now, we define the title (etc) page(s)
%%
\def\customtitlepage{%
  \vbox to \textheight{%
    \null
    \vskip 1.69 true in
    \hbox to 4.57in{%
      \vbox to 2.125in{%
        \vss
        \begin{center}%
          \vskip 0.20 true in plus 1fil
          {\TechTitleSize \@reportnumber \par}%
          \vskip 0.20 true in plus 2fil
          {\TechTitleSize \@title\@acknowledgmentmark \par}%
          \ifx\@volume\@empty\else
            \vskip 0.20 true in plus 1fil
            {\TechRegularSize \@volume \par}%
          \fi
          \vskip 0.20 true in plus 2fil
          {\TechRegularSize\sl \@author \par}%
          \vskip 0.20 true in plus 1fil
        \end{center}%
        \vss}}%
    \vskip 0.15 true in plus 0.05 true in minus 0.05 true in
    \begin{center}%
      {\ifthesis
         A Thesis Presented to the%
       \else
         A Dissertation Presented to the%
       \fi\\
       FACULTY OF THE \@schoolname\\
       \@university\\
       In Partial Fulfillment of the Requirements for the Degree\\
       \ifthesis 
         \@mastersdegree
       \else
         \@doctorsdegree
       \fi\\
       \ifshowmajorfield
         (\@majorfield)%
       \fi}
      \vskip 0.35 true in plus 0.11 true in minus 0.11 true in
      \@address \par
      \vskip 0.25 true in plus 0.08 true in minus 0.08 true in
      {\bf \small \@submitdate \par}%   should be just month and year
    \end{center}%
    \par
    \vfill
    \ifcopyright
      \begin{center}%
        \thecopyright
      \end{center}%
    \fi
    \@acknowledgmenttext}}

\def\maketitle{%
  \begin{titlepage}%
    \setcounter{page}{0}%
    \advance\evensidemargin 0.25in%
    \null
    \vskip 1.54 true in
    \hbox to 4.3125in{%
      \vbox to 2.125in{%
        \vss
        \begin{center}%
          \vskip 0.20 true in plus 1fil
          {\TechTitleSize \@reportnumber \par}%
          \vskip 0.20 true in plus 2fil
          {\TechTitleSize \@title \par}%
          \ifx\@volume\@empty\else
            \vskip 0.20 true in plus 1fil
            {\TechRegularSize \@volume \par}%
          \fi
          \vskip 0.20 true in plus 2fil
          {\TechRegularSize\sl \@author \par}%
          \vskip 0.20 true in plus 1fil
        \end{center}%
        \vss}}%
    \vskip 0.875 true in
    \begin{center}%
      {\TechRegularSize \@address \par}%
      \vskip .25 true in
      {\TechRegularSize \@submitdate \par}% Should be just month and year
    \end{center}%
    \par
    \vfill
    \newpage
    \advance\evensidemargin -0.25in%
    %%
    \ifprintspine
      \makeatletter 
        %% Load the rotate functions if not defined.
        \expandafter\ifx\csname rotr\endcsname\relax
          \@input{rotate.sty}%
        \fi
        %% If necessary, create a temporary box for use with \rotr.
        \expandafter\ifx\csname @rotbox\endcsname\relax
          \newbox\@rotbox
        \fi
      \makeatother
      \setcounter{page}{1}%
      \rlap{%
        \hbox to \textwidth{%
          \TechRegularSize\hfil (Top of Spine)\hfil}}%
      \nobreak
      {\setbox\@rotbox=\hbox to \textheight{%
         \hfil
         {\TechTitleSize \@reportnumber}%
         \hfil
         \hfil
         {\TechTitleSize \@author}%
         \hfil}
       \rotr\@rotbox}%
      \newpage
    \fi
    %%
    \setcounter{page}{1}%
    \customtitlepage
  \end{titlepage}}

%%
%%  Redefine the preface and chapter so that the latter starts on odd pages
%%  (if two-sided and if past the preface section) and the former does
%%  not have this attribute (since each section of the preface
%%  environment acts like a chapter).
%%
\newif\if@twosidebody
\@twosidebodytrue % Default is true

% Update the PREFACE environment.  The titlepage is generated when the
% environment is first entered and the numbering is roman within the preface.
% The \endpreface switches to arabic numbering. 
\def\preface{%
  \newpage
  \if@twoside % Turn off blank even pages during the preface.
    \global\@twosidebodyfalse
  \fi
  \pagenumbering{roman}%
  \pagestyle{empty}%
  \begin{singlespace}%      
    \ifproposal
      \makeproptitle
      \setcounter{page}{1}%
      \addtocounter{page}{\@startpageA}% Advance page counter for title page.
    \else
      \maketitle
      \setcounter{page}{1}%
      \addtocounter{page}{\@startpageA}% Advance page counter for (signature
    \fi				       %   and) title.  At USC, the signature
 \newpage			       %   page is not counted!
    \ifx\@volume\@empty\else % Add Volume ID to contents if present.
      \addtocontents{toc}{\protect\contentsline{part}{\@volume}{}}%
    \fi
  \end{singlespace}%
  \pagestyle{plain}}

\def\endpreface{%
  \clearpage
  \global\@twosidebodytrue
  \if@twoside
    \ifodd \c@page \else
      \hbox{}%  Add a blank page at the end of the preface
      \newpage
    \fi
  \fi
  \pagenumbering{arabic}%
  \pagestyle{plain}%
  \setcounter{page}{\@startpageB}}

%
% Now, update the chapter to check for even/odd pages.
%
\def\chapter{%
  \if@twoside
    \if@twosidebody
      \cleardoublepage   % Start each chapter on an odd page
    \else
      \clearpage
    \fi
  \else 
    \clearpage
  \fi
  \thispagestyle{plain}
  \global\@topnum\z@
  \@afterindentfalse
  \secdef
  \@chapter
  \@schapter}