From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/mlacls/BUGS.md | 16 + macros/latex/contrib/mlacls/LICENSE | 416 ++++++++++++ macros/latex/contrib/mlacls/README.md | 71 +++ macros/latex/contrib/mlacls/mla-example.bib | 19 + macros/latex/contrib/mlacls/mla-example.pdf | Bin 0 -> 2654820 bytes macros/latex/contrib/mlacls/mla-example.tex | 119 ++++ macros/latex/contrib/mlacls/mla.dtx | 948 ++++++++++++++++++++++++++++ macros/latex/contrib/mlacls/mla.ins | 53 ++ macros/latex/contrib/mlacls/mla.pdf | Bin 0 -> 312047 bytes 9 files changed, 1642 insertions(+) create mode 100644 macros/latex/contrib/mlacls/BUGS.md create mode 100644 macros/latex/contrib/mlacls/LICENSE create mode 100644 macros/latex/contrib/mlacls/README.md create mode 100644 macros/latex/contrib/mlacls/mla-example.bib create mode 100644 macros/latex/contrib/mlacls/mla-example.pdf create mode 100644 macros/latex/contrib/mlacls/mla-example.tex create mode 100644 macros/latex/contrib/mlacls/mla.dtx create mode 100644 macros/latex/contrib/mlacls/mla.ins create mode 100644 macros/latex/contrib/mlacls/mla.pdf (limited to 'macros/latex/contrib/mlacls') diff --git a/macros/latex/contrib/mlacls/BUGS.md b/macros/latex/contrib/mlacls/BUGS.md new file mode 100644 index 0000000000..1c5951a368 --- /dev/null +++ b/macros/latex/contrib/mlacls/BUGS.md @@ -0,0 +1,16 @@ +Bugs +==== + +* Not really a bug, but specifying more than one of `mla7`, `mla8` + or `mla8alt` will simply use the last one specified. + Example: options `mla7,mla8alt` will use `mla8alt`, and + `mla8,mla7` will use `mla7`. + This is normal behavior in most classes, but I thought + I ought to specify this somewhere before someone somehow + gets confused. + +Reporting +--------- + +Please report any bugs to the +[issue tracker](https://gitlab.com/ssterling/mlacls/issues). diff --git a/macros/latex/contrib/mlacls/LICENSE b/macros/latex/contrib/mlacls/LICENSE new file mode 100644 index 0000000000..2244313901 --- /dev/null +++ b/macros/latex/contrib/mlacls/LICENSE @@ -0,0 +1,416 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. + diff --git a/macros/latex/contrib/mlacls/README.md b/macros/latex/contrib/mlacls/README.md new file mode 100644 index 0000000000..c2b200f8f2 --- /dev/null +++ b/macros/latex/contrib/mlacls/README.md @@ -0,0 +1,71 @@ +mla.cls +======= + +LaTeX class for MLA papers. + +Abstract +-------- + +In the United States, secondary and undergraduate students +are generally expected to adhere to the format prescribed by +the Modern Language Association (MLA) for typewritten essays, +research papers and writings. +Sadly, the tool of choice is usually Microsoft Word, +even amongst those fluent with TeX. + +Though there *are* some templates and tools to aid in writing +in the MLA format using LaTeX, none fully met the expectations +of the author. +So *voilĂ *, there now exists an `mla.cls` proper: +a simple, straightforward class for composing papers almost +perfectly adherent to the MLA style guide. + +Documentation +------------- + +Documentation and source are combined into a +[`.dtx` file](https://texfaq.org/FAQ-dtx), +as is typical for LaTeX packages. +To read the documentation, run `mla.dtx` through LaTeX: +```console +$ pdflatex mla.dtx +$ gv mla.dtx +``` +(If you're getting this package from [CTAN](https://ctan.org/pkg/mlacls), +a file called `mla.pdf` should already be provided.) + +For an example file, refer to `mla-example.tex` and `mla-example.bib`, +or to the appendix in the documentation. + +Installation +------------ + +Run `mla.ins` through LaTeX: +```console +$ latex mla.ins +``` +Once finished, move the output `mla.cls` to your local +[`texmf` directory](https://texfaq.org/FAQ-privinst). + +Authorship & licensing +---------------------- + +`mlacls` copyright 2019 Seth Price (ssterling AT firemail DOT cc). +Released under the +[LaTeX Project Public License v1.3c](https://www.latex-project.org/lppl/lppl-1-3c/). + +See [`CHANGELOG.md`](./CHANGELOG.md) for version history. + +Contributing +------------ + +Submit a merge request on the +[GitLab repository](https://gitlab.com/ssterling/mlacls/). +I rarely look at the GitHub mirror. + +Bugs +---- + +Refer to [`BUGS.md`](./BUGS.md). +Please report any bugs to the +[issue tracker](https://gitlab.com/ssterling/mlacls/issues). diff --git a/macros/latex/contrib/mlacls/mla-example.bib b/macros/latex/contrib/mlacls/mla-example.bib new file mode 100644 index 0000000000..d725f77e31 --- /dev/null +++ b/macros/latex/contrib/mlacls/mla-example.bib @@ -0,0 +1,19 @@ +@article{que2019, + author = {Suzie Que}, + title = {Notice to all students}, + journaltitle = {Anytown High School Homepage}, + publisher = {County Board of Education}, + date = {2019-04-20}, + howpublished = {Web}, + urldate = {2019-04-21} +} + +@online{price2018, + author = {Seth Price}, + title = {Spruce Knob Overlook}, + publisher = {Instagram}, + date = {2018-07-20}, + howpublished = {Web}, + url = {https://www.instagram.com/p/Bleocv-hknc/}, + urldate = {2019-05-29} +} diff --git a/macros/latex/contrib/mlacls/mla-example.pdf b/macros/latex/contrib/mlacls/mla-example.pdf new file mode 100644 index 0000000000..43abfb7c37 Binary files /dev/null and b/macros/latex/contrib/mlacls/mla-example.pdf differ diff --git a/macros/latex/contrib/mlacls/mla-example.tex b/macros/latex/contrib/mlacls/mla-example.tex new file mode 100644 index 0000000000..8b9d624c3b --- /dev/null +++ b/macros/latex/contrib/mlacls/mla-example.tex @@ -0,0 +1,119 @@ +\documentclass[mla7,microtype]{mla} + +\title{Sample MLA Document} +\author{John Doe} +\professor{Dr. Suzie Que} +\course{\LaTeX\ 101} +\date{\mladate} % see docs for `\mladate' + +% The .bib file (explained later) must be included in the preamble +\addbibresource{mla-example.bib} + +\begin{document} + +\begin{paper} + +This is an example document using ``mla.cls''. +The header is automatically printed upon using the ``paper'' class, +which is why there is no ``\textbackslash{}maketitle''. + +\section{Professors who prefer sections} + +Sometimes, research papers can become unmanageably lengthy. +In that case, section headings can help divide up the ideas +to make it more accessible to the reader. +Though this paper is short, section headings are employed +as an example of the ``mla'' class' capabilities. + +Some professors may explicitly require or denounce use of headings. +Dr. Suzie Que of Anytown, PA requires they be used for anything +longer than five pages: +\begin{blockquote} +John---so help me God---if you turn in another twenty-page research +paper with no logical breaks I will hang you at the stake. +Even though the MLA style guide doesn't say anything about +section headings, they're not actually prohibited. +So, if you turn in \emph{anything} longer than five pages to me +and there isn't a \emph{single} break or section heading, +I will dock your grade to an F. +Capisce? \cite{que2019} +\end{blockquote} +Despite her language, she does have a point to say. + +\subsection{Subsections} + +Alongside regular top-level sections, one can use +``\textbackslash{}subsection'' commands too\endnote{Section commands +in ``mla.cls'' work identical to those of the ``article'' class.}. + +\section{Lists} + +Vertical lists are a rarity in MLA format, but if one so pleases, +they can be used. +The ``itemize'', ``enumerate'' and ``description'' lists +work just as expected, even with sublists. + +\begin{itemize} +\item A bogus item +\item Lorem ipsum dolor sit amet. This item has a bunch of text + just so it covers more than one line in the paper and shows + proper indentation. +\item Last item! +\begin{enumerate} +\item Just kidding; there's a subitem. And it's a number! +\end{enumerate} +\item Okay, now it's the last item. +\end{itemize} + +\section{Figures} + +On rare occasions, you might have to use figures or tables +in your paper. +Good news is the ``figure'' and ``table'' environments +work exactly as expected! +Just make sure to use ``\textbackslash{}begin\{figure\}[H]'' +if you want the image to stay exactly where you put it. +\begin{figure}[H] +\includegraphics[width=0.5\linewidth]{mla-example-image} +\caption{A scene from atop Spruce Knob, West Virginia} +\end{figure} +And yes, I shamelessly used my own image. + +\section{Using endnotes} + +As one may notice, the above subsection used an endnote. +These can simply be cited with +``Yada yada text\textbackslash{}endnote\{more info\ldots\}.'' +Endnotes can be easily printed in correct format by calling +``\textbackslash{}printendnotes'' within the +``notes'' environment. + +\section{Using bibliographies} + +Dr. Suzie Que was cited in the above blockquote. +The ins-and-outs of ``biblatex'' will not be explained in this +document, so please refer to online documentation such as the +``BibLaTeX Cheat Sheet''. + +Just as with the endnotes, +the bibliography can be easily printed in correct format by calling +``\textbackslash{}printbibliography[heading=none]'' within the +``workscited'' environment. +(The ``heading=none'' part is important; the ``workscited'' environment +already prints one.) + +\end{paper} + +\begin{notes} + +\printendnotes + +\end{notes} + +\begin{workscited} + +\printbibliography[heading=none] + +\end{workscited} + +\end{document} diff --git a/macros/latex/contrib/mlacls/mla.dtx b/macros/latex/contrib/mlacls/mla.dtx new file mode 100644 index 0000000000..ba5c6784ab --- /dev/null +++ b/macros/latex/contrib/mlacls/mla.dtx @@ -0,0 +1,948 @@ +% \iffalse meta-comment +% +% Copyright 2019 Seth Price. +% +% This file may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 of this license or any later version. +% The latest version of this license is in: +% +% https://www.latex-project.org/lppl/lppl-1-3c/ +% +% and version 1.3c or later is part of all distributions +% of LaTeX version 2008/05/04 or later. +% +% \fi +% +% \iffalse +% +% \section*{Documentation driver} +% \addcontentsline{toc}{section}{Documentation driver} +% +% \begin{macrocode} +%<*driver> +\ProvidesFile{mla.dtx} +% + +%\NeedsTeXFormat{LaTeX2e} +%\ProvidesClass{mla} +%<*mla> + [2019/05/29 v0.6 MLA Paper Class] +% + +%<*driver> +\documentclass{ltxdoc} +\AtBeginDocument{\RecordChanges\CodelineIndex\EnableCrossrefs} + +%% These bits are some common shorthand I picked up: +\newcommand*{\Dfile}[1]{\texttt{#1}} +\newcommand*{\Dopt}[1]{\textsf{\small #1}} +\newcommand*{\Dctr}[1]{\textsl{\small #1}} +\newcommand*{\Dlst}[1]{\texttt{#1}} +\newcommand*{\Denv}[1]{\texttt{#1}} +\newcommand*{\Dcls}[1]{\textsf{#1}} +\newcommand*{\Dpkg}[1]{\textsf{#1}} + +%% Needed for the appendix +\usepackage{verbatim} + +%% A couple things are cited in the docs +\usepackage{filecontents} +\begin{filecontents}{mla.bib} +@book{mlahb, + author = {{Modern Language Association of America}}, + shortauthor = {{Modern Language Association}}, + title = {The {MLA} Handbook for Writers of Research Papers}, + shorttitle = {Handbook}, + edition = {8}, + year = {2016}, + publisher = {{Modern Language Association of America}}, + howpublished = {Print}, + isbn = {9781603292627} +} +@online{owlmla, + title = {{MLA} General Format}, + journaltitle = {{P}urdue Online Writing Lab}, + institution = {Purdue University}, + howpublished = {Web}, + urldate = {2019-05-06}, + url = {https://owl.purdue.edu/owl/research_and_citation/mla_style/mla_formatting_and_style_guide/mla_general_format.html} +} +@online{owlendnotes, + title = {{MLA} Endnotes and Footnotes}, + journaltitle = {{P}urdue Online Writing Lab}, + institution = {Purdue University}, + howpublished = {Web}, + urldate = {2019-05-06}, + url = {https://owl.purdue.edu/owl/research_and_citation/mla_style/mla_formatting_and_style_guide/mla_endnotes_and_footnotes.html} +} +\end{filecontents} +\usepackage[backend=biber]{biblatex} +\addbibresource{mla.bib} + +%% Just thought it'd be cool to use `acro' +\usepackage{acro} +\DeclareAcronym{US}{short=US,long=United States} +\DeclareAcronym{MLA}{short=MLA,long=Modern Language Association} +\DeclareAcronym{CTAN}{short=CTAN, + long=Comprehensive \TeX\ Archive Network} +\DeclareAcronym{OWL}{short=OWL,long=Purdue Online Writing Lab} +\DeclareAcronym{PDF}{short=PDF,long=Portable Document Format} +\DeclareAcronym{LPPL}{short=LPPL,long=\LaTeX\ Project Public License} +\DeclareAcronym{SE}{short=SE,long=Stack Exchange} + +%% For a few different things +%%\usepackage{semantic-markup} +\usepackage{csquotes} +\newcommand{\foreign}[1]{\textit{#1}} +\newcommand{\term}[1]{\textit{#1}} +\newcommand{\soCalled}[1]{\textquote{#1}} +\newcommand{\mentioned}[1]{\textquote{#1}} + +%% Reset footnotes per page +\usepackage[perpage]{footmisc} + +%% Keep footnotes from breaking across pages +\interfootnotelinepenalty=10000 + +%% Technical info +\def\myemail{ssterling@firemail.cc} + +%% For the sake of consistency, I guess +\GlossaryPrologue{\section{Change history}} + +%% Everything just looks better, in my opinion +\usepackage{microtype} + +%% Fancy PDF +\usepackage[hidelinks]{hyperref} +\hypersetup{ + pdfinfo={ + Title=The MLA class, + Author=Seth Price, + Creator=LaTeX + } +} + +%% Comment this if you don't want to produce a changelog +\AtEndDocument{\PrintChanges} + +\GetFileInfo{mla.dtx} + +\begin{document} +\DocInput{mla.dtx} +\end{document} +% +% \end{macrocode} +% +% \fi +% +% \CheckSum{291} +% +% \CharacterTable +% {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 +% 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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \title{The \Dcls{mla} class\thanks{This document corresponds to +% \Dcls{mla}~\fileversion, dated \filedate.}} +% \author{Seth Price \\ \href{mailto:\myemail}{\texttt{\myemail}}} +% \date{\today} +% +% \maketitle +% +% \begin{abstract} +% In the \acl{US}, secondary and undergraduate students +% are generally expected to adhere to the format prescribed by +% the \ac{MLA} for typewritten essays, research papers and writings. +% Sadly, the tool of choice is usually Microsoft Word, +% even amongst those fluent with \TeX . +% +% Though there \emph{are} some templates and tools to aid in +% writing in the \ac{MLA} format using \LaTeX , +% none fully met the expectations of the author. +% So \foreign{voil\`a}, there now exists an \Dfile{mla.cls} proper: +% a simple, straightforward class for composing papers +% almost perfectly adherent to the +% \ac{MLA} style guide\footfullcite{mlahb}. +% \end{abstract} +% +% \section*{Licensing} +% \label{sec:licensing} +% +% The files contained in this package +% may be distributed and/or modified under the +% conditions of the \ac{LPPL}, either +% version 1.3 of this license or any later version. +% The latest version of this license is in +% \url{https://www.latex-project.org/lppl/lppl-1-3c/}, +% and version 1.3c or later is part of all distributions +% of \LaTeX\ version 2008/05/04 or later. +% +% \microtypesetup{protrusion=false} +% \tableofcontents +% \microtypesetup{protrusion=true} +% +% \StopEventually{} ^^A +% +% \section{Initial code} +% \label{sec:initial_code} +% +% The \Dcls{mla} class uses the \Dcls{article} class as its base. +% Thanks to this, macros such as \cs{textit} or \cs{textsuperscript} +% work as expected and won't have to be re-defined. +% \begin{macrocode} +\LoadClass[letterpaper,12pt]{article} +% \end{macrocode} +% +% \begin{macro}{\mladate} +% The \citetitle{mlahb} requires use of the \term{day month year} +% date format, not \TeX 's standard \term{month day, year}. +% The macro \cs{mladate} will format \cs{today} accordingly +% to be used as the default value for \cs{date} +% (see section~\ref{sec:the_header}). +% +% \changes{v0.2}{2019/05/02}{Added macro} +% \begin{macrocode} +\newcommand{\mladate}{% + \the\day\ + \ifcase\the\month + \or January + \or February + \or March + \or April + \or May + \or June + \or July + \or September + \or October + \or November + \or December + \fi + \the\year +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\MLA@seven} +% \begin{macro}{\MLA@eight} +% \begin{macro}{\MLA@eightalt} +% \begin{macro}{\MLA@microtype} +% The following are true/false switches to toggle certain features. +% +% \begin{macrocode} +\newif\ifMLA@seven +\newif\ifMLA@eight +\newif\ifMLA@eightalt +\newif\ifMLA@microtype +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Options} +% \label{sec:options} +% +% Some teachers and professors might still require using +% the seventh edition of the \citetitle{mlahb}, +% while others will likely use the eighth edition. +% Which edition to implement can be explicitly specified +% with the \Dopt{mla7} and \Dopt{mla8} class options. +% The only difference this makes within the \Dcls{mla} class itself +% is the citation format used by \Dpkg{biblatex}. +% +% \changes{v0.3}{2019/05/06}{Improved options parsing to avoid +% contradiction and undefined behavior} +% \changes{v0.5}{2019/05/21}{Changed options parser to use +% toggle-switch commands in the style of default \LaTeX\ classes} +% \changes{v0.7}{2019/05/30}{Changed options parser to use +% \cs{ifMLA@\ldots} toggle format seen in other classes} +% \begin{macrocode} +\DeclareOption{mla7}{\MLA@seventrue\MLA@eightfalse\MLA@eightaltfalse} +\DeclareOption{mla8}{\MLA@sevenfalse\MLA@eighttrue\MLA@eightaltfalse} +% \end{macrocode} +% +% \changes{v0.3}{2019/05/07}{Added \Dopt{mla8alt} option} +% Some versions of \Dpkg{biblatex-mla} might not recognize +% the \Dopt{style=mla-new} option for the eighth edition. +% In this case, one can specify \Dopt{mla8alt} +% to the \Dcls{mla} class. +% \begin{macrocode} +\DeclareOption{mla8alt}{\MLA@sevenfalse\MLA@eightfalse\MLA@eightalttrue} +% \end{macrocode} +% +% The \Dpkg{microtype} package can be optionally included +% with the \Dopt{microtype} option to offset the pain of using +% the Times typeface. +% \begin{macrocode} +\DeclareOption{microtype}{\MLA@microtypetrue} +% \end{macrocode} +% +% \subsection{Processing} +% \label{sec:processing} +% +% A friendly warning will be provided when an unknown option +% is provided. +% +% \begin{macrocode} +\DeclareOption*{% + \ClassWarning{mla}{Unknown option `\CurrentOption'; ignoring} +} +% \end{macrocode} +% +% By default, the eighth edition of the \citetitle{mlahb} is used. +% To future-proof your documents for upcoming editions, however, +% it may be wise to explicitly specify \Dopt{mla8}. +% +% \begin{macrocode} +\ExecuteOptions{mla8} +\ProcessOptions\relax +% \end{macrocode} +% +% \section{Loading packages} +% \label{sec:loading_packages} +% +% The \Dcls{mla} class requires the following packages\footnote{All +% of the required packages are available for download +% on the \ac{CTAN} if unavailable on your system: +% \url{https://www.ctan.org/}.}: +% +% \changes{v0.3}{2019/05/07}{Replaced obsolete \Dpkg{times} package +% with \Dpkg{newtxtext}} +% \changes{v0.4}{2019/05/11}{Added \Dpkg{microtype} package} +% \changes{v0.4}{2019/05/12}{Added \Dpkg{enumitem} package} +% \changes{v0.6}{2019/05/29}{Added \Dpkg{caption} package} +% \changes{v0.6}{2019/05/29}{Added \Dpkg{graphicx} package} +% \changes{v0.6}{2019/05/29}{Added \Dpkg{float} package} +% \changes{v0.7}{2019/06/01}{Changed \Dpkg{microtype} package +% to only load through \Dopt{microtype} class option} +% \begin{macrocode} +\RequirePackage{caption} +\RequirePackage{enotez} +\RequirePackage{enumitem} +\RequirePackage{fancyhdr} +\RequirePackage{float} +\RequirePackage{fullpage} +\RequirePackage{graphicx} +\RequirePackage{ragged2e} +\RequirePackage{newtxtext} +\RequirePackage{titlesec} +\RequirePackage{xstring} +% \end{macrocode} +% +% The following consists of prerequisites for \Dpkg{biblatex-mla}: +% +% \changes{v0.2}{2019/05/02}{Hid hyperlink boxes in \acs{PDF} output} +% \changes{v0.2}{2019/05/02}{Added support for \acs{PDF} metadata} +% \begin{macrocode} +\RequirePackage[american]{babel} +\RequirePackage{csquotes} +\RequirePackage{hanging} +% \end{macrocode} +% +% And finally, \Dpkg{biblatex}. +% The \Dcls{mla} class options dictate what options are passed to +% \Dpkg{biblatex}, hence the \term{if-then} clauses. +% +% \begin{macrocode} +\ifMLA@seven + \RequirePackage[style=mla,noremoteinfo=false,showmedium=true, + backend=biber]{biblatex} +\fi +\ifMLA@eight + \RequirePackage[style=mla-new,noremoteinfo=false, + showmedium=false,backend=biber]{biblatex} +\fi +\ifMLA@eightalt + \RequirePackage[style=mla,noremoteinfo=false, + showmedium=false,backend=biber]{biblatex} +\fi +% \end{macrocode} +% +% The \Dpkg{microtype} package is loaded if the \Dopt{microtype} +% option is specified. +% +% \begin{macrocode} +\ifMLA@microtype + \RequirePackage{microtype} +\fi +% \end{macrocode} +% +% For some reason, common practice is to load \Dpkg{hyperref} last +% of all packages. +% +% \begin{macrocode} +\RequirePackage{hyperref} +\hypersetup{hidelinks,pdfusetitle} +% \end{macrocode} +% +% \section{Document layout} +% \label{sec:document_layout} +% +% \subsection{Font} +% \label{sec:font} +% +% The \Dpkg{newtxtext} package was already loaded in +% section~\ref{sec:loading_packages}, +% and the font was set to 12pt when loading the \Dcls{article} class +% in section~\ref{sec:initial_code}. +% This should be metric-compatible with the infamous Times New Roman, +% the \foreign{de facto} standard of the +% \ac{MLA} format\footnote{According to the popular, oft-referenced +% \ac{OWL}: \citeurl{owlmla}.}. +% +% \subsubsection{Microtype} +% \label{sec:microtype} +% +% The \Dpkg{microtype} package (if loaded as in +% section~\ref{sec:loading_packages}) +% will marginally offset the burden of using Times +% by correcting its ugly kerning and tracking. +% The vague \Dopt{activate=false} below simply disables +% protrusion, maintaining original line and page breaks. +% +% \changes{v0.4}{2019/05/12}{Disabled \Dpkg{microtype} protrusion} +% \begin{macrocode} +\ifMLA@microtype + \microtypesetup{activate=false} +\fi +% \end{macrocode} +% +% \subsection{Line breaking and spacing} +% \label{sec:line_breaking} +% +% The \citetitle{mlahb} prescribes exact double-spacing, +% the definition of which varies between typesetters. +% With these parameters exact, \LaTeX\ produces 23 lines of text +% whereas the \soCalled{industry standard} +% Microsoft Word\footnote{Microsoft Word 97 through 2016, +% and likely following versions as well.} produces 24. +% To compensate, line spacing is set to \emph{just enough}: +% +% \changes{v0.4}{2019/05/08}{Changed \cs{linespacing} to +% print 24 lines per page} +% \begin{macrocode} +\linespread{1.905} +% \end{macrocode} +% +% Though not explicitly denounced in the \citetitle{mlahb}, +% most \ac{MLA}-style papers don't hyphenate or adjust spacing +% for pretty typesetting. +% +% \begin{macrocode} +\hyphenpenalty=10000 +\pretolerance=10000 +% \end{macrocode} +% +% \subsection{Paragraphing} +% \label{sec:paragraphing} +% +% The \citetitle{mlahb} specifies half-inch first-line indentation +% for every paragraph and no extra spacing in between. +% +% \begin{macro}{\MLA@indent} +% \changes{v0.7}{2019/06/05}{Added macro} +% In case the indent should be changed, several other macros relying +% on it might be broken. +% Using an internal like \cs{MLA@indent} prevents this. +% +% \begin{macrocode} +\newlength{\MLA@indent} +\setlength{\MLA@indent}{0.5in} +% \end{macrocode} +% \end{macro} +% +% +% \changes{v0.6}{2019-05-29}{Explicitly set \cs{partopset} to 0pt} +% \begin{macrocode} +\setlength{\parindent}{\MLA@indent} +\setlength{\RaggedRightParindent}{\MLA@indent} +\setlength{\parskip}{0em} +\setlength{\topsep}{0em} +\setlength{\partopsep}{0em} +% \end{macrocode} +% +% \TeX\ does not indent the first paragraph after headings by default. +% Thankfully, the fix for this is simple. +% +% \changes{v0.7}{2019/05/31}{Copied code from \Dpkg{indentfirst} +% to reduce dependency count} +% \begin{macrocode} +\let\@afterindentfalse\@afterindenttrue +\@afterindenttrue +% \end{macrocode} +% +% And, for the sake of consistent 24-line papers, +% orphans and widows are explicitly allowed. +% +% \begin{macrocode} +\widowpenalty=0 +\clubpenalty=0 +\interlinepenalty=0 +% \end{macrocode} +% +% For a final heinous crime against typesetting, +% the \citetitle{mlahb} advises flush-left/ragged-right alignment. +% (This is acheived with the \Dpkg{ragged2e} package.) +% +% \begin{macrocode} +\RaggedRight +% \end{macrocode} +% +% \begin{environment}{noindent} +% The \Denv{noindent} environment doesn't work as expected +% in conjunction with \Dpkg{ragged2e}, hence the re-definition. +% +% \begin{macrocode} +\renewenvironment{noindent}{% + \edef\tmpind{\parindent} + \setlength{\parindent}{0pt} +}{% + \setlength{\parindent}{\tmpind} + \undef{\tmpind} +} +% \end{macrocode} +% \end{environment} +% +% \subsection{Page layout} +% \label{sec:page_layout} +% +% With few exceptions, the \ac{US} uses \soCalled{letter-size} paper. +% The paper size was already set when loading the \Dcls{article} class +% in section~\ref{sec:initial_code}. +% +% Furthermore, the \citetitle{mlahb} dictates uniform one-inch margins +% on said paper. +% This was already set by the \Dpkg{fullpage} package as loaded +% in section~\ref{sec:loading_packages}. +% The \cs{textheight} and \cs{textwidth} definitions are here +% just for good measure. +% +% \begin{macrocode} +\setlength{\textheight}{9in} +\setlength{\textwidth}{6.5in} +% \end{macrocode} +% +% \subsection{Running head} +% \label{sec:running_head} +% +% The running head in \ac{MLA} style is simply the author's surname +% followed by the current page number, right-aligned. +% This is managed using the \Dpkg{fancyhdr} and \Dpkg{xstring} packages. +% +% \begin{macrocode} +\fancypagestyle{norule}{% + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0pt} +} +\fancyhf{} +\pagestyle{headings} +\pagestyle{norule} +\fancyhead[RO]{{\StrBehind{\@author}{ }[\last]\last} \thepage} +% \end{macrocode} +% +% The following code is largely a hack to align the header +% in the middle of the one-inch margin above the body text. +% +% \begin{macrocode} +\setlength{\headheight}{18pt} +\setlength{\headsep}{12pt} +\setlength{\voffset}{-34pt} +% \end{macrocode} +% +% \section{Document markup} +% \label{sec:document_markup} +% +% \subsection{The header} +% \label{sec:the_header} +% +% \begin{macro}{\title} +% \begin{macro}{\author} +% \begin{macro}{\date} +% The \cs{title}, \cs{author} and \cs{date} macros work as expected. +% However, if your surname contains a space, you must contain the +% surname in braces as such: +% {\small |\author{Ludwig {van Beethoven}}|}. +% This keeps the full surname in the running head (see +% section~\ref{sec:running_head}). +% \end{macro} +% \end{macro} +% \end{macro} +% +% The following header commands are unique to the \Dcls{mla} class. +% +% \begin{macro}{\professor} +% The instructor who assigned the paper, i.e. +% \mentioned{Dr. Marjorie Stewart}. +% +% \begin{macrocode} +\newcommand*{\professor}[1]{\gdef\@professor{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\course} +% The course for which this paper was assigned, i.e. +% \mentioned{ENGL 101-02}. +% +% \begin{macrocode} +\newcommand*{\course}[1]{\gdef\@course{#1}} +% \end{macrocode} +% \end{macro} +% +% To prevent undefined behavior, the internal macros used +% to store the above information are set empty, except for \cs{date}. +% (Note the use of \cs{mladate}; see section~\ref{sec:initial_code}.) +% +% \begin{macrocode} +\title{} +\author{} +\professor{} +\course{} +\date{\mladate} +% \end{macrocode} +% +% \begin{macro}{\makemlaheader} +% This command finally prints out the standard four-line +% \ac{MLA} header, as well as the title. +% +% \changes{v0.2}{2019/05/02}{Changed date format to +% \term{day month year}} +% \changes{v0.4.1}{2019/05/15}{Changed date format back to whatever +% is inside \cs{@date}} +% \begin{macrocode} +\newcommand{\makemlaheader}{% + \begin{noindent} + \@author \\ + \@professor \\ + \@course \\ + \@date \\ + \begin{center}\@title\end{center} + \end{noindent} +} +% \end{macrocode} +% \end{macro} +% +% For simplicity's sake, \cs{maketitle} is directly aliased +% to \cs{makemlaheader}. +% +% \begin{macrocode} +\renewcommand{\maketitle}{\makemlaheader} +% \end{macrocode} +% +% Finally, the header will print at the beginning of every document. +% +% \changes{v0.5}{2019/05/18}{Moved header-printing process to +% \cs{AtBeginDocument}} +% \begin{macrocode} +\AtBeginDocument{\maketitle} +% \end{macrocode} +% +% \subsection{Sectioning} +% \label{sec:sectioning} +% +% \begin{macro}{\section} +% \changes{v0.2}{2019/05/02}{Changed heading to small-caps} +% \begin{macro}{\subsection} +% \changes{v0.2}{2019/04/27}{Properly formatted} +% \changes{v0.2}{2019/05/02}{Changed heading to small-caps} +% \begin{macro}{\subsubsection} +% \changes{v0.2}{2019/04/27}{Properly formatted} +% \changes{v0.2}{2019/05/02}{Changed heading to small-caps} +% Section headings are neither defined nor discouraged +% in the \citetitle{mlahb}, though commonly used in longer papers. +% Customary section headings are rather straightforward, +% consisting of the section number in Arabic numerals, a space, +% and the section name with no special decoration\footnote{According to +% the popular, oft-referenced \ac{OWL}: \citeurl{owlmla}.}. +% +% However, for the sake of clarity, the section headings in this class +% will be set in small-caps. +% +% \begin{macrocode} +\renewcommand{\thesection}{\@arabic\c@section} +\renewcommand{\thesubsection}{\thesection.\@arabic\c@subsection} +\renewcommand{\thesubsubsection}{\thesubsection.\@arabic\c@subsubsection} +% \end{macrocode} +% +% Un-fancifying the headings is acheived using +% the \Dpkg{titlesec} package. +% +% \begin{macrocode} +\titleformat*{\section}{\normalsize\sc} +\titleformat*{\subsection}{\normalsize\sc} +\titleformat*{\subsubsection}{\normalsize\sc} +\titlespacing*{\section}{0pt}{0pt}{0pt} +\titlespacing*{\subsection}{0pt}{0pt}{0pt} +\titlespacing*{\subsubsection}{0pt}{0pt}{0pt} +\titlelabel{\thetitle. } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Lists} +% \label{sec:lists} +% +% \begin{environment}{itemize} +% \changes{v0.4}{2019/05/12}{Added list type} +% \begin{environment}{enumerate} +% \changes{v0.4}{2019/05/12}{Added list type} +% \changes{v0.7}{2019/06/05}{Changed length to use \cs{MLA@indent}} +% To the user, \Dlst{itemize} and \Dlst{enumerate} lists +% will function exactly as expected. +% However, the formatting of the lists must be modified as to +% preserve double-spacing and adhere to +% common practice\footnote{According to the \ac{MLA} itself: +% \url{https://style.mla.org/vertical-lists-in-mla-style/}.}; +% these changes are acheived using the \Dpkg{enumitem} package. +% +% \begin{macrocode} +\setlist[itemize]{% + parsep=0pt, + itemsep=0pt, + topsep=0pt, + leftmargin=\MLA@indent +} +\setlist[enumerate]{% + parsep=0pt, + itemsep=0pt, + topsep=0pt, + leftmargin=\MLA@indent +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsection{Block quotation} +% \label{sec:block_quoatation} +% +% \begin{environment}{blockquote} +% The \citetitle{mlahb} dictates blockquotes be set flush a half-inch +% from the left margin with no extra space on the right. +% The existing \Denv{blockquote} environment is re-defined +% for this purpose. +% +% \changes{v0.2}{2019/04/28}{Countered unexplained vertical space +% after environment} +% \changes{v0.7}{2019/06/05}{Changed length to use \cs{MLA@indent}} +% \begin{macrocode} +\renewenvironment{blockquote}{% + \list{}{\leftmargin \MLA@indent} + \item[] + \setlength{\parindent}{\MLA@indent} + \vspace{-\topsep} +}{% + \endlist + \vspace{-\topsep} +} +% \end{macrocode} +% \end{environment} +% +% \subsection{Figures and tables} +% \label{sec:figures} +% +% The \citetitle{mlahb} doesn't specify much of anything about +% the actual formatting of figures or tables or their captions, +% so the following is mostly based on the package author's +% personal preference and observations. +% +% \begin{environment}{figure} +% \changes{v0.6}{2019/05/29}{Properly formatted} +% \begin{environment}{table} +% \changes{v0.6}{2019/05/29}{Properly formatted} +% +% Centered figures with margins the equivalent of one line of text +% seems customary and logical. +% +% \begin{macrocode} +\setlength{\floatsep}{\baselineskip} +\setlength{\intextsep}{\baselineskip} +\setlength{\textfloatsep}{\baselineskip} +\g@addto@macro\@floatboxreset\centering +% \end{macrocode} +% +% Thanks to a bug inherited from the \Dpkg{here} package +% which has remained unfixed since 1987\footnote{See the \cs{par} +% on p. 11, line 249 of \Dfile{ltfloat.dtx} from the \LaTeX\ kernel.}, +% there is not only extra space after the figure but the inability to +% insert a figure within a paragraph. +% Miraculously, there is a fix for this\footnote{See David Carlisle's +% answer on \TeX\ \acs{SE}: +% \url{https://tex.stackexchange.com/a/310793}}. +% +% \begin{macrocode} +\renewcommand{\float@endH}{% + \vspace{-12pt} + \@endfloatbox\vskip\intextsep + \if@flstyle\setbox\@currbox\float@makebox\columnwidth\fi + \box\@currbox\vskip\intextsep\relax\@doendpe +} +% \end{macrocode} +% +% \end{environment} +% \end{environment} +% +% \begin{environment}{caption} +% \changes{v0.6}{2019/05/29}{Properly formatted} +% +% Un-fancifying the caption is acheived using the +% \Dpkg{caption} package. +% +% \begin{macrocode} +\captionsetup{% + font={normalfont}, + labelformat=simple, + labelsep=period, + position=bottom, + aboveskip=6pt, + belowskip=-10pt +} +% \end{macrocode} +% +% In the author's personal experience, most \ac{MLA}-style papers +% use \mentioned{Fig.} and not \mentioned{Figure}. +% +% \begin{macrocode} +\captionsetup[figure]{name=Fig.} +% \end{macrocode} +% +% \end{environment} +% +% \subsection{Paper sections} +% \label{sec:paper_sections} +% +% \subsubsection{Paper} +% \label{sec:paper_env} +% +% \begin{environment}{paper} +% The main content; the body. +% This environment exists only for a logical division and does +% nothing special. +% +% \changes{v0.5}{2019/05/18}{Removed \cs{newpage}} +% \begin{macrocode} +\newenvironment{paper}{}{} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Endnotes} +% \label{sec:endnotes} +% +% \begin{environment}{notes} +% Endnotes can be typeset manually or with the supported +% \Dpkg{enotez} package\footnote{Refer to the \Dpkg{enotez} +% documentation for instructions.}. +% +% \changes{v0.2}{2019/04/28}{Added environment} +% \changes{v0.2}{2019/04/28}{Countered unexplained vertical space +% after heading} +% \changes{v0.4}{2019/05/12}{Changed endnotes list type to +% custom \Dlst{mlaendnotes} list} +% \changes{v0.4}{2019/05/12}{Changed default endnotes format +% to \Dlst{mla}} +% \changes{v0.4}{2019/05/12}{Removed extra \cs{vspace}} +% \changes{v0.5}{2019/05/18}{Moved \cs{newpage} to beginning of environment} +% \changes{v0.7}{2019/06/05}{Changed length to use \cs{MLA@indent}} +% \begin{macrocode} +\newenvironment{notes}{% + \newpage + \begin{noindent} + \pdfbookmark[0]{Notes}{notes} + \begin{center}Notes\end{center} + \end{noindent} +}{} +% \end{macrocode} +% \end{environment} +% +% To correctly format endnotes per common practice\footnote{According +% to the popular, oft-referenced \ac{OWL}: \citeurl{owlendnotes}.}, +% a custom \Dlst{mlanotes} list type will be created. +% This is acheived with the \Dpkg{enumitem} package. +% +% \begin{macrocode} +\newlist{mlanotes}{description}{1} +\setlist[mlanotes]{% + parsep=0pt, + itemsep=0pt, + topsep=0pt, + leftmargin=\MLA@indent +} +% \end{macrocode} +% +% The following initializes the \Dpkg{enotez} package to use +% the \Dlst{mlanotes} list format. +% +% \begin{macrocode} +\DeclareInstance{enotez-list}{mla}{list}{% + heading = {}, + format = \normalsize\normalfont, + list-type = mlanotes +} +\setenotez{list-name={},list-style=mla,backref} +% \end{macrocode} +% +% \subsubsection{Bibliography} +% \label{sec:bibliography} +% +% \begin{environment}{workscited} +% The bibliography can be typeset manually or with the supported +% \Dpkg{biblatex} package\footnote{Refer to the \Dpkg{biblatex} +% documentation for instructions.}. +% +% \changes{v0.2}{2019/04/28}{Countered unexplained vertical space +% after heading} +% \changes{v0.5}{2019/05/18}{Moved \cs{newpage} to beginning of environment} +% \changes{v0.7}{2019/06/05}{Changed length to use \cs{MLA@indent}} +% \begin{macrocode} +\newenvironment{workscited}{% + \newpage + \begin{noindent} + \pdfbookmark[0]{Works Cited}{workscited} + \begin{center}Works Cited\end{center} + \end{noindent} + \vspace{-16pt} % XXX to counter unexplained space +}{} +% \end{macrocode} +% \end{environment} +% +% The \citetitle{mlahb} prescribes a half-inch hanging indent +% on all bibliography entries. +% This is achieved by setting the \cs{bibhang} length +% defined by the \Dpkg{biblatex} package. +% +% \begin{macrocode} +\setlength{\bibhang}{\MLA@indent} +% \end{macrocode} +% +% \appendix +% \section{Example usage} +% \label{sec:example_usage} +% +% Following is a basic \LaTeX\ document using the \Dcls{mla} class. +% The document is composed of a text file, \Dfile{mla-example.tex}, +% and a \Dpkg{biblatex} bibliography file, \Dfile{mla-example.bib}. +% +% \subsection{\Dfile{mla-example.tex}} +% \label{sec:mla-example.tex} +% +% \verbatiminput{mla-example.tex} +% +% \subsection{\Dfile{mla-example.bib}} +% \label{sec:mla-example.bib} +% +% \verbatiminput{mla-example.bib} +% +% \Finale +\endinput diff --git a/macros/latex/contrib/mlacls/mla.ins b/macros/latex/contrib/mlacls/mla.ins new file mode 100644 index 0000000000..192ad095f4 --- /dev/null +++ b/macros/latex/contrib/mlacls/mla.ins @@ -0,0 +1,53 @@ +%% vim: set ft=tex: +%% +%% Copyright 2019 Seth Price. +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or any later version. +%% The latest version of this license is in: +%% +%% https://www.latex-project.org/lppl/lppl-1-3c/ +%% +%% and version 1.3c or later is part of all distributions +%% of LaTeX version 2008/05/04 or later. +%% + +\input docstrip.tex + +%\usedir{tex/latex/mla} + +\preamble + +This is a generated file. + +Copyright 2019 Seth Price + +This file may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or any later version. +The latest version of this license is in: + + https://www.latex-project.org/lppl/lppl-1-3c/ + +and version 1.3c or later is part of all distributions +of LaTeX version 2008/05/04 or later. + +\endpreamble + +\generate{\file{mla.cls}{\from{mla.dtx}{mla}}} + +\obeyspaces +\Msg{****************************************************} +\Msg{* *} +\Msg{* To finish installation, move the file `mla.cls` *} +\Msg{* into a directory searchable by LaTeX. *} +\Msg{* *} +\Msg{* To produce documentation, run the file `mla.dtx' *} +\Msg{* through LaTeX. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{****************************************************} + +\endbatchfile diff --git a/macros/latex/contrib/mlacls/mla.pdf b/macros/latex/contrib/mlacls/mla.pdf new file mode 100644 index 0000000000..2fb4f09ee6 Binary files /dev/null and b/macros/latex/contrib/mlacls/mla.pdf differ -- cgit v1.2.3