65efad8c5b1b480224272e7732c18be44dd2d37e
[latex-mlastyle.git] / mlastyle.dtx
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2003 by Tim Pope <latex@rebelongto.us>
4 % ----------------------------------------------------
5
6 % This file 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 %
11 %    http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.2 or later is part of all distributions of LaTeX 
14 % version 1999/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
20 %<package>\ProvidesPackage{mlastyle}
21 %<package>   [2003/11/09 v0.9 MLA format and documentation style]
22 %
23 %<*driver>
24 \documentclass[draft]{ltxdoc}
25 \iftrue
26   \usepackage[compat]{mlastyle}
27   \addtolength{\headsep}{-25pt}
28   \addtolength{\headheight}{-12pt}
29   \addtolength{\topmargin}{-17pt}
30   \addtolength{\textheight}{58pt}
31   \IfFileExists{ulem.sty}{\usepackage[normalem]{ulem}}{\let\uline\emph}
32 \else
33   \usepackage[mla]{mlastyle}
34   \addtolength{\marginparwidth}{1in}
35   \addtolength{\textwidth}{-1in}
36   \addtolength{\headwidth}{-1in}
37 \fi
38 \IfFileExists{times.sty}%
39 {\newcommand{\examp}[2][]{{\let\emph\uline\fontfamily{ptm}\selectfont##2}##1}}%
40 {\newcommand{\examp}[2][]{``##2##1''}}
41
42 \EnableCrossrefs
43 \CodelineIndex
44 \RecordChanges
45 %\OnlyDescription
46 \begin{document}
47   \DocInput{mlastyle.dtx}
48 \end{document}
49 %</driver>
50 % \fi
51 %
52 % \CheckSum{0}
53 %
54 % \CharacterTable
55 %  {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
56 %   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
57 %   Digits        \0\1\2\3\4\5\6\7\8\9
58 %   Exclamation   \!     Double quote  \"     Hash (number) \#
59 %   Dollar        \$     Percent       \%     Ampersand     \&
60 %   Acute accent  \'     Left paren    \(     Right paren   \)
61 %   Asterisk      \*     Plus          \+     Comma         \,
62 %   Minus         \-     Point         \.     Solidus       \/
63 %   Colon         \:     Semicolon     \;     Less than     \<
64 %   Equals        \=     Greater than  \>     Question mark \?
65 %   Commercial at \@     Left bracket  \[     Backslash     \\
66 %   Right bracket \]     Circumflex    \^     Underscore    \_
67 %   Grave accent  \`     Left brace    \{     Vertical bar  \|
68 %   Right brace   \}     Tilde         \~}
69 %
70 %
71 % \changes{v0.9}{2003/11/09}{Converted to \texttt{dtx} file}
72 % \changes{v0.8}{2003/10/15}{Initial version}
73 %
74 % \GetFileInfo{mlastyle.sty}
75 %
76 % \DoNotIndex{\ }
77 % \DoNotIndex{\.}
78 % \DoNotIndex{\@afterindentfalse}
79 % \DoNotIndex{\@afterindenttrue}
80 % \DoNotIndex{\@arabic}
81 % \DoNotIndex{\@author}
82 % \DoNotIndex{\@auxout}
83 % \DoNotIndex{\@citea}
84 % \DoNotIndex{\@citeb}
85 % \DoNotIndex{\@date}
86 % \DoNotIndex{\@empty}
87 % \DoNotIndex{\@firstofone}
88 % \DoNotIndex{\@for}
89 % \DoNotIndex{\@ifundefined}
90 % \DoNotIndex{\@latex@warning}
91 % \DoNotIndex{\@listI}
92 % \DoNotIndex{\@listi}
93 % \DoNotIndex{\@listii}
94 % \DoNotIndex{\@listiii}
95 % \DoNotIndex{\@listiv}
96 % \DoNotIndex{\@listv}
97 % \DoNotIndex{\@listvi}
98 % \DoNotIndex{\@startsection}
99 % \DoNotIndex{\@tempswafalse}
100 % \DoNotIndex{\@title}
101 % \DoNotIndex{\@undefined}
102 % \DoNotIndex{\DeclareOption}
103 % \DoNotIndex{\ExecuteOptions}
104 % \DoNotIndex{\G@refundefinedtrue}
105 % \DoNotIndex{\ProcessOptions}
106 % \DoNotIndex{\RequirePackage}
107 % \DoNotIndex{\addtolength}
108 % \DoNotIndex{\advance}
109 % \DoNotIndex{\baselineskip}
110 % \DoNotIndex{\begin}
111 % \DoNotIndex{\bfseries}
112 % \DoNotIndex{\c@enumiv}
113 % \DoNotIndex{\catcode}
114 % \DoNotIndex{\centering}
115 % \DoNotIndex{\centerline}
116 % \DoNotIndex{\chapter}
117 % \DoNotIndex{\citation}
118 % \DoNotIndex{\clearpage}
119 % \DoNotIndex{\csname}
120 % \DoNotIndex{\day}
121 % \DoNotIndex{\def}
122 % \DoNotIndex{\do}
123 % \DoNotIndex{\edef}
124 % \DoNotIndex{\else}
125 % \DoNotIndex{\end}
126 % \DoNotIndex{\endcsname}
127 % \DoNotIndex{\endlist}
128 % \DoNotIndex{\exhyphenpenalty}
129 % \DoNotIndex{\expandafter}
130 % \DoNotIndex{\f@baselineskip}
131 % \DoNotIndex{\fancyhf}
132 % \DoNotIndex{\fancypagestyle}
133 % \DoNotIndex{\fi}
134 % \DoNotIndex{\futurelet}
135 % \DoNotIndex{\gdef}
136 % \DoNotIndex{\hangindent}
137 % \DoNotIndex{\headrulewidth}
138 % \DoNotIndex{\if@filesw}
139 % \DoNotIndex{\if@tempswa}
140 % \DoNotIndex{\ifcase}
141 % \DoNotIndex{\ifmlastyle@bibstyle}
142 % \DoNotIndex{\ifmlastyle@format}
143 % \DoNotIndex{\ifmlastyle@papersize}
144 % \DoNotIndex{\ifmlastyle@style}
145 % \DoNotIndex{\ifmlastyle@times}
146 % \DoNotIndex{\ifmlastyle@underline}
147 % \DoNotIndex{\ifx}
148 % \DoNotIndex{\immediate}
149 % \DoNotIndex{\item}
150 % \DoNotIndex{\itemindent}
151 % \DoNotIndex{\itemsep}
152 % \DoNotIndex{\labelsep}
153 % \DoNotIndex{\labelwidth}
154 % \DoNotIndex{\leavevmode}
155 % \DoNotIndex{\leftmargin}
156 % \DoNotIndex{\leftmargini,\leftmarginii,\leftmarginiii}
157 % \DoNotIndex{\leftmarginiv,\leftmarginv,\leftmarginvi}
158 % \DoNotIndex{\let}
159 % \DoNotIndex{\linespread}
160 % \DoNotIndex{\list}
161 % \DoNotIndex{\listparindent}
162 % \DoNotIndex{\makeenmark}
163 % \DoNotIndex{\mbox}
164 % \DoNotIndex{\mlastyle@bibstylefalse}
165 % \DoNotIndex{\mlastyle@bibstyletrue}
166 % \DoNotIndex{\mlastyle@cite}
167 % \DoNotIndex{\mlastyle@course}
168 % \DoNotIndex{\mlastyle@formatfalse}
169 % \DoNotIndex{\mlastyle@formattrue}
170 % \DoNotIndex{\mlastyle@instructor}
171 % \DoNotIndex{\mlastyle@intbib}
172 % \DoNotIndex{\mlastyle@papersizefalse}
173 % \DoNotIndex{\mlastyle@papersizetrue}
174 % \DoNotIndex{\mlastyle@qspread}
175 % \DoNotIndex{\mlastyle@sl@sh}
176 % \DoNotIndex{\mlastyle@slash}
177 % \DoNotIndex{\mlastyle@slashnext}
178 % \DoNotIndex{\mlastyle@slashx}
179 % \DoNotIndex{\mlastyle@stylefalse}
180 % \DoNotIndex{\mlastyle@styletrue}
181 % \DoNotIndex{\mlastyle@surname}
182 % \DoNotIndex{\mlastyle@timesfalse}
183 % \DoNotIndex{\mlastyle@timestrue}
184 % \DoNotIndex{\mlastyle@underlinefalse}
185 % \DoNotIndex{\mlastyle@underlinetrue}
186 % \DoNotIndex{\month}
187 % \DoNotIndex{\newblock}
188 % \DoNotIndex{\newcommand}
189 % \DoNotIndex{\newenvironment}
190 % \DoNotIndex{\newif}
191 % \DoNotIndex{\newpage}
192 % \DoNotIndex{\noindent}
193 % \DoNotIndex{\normalsize}
194 % \DoNotIndex{\notesname}
195 % \DoNotIndex{\number}
196 % \DoNotIndex{\or}
197 % \DoNotIndex{\p@}
198 % \DoNotIndex{\pagestyle}
199 % \DoNotIndex{\par}
200 % \DoNotIndex{\parindent}
201 % \DoNotIndex{\parsep}
202 % \DoNotIndex{\penalty}
203 % \DoNotIndex{\relax}
204 % \DoNotIndex{\renewcommand}
205 % \DoNotIndex{\renewenvironment}
206 % \DoNotIndex{\reset@font}
207 % \DoNotIndex{\rhead}
208 % \DoNotIndex{\selectfont}
209 % \DoNotIndex{\setlength}
210 % \DoNotIndex{\settowidth}
211 % \DoNotIndex{\sfcode}
212 % \DoNotIndex{\skip}
213 % \DoNotIndex{\sloppy}
214 % \DoNotIndex{\space}
215 % \DoNotIndex{\string}
216 % \DoNotIndex{\sw@llow}
217 % \DoNotIndex{\the}
218 % \DoNotIndex{\thebibliography}
219 % \DoNotIndex{\thepage}
220 % \DoNotIndex{\topsep}
221 % \DoNotIndex{\usecounter}
222 % \DoNotIndex{\vskip}
223 % \DoNotIndex{\write}
224 % \DoNotIndex{\year}
225 % \DoNotIndex{\z@}
226 % \DoNotIndex{\evensidemargin}
227 % \DoNotIndex{\headheight}
228 % \DoNotIndex{\headsep}
229 % \DoNotIndex{\hoffset}
230 % \DoNotIndex{\marginparwidth}
231 % \DoNotIndex{\oddsidemargin}
232 % \DoNotIndex{\raggedbottom}
233 % \DoNotIndex{\raggedright}
234 % \DoNotIndex{\textheight}
235 % \DoNotIndex{\textwidth}
236 % \DoNotIndex{\topmargin}
237 % \DoNotIndex{\voffset}
238 % \DoNotIndex{\paperheight}
239 % \DoNotIndex{\paperwidth}
240 % \DoNotIndex{\pdfpageheight}
241 % \DoNotIndex{\pdfpagewidth}
242 % \DoNotIndex{\special}
243 %
244 % \hyphenation{pre-am-ble wide-spread}
245 %
246 % \newcommand{\Lopt}[1]{\textsf {#1}}
247 % \newcommand{\file}[1]{\texttt {#1}}
248 % \newcommand{\package}[1]{\textsf {#1}}
249 % ^^A\newcommand{\Lcount}[1]{\textsl {\small#1}}
250 % ^^A\newcommand{\pstyle}[1]{\textsl {#1}}
251 %
252 % \newcommand{\OptionIndex}[1]{\index{#1\actualchar\Lopt{#1} (option)\encapchar usage}\index{options:\levelchar\Lopt{#1}}}
253 %
254 % \title{The \package{mlastyle} package\thanks{This document
255 %   corresponds to \package{mlastyle}~\fileversion, dated \filedate.}}
256 % \author{Tim Pope \\ \texttt{latex@rebelongto.us}}
257 % \surname{Pope}
258 %
259 % \maketitle
260 % \tableofcontents
261 %
262 % \section{Introduction}
263 %
264 % MLA style, consisting of a set of documentation conventions, has
265 % gained widespread acceptance in the humanities.  \LaTeX{} is a
266 % document preparation system enjoying popularity in the scientific field.
267 % It should come as no surprise that complete, up-to-date implementations
268 % of MLA style for \LaTeX{} are in short supply.  The \LaTeX{} package
269 % \package{mlastyle} aims to fill this void.
270 %
271 % \section{Usage}
272 %
273 % A sample document follows.
274 % \begin{verbatim}
275 %\documentclass[12pt]{article}
276 %\usepackage{mlastyle}
277 %
278 %\author{John Doe}
279 %\instructor{Professor Smith}
280 %\course{English 101}
281 %\date{1~Jan.\ 1970}
282 %\title{The Inherent Sadism of Compulsory English Classes}
283 %
284 %\begin{document}
285 %\maketitle
286 %'Nuff said.
287 %\end{document}\end{verbatim}
288 % \subsection{Initialization Macros}
289 % The \index{heading|usage}mandatory heading is generated with
290 % \DescribeMacro{\maketitle}|\maketitle|.  Use the standard macros
291 % |\author|, |\title|, and |\date| to specify the relevant information.
292 % To define the instructor and name of the course, use the aptly named
293 % \DescribeMacro{\instructor}|\instructor|\marg{instructor} and
294 % \DescribeMacro{\course}|\course|\marg{course} macros.
295 %
296 % The last name for use in the header\index{header|usage} is derived from
297 % |\author|.  If this does not produce the desired result, use
298 % \DescribeMacro{\surname}|\surname|\marg{last name} to override it.
299 %
300 % MLA style recommends the DD~Mon.~YYYY format for specifying dates;
301 % \DescribeMacro{\today}|\today| has been conveniently redefined to this.
302 % However, other formats can be used as long as done so consistently
303 % throughout the document.  Also note that the date in the
304 % heading\index{heading|usage} should be the due date of the assignment;
305 % students who finish assignments early would be wise to call
306 % |\date|\marg{due date}.
307 %
308 % \subsection{Environments}
309 % Three environments have been modified from standard \LaTeX to better
310 % suit MLA format.  To typeset \index{poetry|usage}poetry and
311 % \index{drama|usage}drama, use the \DescribeEnv{verse}|verse|
312 % environment.  Quotations\index{quotations|usage} of a single paragraph
313 % or less always use the \DescribeEnv{quote}|quote| environment.  For
314 % longer passages, use the \DescribeEnv{quotation}|quotation| environment
315 % if the beginning of the passage marks the beginning of a paragraph.
316 % Otherwise, use the |quote| environment.
317 %
318 % Be sure to follow MLA guidelines when using these environments.  Short
319 % quotes should be enclosed in quotation marks and included directly in
320 % the text.
321 %
322 % \subsection{Modes of Operation}
323 % The \package{mlastyle} package has four basic modes of operations,
324 % selected with one of four mutually exclusive options.  The
325 % \OptionIndex{format}\Lopt{format}
326 % option tells \package{mlastyle} to use MLA format (i.e., 1 inch margins,
327 % double-spaced, etc.).  The \OptionIndex{style}\Lopt{style} option tells
328 % \package{mlastyle} to use MLA style (i.e., the format of parenthetical
329 % documentation, etc).  Each of these options
330 % disables the other; to use both MLA format and MLA style, specify the
331 % \OptionIndex{mla}\Lopt{mla} option, or nothing at all.
332 %
333 % To disable both MLA style and MLA format, use the
334 % \OptionIndex{compat}\Lopt{compat} option.  This differs from omitting
335 % the package entirely in that certain macros are still defined (e.g.,
336 % |\instructor|).  Also, citations are handled a bit differently than in
337 % standard \LaTeX{} (see section~\ref{sec:documentation}).
338 %
339 % In addition to the above, several other options modify the behavior of
340 % \package{mlastyle}.
341 %
342 % \subsubsection{Italics vs.\ Underlining} \index{underlining|usage}
343 % \index{italics|usage}
344 % MLA format dictates that emphasis should be indicated by underlining the
345 % text.  Thus, the \package{ulem} package, which underlines all emphasized
346 % text, is loaded by default in \Lopt{mla} and \Lopt{format} modes.  To
347 % disable this, use the \OptionIndex{italics}\Lopt{italics} option.
348 % Conversely, if underlining is desired in \Lopt{style} or \Lopt{compat}
349 % mode, the \OptionIndex{underline}\Lopt{underline} option can be used.
350 %
351 % \subsubsection{Fonts}
352 % By default, \package{mlastyle} uses \TeX's standard Computer Modern
353 % font.  Some profess\-ors\penalty500---particularly those
354 % concerned with document length---require assignments to be set in
355 % \examp[.]{Times New Roman}  This can be achieved with the
356 % \OptionIndex{times}\Lopt{times} option, which simply loads the
357 % \package{times} package.  This opposite of this option is
358 % \OptionIndex{cm}\Lopt{cm}, which reverts to Computer Modern.
359 %
360 % \index{works cited|usage}
361 % \subsection{Documenting Sources} \label{sec:documentation}
362 %
363 % The \package{mlastyle} package reimplements the
364 % \DescribeEnv{thebibliography}|thebibliography| environment to generate
365 % the list of works cited in MLA style.  Instruction in the basic use of
366 % \LaTeX's bibliography features is beyond the scope of this document;
367 % however, the following example, which should be included just before
368 % |\end{document}|, might prove to be a useful starting point:
369 %\begin{verbatim}
370 %\begin{thebibliography}{}
371 %
372 %\bibitem[Lamport]{latex}
373 %Lamport, Leslie.
374 %\newblock {\em \LaTeX: A Document Preparation System}.
375 %\newblock 2nd.~ed.
376 %\newblock Reading: Addison-Wesley, 1994.
377 %
378 %\end{thebibliography}\end{verbatim}
379 %
380 % In this example, |Lamport| is the author's last name (for use in
381 % citations) and |latex| is the marker used to reference it (see
382 % section~\ref{sec:parenthetical}).
383 %
384 % For information on automatically generating the list of works cited with
385 % \BibTeX, see section~\ref{sec:bibtex}.
386 %
387 % \subsubsection{Parenthetical Documentation} \label{sec:parenthetical}
388 % A simple citation can by achieved with a call to
389 % \DescribeMacro{\cite}|\cite|\oarg{pages}\marg{marker}, where
390 % marker refers to the key given to either
391 % \index{BibTeX=\BibTeX|usage}\BibTeX{} or the |\bibitem| macro (|latex|
392 % in the above example).
393 % Omit \oarg{pages} if the source has no page numbers.
394 % Multiple sources can be cited using the syntax
395 % |\cite|\oarg{pages}|{|\meta{marker
396 % 1}\texttt{,}\penalty\exhyphenpenalty\meta{marker 2}\ldots|}|; however, page
397 % numbers can currently be specified only for the last referenced source.
398 % To work around this limitation |\citeN|, explained below, can be used.
399 %
400 % Three additional citation commands are provided, all of which take the
401 % same arguments as |\cite|.  To omit the author information from the
402 % citation, use \DescribeMacro{\citepage}|\citepage|.  Indirect
403 % citations---those of the format \examp{(qtd. in Brown 6)}---can be
404 % created with \DescribeMacro{\citeindirect}|\citeindirect|.  Finally, the
405 % parentheses are omitted by \DescribeMacro{\citeN}|\citeN|.  This was
406 % intended for use in cross references, but it can also help in citing
407 % multiple works.  The result of
408 % |(\citeN[42]{knuth}|\texttt{; }|\citeN[69]{lamport})|
409 % would be something like \examp[.]{(Knuth 42; Lamport 69)}
410 %
411 % \subsubsection{Using {\rm \BibTeX}} \label{sec:bibtex}
412 % Coupled with \index{BibTeX=\BibTeX|usage}\BibTeX,
413 % \package{mlastyle} provides a experimental implementation of MLA
414 % documentation style.  Put\SpecialUsageIndex{\bibliographystyle}
415 % |\bibliographystyle{mlastyle}| in the document preamble to load the
416 % bibliography style.  Alternatively, the
417 % \OptionIndex{bibstyle}\Lopt{bibstyle} option can handle this
418 % automatically, loading a bibliography style of |mlastyle| in \Lopt{mla}
419 % and \Lopt{style} modes and a bibliography style of |plain| in
420 % \Lopt{format} and \Lopt{compat} modes.
421 %
422 % Use of \BibTeX{} is also beyond the scope of this document; instead,
423 % another example is provided.  To use it, substitute
424 % |\bibliography|\marg{filename} for the |thebibliography| environment.
425 % Then create \meta{filename}\file{.bib} with the contents below.
426 % Generating the document entails running \file{latex} on the \file{.tex}
427 % file, \file{bibtex} on the resulting \file{.aux} file, then \file{latex}
428 % twice more.
429 %\begin{verbatim}
430 %@BOOK{latex,
431 %  AUTHOR = "Leslie Lamport",
432 %  TITLE = "\LaTeX: A Document Preparation System",
433 %  KEY = "\LaTeX",
434 %  EDITION = "Second",
435 %  ADDRESS = "Reading",
436 %  PUBLISHER = "Addison-Wesley",
437 %  YEAR = "1994"}\end{verbatim}
438 % In \package{mlastyle}, The |KEY| field serves the additional purpose of
439 % specifying an abbreviated title.  This is unnecessary in the above
440 % example.  If an additional book by Leslie Lamport was included, however,
441 % the |KEY| field would allow |\cite{lamport}| to yield \examp{(Lamport,
442 % \emph{\LaTeX\/})} instead of \examp[.]{(Lamport, \emph{\LaTeX: A Document
443 % Preparation System\/})}
444 %
445 % \StopEventually{\PrintChanges\PrintIndex}
446 %
447 % \section{Implementation}
448 % \iffalse
449 %<*package>
450 % \fi
451 % \subsection{Options}
452 %
453 % \begin{macro}{\ifmlastyle@*}
454 % \begin{macro}{\mlastyle@*true}
455 % \begin{macro}{\mlastyle@*false}
456 % Most options are implemented by modifying a |\newif| declared for this
457 % purpose.
458 %    \begin{macrocode}
459 \newif\ifmlastyle@bibstyle
460 \DeclareOption{bibstyle}{\mlastyle@bibstyletrue}
461 \DeclareOption{nobibstyle}{\mlastyle@bibstylefalse}
462 \newif\ifmlastyle@papersize
463 \DeclareOption{papersize}{\mlastyle@papersizetrue}
464 \DeclareOption{nopapersize}{\mlastyle@papersizefalse}
465 \newif\ifmlastyle@underline
466 \DeclareOption{underline}{\mlastyle@underlinetrue}
467 \DeclareOption{italics}{\mlastyle@underlinefalse}
468 \newif\ifmlastyle@times
469 \DeclareOption{times}{\mlastyle@timestrue}
470 \DeclareOption{cm}{\mlastyle@timesfalse}
471 \newif\ifmlastyle@style
472 \DeclareOption{compat}{\mlastyle@stylefalse
473         \mlastyle@formatfalse
474         \mlastyle@underlinefalse}
475 \DeclareOption{mla}{\mlastyle@styletrue
476         \mlastyle@formattrue
477         \mlastyle@underlinetrue}
478 \newif\ifmlastyle@format
479 \DeclareOption{format}{\mlastyle@stylefalse
480         \mlastyle@formattrue
481         \mlastyle@underlinetrue}
482 \DeclareOption{style}{\mlastyle@styletrue
483         \mlastyle@formatfalse
484         \mlastyle@underlinefalse}
485 \DeclareOption{singlespacequotes}{
486   \def\mlastyle@qspread{\linespread{1}\selectfont\vskip\baselineskip}}
487 \DeclareOption{doublespacequotes}{\let\mlastyle@qspread\relax}
488 \ExecuteOptions{nobibstyle,nopapersize,mla,cm,doublespacequotes}
489 \ProcessOptions
490 %    \end{macrocode}
491 % \end{macro}
492 % \end{macro}
493 % \end{macro}
494 % If the \Lopt{papersize} option is set, add the appropriate
495 % \textsc{PostScript} special, or adjust |\pdfpagewidth| and
496 % |\pdfpageheight| if pdf\LaTeX{} is in use.
497 %    \begin{macrocode}
498 \ifmlastyle@papersize
499   \ifx\@undefined\pdfpagewidth
500     \special{papersize=\the\paperwidth,\the\paperheight}
501   \else
502     \setlength{\pdfpagewidth}{\paperwidth}
503     \setlength{\pdfpageheight}{\paperheight}
504   \fi
505 \fi % \ifmlastyle@papersize
506 %    \end{macrocode}
507 % If the \Lopt{bibstyle} option is set, specify the bibliography style.
508 %    \begin{macrocode}
509 \ifmlastyle@bibstyle
510   \ifmlastyle@style
511     \bibliographystyle{mlastyle}
512   \else
513     \bibliographystyle{plain}
514   \fi
515 \fi % \ifmlastyle@bibstyle
516 %    \end{macrocode}
517 % Load the \package{ulem} package if the \Lopt{underline} option is set.
518 %    \begin{macrocode}
519 \ifmlastyle@underline
520   \RequirePackage{ulem}
521 \fi % \ifmlastyle@underline
522 %    \end{macrocode}
523 % Load the \package{times} package if the \Lopt{times} option is set.
524 %    \begin{macrocode}
525 \ifmlastyle@times
526   \RequirePackage{times}
527 \fi % \ifmlastyle@times
528 %    \end{macrocode}
529 % \subsection{Macros}
530 % \begin{macro}{\instructor}
531 % Define the instructor, along with an obsolete synonym.
532 %    \begin{macrocode}
533 \def\instructor#1{\gdef\mlastyle@instructor{#1}}
534 \let\professor\instructor
535 %    \end{macrocode}
536 % \end{macro}
537 % \begin{macro}{\course}
538 % Define the course, along with an obsolete synonym.
539 %    \begin{macrocode}
540 \def\course#1{\gdef\mlastyle@course{#1}}
541 \let\classname\course
542 %    \end{macrocode}
543 % \end{macro}
544 % \begin{macro}{\surname}
545 % Define the surname, along with an obsolete synonym.
546 %    \begin{macrocode}
547 \def\surname#1{\gdef\mlastyle@surname{#1}}
548 \def\mlastyle@surname{\def\sw@llow##1 {}\expandafter\sw@llow\@author}
549 \let\lastname\surname
550 %    \end{macrocode}
551 % \end{macro}
552 % \subsection{Formatting}
553 % Formatting is done if the \Lopt{mla} or \Lopt{format} option is set.
554 %    \begin{macrocode}
555 \ifmlastyle@format
556 %    \end{macrocode}
557 % \subsubsection{Macros}
558 % \begin{macro}{\maketitle}
559 % |\maketitle| generates a heading in MLA format.
560 %    \begin{macrocode}
561   \renewcommand{\maketitle}{\begin{flushleft}
562     \@author\par
563     \@ifundefined{mlastyle@instructor}{}{\mlastyle@instructor}\par
564     \@ifundefined{mlastyle@course}{}{\mlastyle@course}\par
565     \@date\end{flushleft}
566     \begin{center}\@title\end{center}\par
567   }
568 %    \end{macrocode}
569 % \end{macro}
570 % \begin{macro}{\today}
571 % |\today| is redefined to DD~Mon.~YYYY format.
572 %    \begin{macrocode}
573 \def\today{\number\day~\ifcase\month\or
574   Jan.\or Feb.\or Mar.\or Apr.\or May\or June\or July\or 
575   Aug.\or Sept.\or Oct.\or Nov.\or Dec.\fi\ \number\year}
576 %    \end{macrocode}
577 % \end{macro}
578 % \begin{macro}{\slash}
579 % No penalty for |\slash|, and plain /'s permit line breaks if necessary.
580 % ^^A\let\mlastyle@sl@sh=/
581 %    \begin{macrocode}
582   \def\slash{/\penalty\z@}
583   \def\mlastyle@slash{/\futurelet\mlastyle@slashnext\mlastyle@slashx}
584   \def\mlastyle@slashx{\ifx\mlastyle@slashnext/\else
585     \penalty\exhyphenpenalty\fi}
586 %    \end{macrocode}
587 % \end{macro}
588 % \begin{macro}{\section}
589 % \begin{macro}{\subsection}
590 % Sections are formatted by centering the section name and beginning a new
591 % page.  Subsections simply center the section name.
592 %    \begin{macrocode}
593   \renewcommand{\section}{\clearpage\@startsection{section}{1}{\z@
594     }{0pt}{1sp}{\centering}}
595   \renewcommand{\subsection}{\@startsection{subsection}{2}{\z@
596     }{0pt}{1sp}{\centering}}
597   \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@
598     }{0pt}{1sp}{\centering}}
599 %    \end{macrocode}
600 % ^^A\let\mlastyle@vfont\verbatim@font
601 % ^^A\def\verbatim@font{\mlastyle@qspread\mlastyle@vfont}
602 % \end{macro}
603 % \end{macro}
604 % \subsubsection{Environments}
605 % ^^A%\newenvironment{blocks}{\begin{quote} \linespread{1} \selectfont}{\end{quote} \linespread{2} \small \selectfont}
606 % ^^A%\newenvironment{blockm}{\begin{quotation} \linespread{1} \selectfont}{\end{quotation} \linespread{2} \selectfont}
607 % \begin{environment}{verse}
608 % Indented 1 inch, with an additional .25 inch hanging indent.
609 %    \begin{macrocode}
610   \renewenvironment{verse}{\list{}{\mlastyle@qspread
611     \advance\leftmargin.75in\itemindent-.25in
612     \listparindent\itemindent}\item\relax}{\endlist}
613 %    \end{macrocode}
614 % \end{environment}
615 % \begin{environment}{quotation}
616 % Indented 1 inch, with a paragraph indent of an additional .25 inches.
617 %    \begin{macrocode}
618   \renewenvironment{quotation}{\list{}{\mlastyle@qspread
619     \advance\leftmargin.5in\itemindent.25in
620     \listparindent\itemindent}\item\relax}{\endlist}
621 %    \end{macrocode}
622 % \end{environment}
623 % \begin{environment}{quote}
624 % Identical to the |quotation| environment, except the first paragraph is not
625 % indented.
626 %    \begin{macrocode}
627   \renewenvironment{quote}{\list{}{\mlastyle@qspread
628     \advance\leftmargin.5in
629     \listparindent.25in}\item\relax}{\endlist}
630 %    \end{macrocode}
631 % \end{environment}
632 % \begin{environment}{workscited}
633 % Works cited environment, for compatibility with \package{mla-paper}.
634 %    \begin{macrocode}
635   \newenvironment{workscited}%
636     {\newpage{\centerline{Works Cited}}}{\newpage}
637   \newcommand{\bibent}{\noindent \hangindent .5in}
638 %    \end{macrocode}
639 % \end{environment}
640 % \subsubsection{Margins}
641 % Top and bottom margins are 1 inch each.  The header is flush with the
642 % right margin at .5 inches from the top of the page.
643 % ^^A\addtolength{\headheight}{-1pt}
644 % ^^A\setlength{\headheight}{1.4\headheight}% kludge
645 %    \begin{macrocode}
646   \addtolength{\voffset}{-0.5in}
647   \setlength{\textheight}{\paperheight}
648   \addtolength{\textheight}{-2in}
649   \setlength{\topmargin}{0in}
650   \setlength\headheight\f@baselineskip
651   \setlength{\headsep}{0.5in}
652   \addtolength{\headsep}{-\headheight}
653   \setlength{\footskip}{0.25in}
654   \raggedbottom
655 %    \end{macrocode}
656 % Left and right margins in MLA format are each 1 inch wide.
657 %    \begin{macrocode}
658   \addtolength{\hoffset}{-0.5in}
659   \setlength{\textwidth}{\paperwidth}
660   \addtolength{\textwidth}{-2in}
661   \setlength{\oddsidemargin}{0.5in}
662   \setlength{\evensidemargin}{0.5in}
663   \setlength{\marginparwidth}{0.5in}
664 %    \end{macrocode}
665 % \subsubsection{Paragraphs}
666 % Paragraphs should be left justified, with the first line indented .5
667 % inches.
668 %    \begin{macrocode}
669   \raggedright
670   \setlength{\parindent}{.5in}
671 %    \end{macrocode}
672 % MLA format specifies that all paragraphs should be indented, even those
673 % beginning a new section.  This snippet from \package{indentfirst} changes
674 % \LaTeX{} to meet that requirement.
675 %    \begin{macrocode}
676   \let\@afterindentfalse\@afterindenttrue
677   \@afterindenttrue
678 %    \end{macrocode}
679 % Double space {\em everywhere}.
680 % ^^A\RequirePackage{doublespace}
681 %    \begin{macrocode}
682   \linespread{2.0}
683   \leftmargini\parindent
684   \def\@listi{\leftmargin\leftmargini
685   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
686   \let\@listI\@listi
687   \@listi
688   \def\@listii{\leftmargin\leftmarginii
689   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
690   \def\@listiii{\leftmargin\leftmarginiii
691   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
692   \def\@listiv{\leftmargin\leftmarginiv
693   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
694   \def\@listv{\leftmargin\leftmarginv
695   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
696   \def\@listvi{\leftmargin\leftmarginvi
697   \parsep\z@\itemsep\z@\topsep -3\p@\relax}
698 %    \end{macrocode}
699 % \subsubsection{Header}
700 % The last name and page number appear on every page, including the first.
701 %    \begin{macrocode}
702   \RequirePackage{fancyhdr}
703   \fancypagestyle{plain}{\fancyhf{}}
704   \fancypagestyle{mlastyle}{
705     \fancyhf{}
706     \rhead{\mlastyle@surname{} \thepage}
707     \renewcommand{\headrulewidth}{0pt}
708     \renewcommand{\footrulewidth}{0pt}}
709   \pagestyle{mlastyle}
710 %    \end{macrocode}
711 % \subsubsection{Notes}
712 % Footnotes should be indented .5 inches; however .56 inches is used
713 % in a crude attempt to compensate for
714 % the alignment provided by the \package{footmisc} package.  Endnotes are
715 % preferred in MLA style anyway, so this should not be a problem in most
716 % circumstances.
717 %    \begin{macrocode}
718   \RequirePackage[ragged,norule]{footmisc}
719   \def\footnotelayout{\linespread{1}\footnotesize\raggedright{} }
720   \footnotemargin .56in
721   \skip\footins=2\baselineskip
722   \footnotesep 1.2\footnotesep
723   \addtolength\footnotesep{\baselineskip}
724   \def\footnotesize{\normalsize}
725 %    \end{macrocode}
726 % ^^A\let\footnoterule\relax
727 % Endnotes are supported, but only if the \package{endnotes} package is
728 % loaded {\em before\/} this package.
729 %    \begin{macrocode}
730   \ifx\@undefined\endnote\else
731     \def\enoteheading{\newpage\section*{\notesname}}
732     \def\enoteformat{\leavevmode\makeenmark{} }
733     \def\enotesize{\normalsize}
734   \fi
735 %    \end{macrocode}
736 % \subsubsection{Bibliography}
737 % \begin{environment}{thebibliography}
738 % The definition of |\thebibliography| varies depending on the document
739 % class.
740 %    \begin{macrocode}
741   \@ifundefined{chapter}
742 %    \end{macrocode}
743 % Article class.
744 %    \begin{macrocode}
745   { \def\thebibliography#1{\newpage\section*{\refname}
746       \list{\@biblabel{\@arabic\c@enumiv}}%
747       {\settowidth\labelwidth{\@biblabel{#1}}}
748       \leftmargin\labelwidth
749       \advance\leftmargin\labelsep
750       \itemindent-\leftmargin
751       \def\newblock{}
752       \usecounter{enumiv}
753       \sloppy%\sfcode`\.=1000\relax
754       \catcode`/=13\let/=\mlastyle@slash}}
755 %    \end{macrocode}
756 % Report/book class.
757 %    \begin{macrocode}
758   { \def\thebibliography#1{\chapter*{\bibname}
759       \list{\@biblabel{\@arabic\c@enumiv}}%
760       {\settowidth\labelwidth{\@biblabel{#1}}}
761       \leftmargin\labelwidth
762       \advance\leftmargin\labelsep
763       \itemindent-\leftmargin
764       \def\newblock{}
765       \usecounter{enumiv}
766       \sloppy%\sfcode`\.=1000\relax
767       \catcode`/=13\let/=\mlastyle@slash}}
768 %    \end{macrocode}
769 % \end{environment}
770 %    \begin{macrocode}
771 \fi % \ifmlastyle@format
772 %    \end{macrocode}
773 % \subsection{Style}
774 % \begin{macro}{\cite}
775 % \begin{macro}{\citeN}
776 % ^^A\begin{macro}{\citepage}
777 % ^^A\begin{macro}{\citequote}
778 % The following macros, combined with \file{mlastyle.bst}, provide
779 % for a bibliography in MLA style.  Note that the definition of |\cite|,
780 % |\citeN|, etc.\ vary depending on the options passed to
781 % \package{mlastyle}.
782 %
783 % \begin{macro}{\mlastyle@intcite}
784 % The original |\cite| is stored
785 % in |\mlastyle@intcite|.
786 %    \begin{macrocode}
787 \let\mlastyle@intcite\cite
788 %    \end{macrocode}
789 % \end{macro}
790 % \begin{macro}{\mlastyle@relax}
791 % This macro does nothing.  Depending on the options, either |\citeC| or
792 % |\citeM| and its ilk will utilize it.
793 %    \begin{macrocode}
794 \newcommand{\mlastyle@relax}[2][]{}
795 %    \end{macrocode}
796 % \end{macro}
797 % \subsubsection{MLA Style}
798 % \begin{macro}{\citeM}
799 % If the \Lopt{mla} or \Lopt{style} options are used, the following is
800 % executed.
801 %    \begin{macrocode}
802 \ifmlastyle@style
803   \def\@cite#1#2{(#1\if@tempswa{} #2\fi)}
804   \def\cite{\def\@cite##1##2{(##1\if@tempswa{}
805     ##2\fi)}\mlastyle@intcite}
806   \def\citeN{\def\@cite##1##2{##1\if@tempswa{}
807     ##2\fi}\mlastyle@intcite}
808   \def\citeM{\def\@cite##1##2{ (##1\if@tempswa{}
809     ##2\fi)}\mlastyle@intcite}
810   \def\citepage{\def\@cite##1##2{\if@tempswa(##2)\fi}\mlastyle@intcite}
811   \def\citepageM{\def\@cite##1##2{\if@tempswa{}
812     (##2)\fi}\mlastyle@intcite}
813   \def\citeindirect{\def\@cite##1##2%
814   {(qtd. in ##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
815   \def\citeindirectM{\def\@cite##1##2%
816   { (qtd. in ##1\if@tempswa{} ##2\fi)}\mlastyle@intcite}
817   \let\citeC\mlastyle@relax
818 %    \end{macrocode}
819 % \end{macro}
820 % \iffalse
821 % Place commas in-between citations in the same |\citeyear|, |\citeyearNP|,
822 % |\citeN|, or |\shortciteN| command.
823 % Use something like |\citeN{ref1,ref2,ref3}| and |\citeN{ref4}| for a list.
824 %
825 % \@citedata and \@citedatax:
826 %  \def\@citedata{%
827 %    \@ifnextchar [{\@tempswatrue\@citedatax}%
828 %                {\@tempswafalse\@citedatax[]}%
829 %  }
830 %  \def\@citedatax[#1]#2{%
831 %  \let\@citea\@empty
832 %  \if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
833 %    \def\@citea{}\@cite{\@for\@citeb:=#2\do%
834 %      {\@citea\def\@citea{; }\@ifundefined% by Young
835 %        {b@\@citeb}{{\bf ?}%
836 %        \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
837 %  {\csname b@\@citeb\endcsname}}}{#1}}%
838 % \fi
839 % \begin{macro}{\@citex}
840 % This is the original |\@citex| from \LaTeX{} modified to use semicolons.
841 %    \begin{macrocode}
842 \def\@citex[#1]#2{%
843   \let\@citea\@empty
844   \@cite{\@for\@citeb:=#2\do
845     {\@citea\def\@citea{;\penalty-1\ }%
846      \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
847      \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
848      \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
849        \G@refundefinedtrue
850        \@latex@warning
851          {Citation `\@citeb' on page \thepage \space undefined}}%
852        {{\csname b@\@citeb\endcsname}}}}{#1}}
853 %    \end{macrocode}
854 % \end{macro}
855 % \begin{macro}{\@biblabel}
856 % No labels in the bibliography.
857 %    \begin{macrocode}
858   \def\@biblabel#1{#1}
859   \labelsep\z@
860   \let\mlastyle@intbib\thebibliography
861   \def\thebibliography#1{\mlastyle@intbib{#1}
862     \itemindent-\leftmargin\def\@biblabel##1{}}
863 %    \end{macrocode}
864 % \end{macro}
865 % Title either the bibliography or the references ``Works Cited,''
866 % depending on the document class.
867 %    \begin{macrocode}
868   \@ifundefined{chapter}
869   {\renewcommand\refname{Works Cited}}
870   {\renewcommand\bibname{Works Cited}}
871 %    \end{macrocode}
872 %
873 % ^^A% Define the command \workscited{bib}{style}{nocite}
874 % ^^A%\newcommand{\workscited}[3]{%
875 % ^^A%  \ifx\chapter\@undefined%
876 % ^^A%    \addcontentsline{toc}{chapter}{\bfseries\bibname}% report style
877 % ^^A%  \else
878 % ^^A%    \addcontentsline{toc}{section}{\bfseries\refname}% article style
879 % ^^A%  \fi
880 % ^^A%  \bibliography{#1}\bibliographystyle{#2}\nocite{#3}}
881 % ^^A% \fi
882 % ^^A\newcommand{\annote}[1]{\begin{list}{}{%
883 % ^^A                \setlength{\labelwidth}{0pt}
884 % ^^A                \addtolength{\leftmargin}{\parindent}
885 % ^^A                \setlength{\labelsep}{0pt}}%
886 % ^^A                \item #1 \end{list}}
887 % \subsubsection{Plain Style}
888 % \begin{macro}{\citeC}
889 % This next block is used if the \Lopt{compat} or \Lopt{format} option is
890 % set.
891 %    \begin{macrocode}
892 \else
893   \newcommand{\mlastyle@cite}[2][]{\@tempswafalse\@citex[]{#2}}
894   \let\cite\mlastyle@cite
895   \let\citepage\mlastyle@cite
896   \let\citeindirect\mlastyle@cite
897   \newcommand{\citeC}[2][]{ \@tempswafalse\@citex[]{#2}}
898   \let\citeM\mlastyle@relax
899   \let\citepageM\mlastyle@relax
900   \let\citeindirectM\mlastyle@relax
901 \fi
902 %    \end{macrocode}
903 % \end{macro}
904 %
905 % ^^A\end{macro}
906 % ^^A\end{macro}
907 % \end{macro}
908 % \end{macro}
909 % \iffalse
910 %</package>
911 % \fi
912 %
913 % \Finale
914 \endinput
915 % vim:tw=74