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