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