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