%%
%% This is file `mla.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mla.dtx  (with options: `mla')
%% 
%% 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.
%% 

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mla}
    [2019/05/07 v0.3 MLA Paper Class]

\LoadClass[letterpaper,12pt]{article}
\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
}
\DeclareOption{mla7}{\def\@optMlaSeven}
\DeclareOption{mla8}{\def\@optMlaEight}
\DeclareOption{mla8alt}{\def\@optMlaEightAlt}
\DeclareOption*{%
    \ClassWarning{mla}{Unknown option `\CurrentOption'; ignoring}
}
\ExecuteOptions{mla8}
\ProcessOptions\relax
\RequirePackage{enotez}
\RequirePackage{fancyhdr}
\RequirePackage{fullpage}
\RequirePackage{indentfirst}
\RequirePackage{ragged2e}
\RequirePackage{newtxtext}
\RequirePackage{titlesec}
\RequirePackage{xstring}
\RequirePackage[american]{babel}
\RequirePackage{csquotes}
\RequirePackage{hanging}
\RequirePackage[hidelinks,pdfusetitle]{hyperref}
\ifdefined\@optMlaSeven
    \RequirePackage[style=mla,noremoteinfo=false,showmedium=true,
                    backend=biber]{biblatex}
\else
    \ifdefined\@optMlaEightAlt
        \RequirePackage[style=mla,noremoteinfo=false,
                        showmedium=false,backend=biber]{biblatex}
    \else\ifdefined\@optMlaEight
        \RequirePackage[style=mla-new,noremoteinfo=false,
                        showmedium=false,backend=biber]{biblatex}
    \fi\fi
\fi
\linespread{1.99}
\hyphenpenalty 10000
\pretolerance 10000
\setlength{\parindent}{0.5in}
\setlength{\RaggedRightParindent}{\parindent}
\setlength{\parskip}{0em}
\setlength{\topsep}{0em}
\widowpenalty 0
\clubpenalty 0
\interlinepenalty 0
\RaggedRight
\renewenvironment{noindent}{%
    \edef\tmpind{\parindent}
    \setlength{\parindent}{0pt}
}{%
    \setlength{\parindent}{\tmpind}
    \undef{\tmpind}
}
\setlength{\textheight}{9in}
\setlength{\textwidth}{6.5in}
\fancypagestyle{norule}{%
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}
\fancyhf{}
\pagestyle{headings}
\pagestyle{norule}
\fancyhead[RO]{{\StrBehind{\@author}{ }[\last]\last} \thepage}
\setlength{\headheight}{18pt}
\setlength{\headsep}{12pt}
\setlength{\voffset}{-34pt}
\newcommand*{\professor}[1]{\gdef\@professor{#1}}
\newcommand*{\course}[1]{\gdef\@course{#1}}
\title{}
\author{}
\professor{}
\course{}
\date{\today}
\newcommand{\makemlaheader}{%
    \begin{noindent}
        \@author \\
        \@professor \\
        \@course \\
        \mladate \\
        \begin{center}\@title\end{center}
    \end{noindent}
}
\renewcommand{\maketitle}{\makemlaheader}
\renewcommand{\thesection}{\@arabic\c@section}
\renewcommand{\thesubsection}{\thesection.\@arabic\c@subsection}
\renewcommand{\thesubsubsection}{\thesubsection.\@arabic\c@subsubsection}
\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. }
\renewenvironment{blockquote}{%
    \list{}{\leftmargin 0.5in}
    \item[]
    \setlength{\parindent}{0.5in}
    \vspace{-\topsep}
}{%
    \endlist
    \vspace{-\topsep}
}
\newenvironment{paper}{%
    \makemlaheader
}{%
    \newpage
}
\newenvironment{notes}{%
    \begin{noindent}
        \pdfbookmark[0]{Notes}{notes}
        \begin{center}Notes\end{center}
    \end{noindent}
    \vspace{-16pt} % XXX to counter unexplained space
}{%
    \newpage
}
\setenotez{list-name={}}
\DeclareInstance{enotez-list}{mla}{list}{%
    heading = {},
    format = \normalsize\normalfont,
    list-type = description
}
\newenvironment{workscited}{%
    \begin{noindent}
        \pdfbookmark[0]{Works Cited}{workscited}
        \begin{center}Works Cited\end{center}
    \end{noindent}
    \vspace{-16pt} % XXX to counter unexplained space
}{%
    \newpage
}
\setlength{\bibhang}{\parindent}
\endinput
%%
%% End of file `mla.cls'.
