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