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