diff options
author | Karl Berry <karl@freefriends.org> | 2020-11-07 22:02:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-11-07 22:02:21 +0000 |
commit | 0e8cdbd09e6e38a97b7b46dc59f16092694276ff (patch) | |
tree | ce038919be4a770de8a359031d0731d95214dd20 /Master/texmf-dist/source | |
parent | 6cdef7b2569f67661d5b2cb99e317da16a7603e9 (diff) |
mlacls (7nov20)
git-svn-id: svn://tug.org/texlive/trunk@56874 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/mlacls/mla.dtx | 265 |
1 files changed, 196 insertions, 69 deletions
diff --git a/Master/texmf-dist/source/latex/mlacls/mla.dtx b/Master/texmf-dist/source/latex/mlacls/mla.dtx index cefa444991a..2ea31fb52fc 100644 --- a/Master/texmf-dist/source/latex/mlacls/mla.dtx +++ b/Master/texmf-dist/source/latex/mlacls/mla.dtx @@ -27,7 +27,7 @@ %<mla>\NeedsTeXFormat{LaTeX2e} %<mla>\ProvidesClass{mla} %<*mla> - [2020/08/16 v0.8 MLA Paper Class] + [2020/11/07 v0.9 MLA Paper Class] %</mla> %<*driver> @@ -47,7 +47,6 @@ \usepackage{verbatim} %% A couple things are cited in the docs -\usepackage{filecontents} \begin{filecontents}{mla.bib} @book{mlahb, author = {{Modern Language Association of America}}, @@ -92,12 +91,7 @@ \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}} +\usepackage{semantic-markup} %% Reset footnotes per page \usepackage[perpage]{footmisc} @@ -106,7 +100,7 @@ \interfootnotelinepenalty=10000 %% Technical info -\def\myemail{ssterling@firemail.cc} +\def\myemail{sprice623@aol.com} %% For the sake of consistency, I guess \GlossaryPrologue{\section{Change history}} @@ -137,7 +131,7 @@ % % \fi % -% \CheckSum{299} +% \CheckSum{401} % % \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 @@ -240,19 +234,37 @@ % \begin{macro}{\MLA@seven} % \begin{macro}{\MLA@eight} % \begin{macro}{\MLA@eightalt} +% \begin{macro}{\MLA@figures} +% \begin{macro}{\MLA@notes} % \begin{macro}{\MLA@microtype} +% \begin{macro}{\MLA@paperheader} +% \begin{macro}{\MLA@pageheader} +% \begin{macro}{\MLA@plainheadings} +% \begin{macro}{\MLA@fullpage} % The following are true/false switches to toggle certain features. % % \begin{macrocode} \newif\ifMLA@seven \newif\ifMLA@eight \newif\ifMLA@eightalt +\newif\ifMLA@figures +\newif\ifMLA@notes \newif\ifMLA@microtype +\newif\ifMLA@paperheader +\newif\ifMLA@pageheader +\newif\ifMLA@plainheadings +\newif\ifMLA@fullpage % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \section{Options} % \label{sec:options} @@ -285,6 +297,17 @@ \DeclareOption{mla8alt}{\MLA@sevenfalse\MLA@eightfalse\MLA@eightalttrue} % \end{macrocode} % +% For those who do not plan on using figures and/or footnotes, +% some time (and dependency disk space) might be saved by using the +% \Dopt{nofigures} and/or \Dopt{nonotes} options, as they are enabled +% by default. +% \begin{macrocode} +\MLA@figurestrue +\MLA@notestrue +\DeclareOption{nofigures}{\MLA@figuresfalse} +\DeclareOption{nonotes}{\MLA@notesfalse} +% \end{macrocode} +% % The \Dpkg{microtype} package can be optionally included % with the \Dopt{microtype} option to offset the pain of using % the Times typeface. @@ -292,6 +315,43 @@ \DeclareOption{microtype}{\MLA@microtypetrue} % \end{macrocode} % +% \changes{v0.9}{2020/10/05}{Added \Dopt{nopaperheader}, +% \Dopt{nopageheader} and \Dopt{noheaders} options to enable +% omission of paper headers, page headers or both paper +% and page headers respectively} +% For rare cases in which the paper and page headers are omitted +% or must be custom, the options \Dopt{nopaperheader} and +% \Dopt{nopageheader} may be used respectively, or +% \Dopt{noheaders} to omit both. +% \begin{macrocode} +\MLA@paperheadertrue +\MLA@pageheadertrue +\DeclareOption{nopaperheader}{\MLA@paperheaderfalse} +\DeclareOption{nopageheader}{\MLA@pageheaderfalse} +\DeclareOption{noheaders}{\MLA@paperheaderfalse\MLA@pageheaderfalse} +% \end{macrocode} +% +% \changes{v0.9}{2020/10/05}{Added \Dopt{plainheadings} option to +% forego small-caps and auto-numbering in section headings} +% For professors and/or writers who desire to format the section +% headings manually and individually (and forego \cs{titleformat\{\}}, +% the \Dopt{plainheadings} option may be used. +% \begin{macrocode} +\MLA@plainheadingsfalse +\DeclareOption{plainheadings}{\MLA@plainheadingstrue} +% \end{macrocode} +% +% \changes{v0.9}{2020/11/07}{Added \Dopt{fullpage} option to explicitly +% allow widows and orphans} +% Another edge case is in which a professor may require strict 24-line +% papers, i.\,e.\ explicitly allowing orphans and widows, enabled using +% the \Dopt{fullpage} option\footnote{In versions of \Dcls{mlacls} +% prior to v0.9, disallowing widows and orphans was default behavior.}. +% \begin{macrocode} +\MLA@fullpagefalse +\DeclareOption{fullpage}{\MLA@fullpagetrue} +% \end{macrocode} +% % \subsection{Processing} % \label{sec:processing} % @@ -330,14 +390,12 @@ % \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} +% \changes{v0.9}{2020/08/20}{Added \Dopt{nofigures} and \Dopt{nonotes} +% options to prevent loading unused dependencies} % \begin{macrocode} -\RequirePackage{caption} -\RequirePackage{enotez} \RequirePackage{enumitem} \RequirePackage{fancyhdr} -\RequirePackage{float} \RequirePackage{fullpage} -\RequirePackage{graphicx} \RequirePackage{ragged2e} \RequirePackage{newtxtext} \RequirePackage{titlesec} @@ -373,6 +431,27 @@ \fi % \end{macrocode} % +% The \Dpkg{caption}, \Dpkg{float} and \Dpkg{graphicx} packages +% are loaded by default, but can be disabled using the +% \Dopt{nofigures} option. +% +% \begin{macrocode} +\ifMLA@figures + \RequirePackage{caption} + \RequirePackage{float} + \RequirePackage{graphicx} +\fi +% \end{macrocode} +% +% Likewise, the \Dpkg{enotez} package can be disabled with +% \Dopt{nonotes}. +% +% \begin{macrocode} +\ifMLA@notes + \RequirePackage{enotez} +\fi +% \end{macrocode} +% % The \Dpkg{microtype} package is loaded if the \Dopt{microtype} % option is specified. % @@ -473,16 +552,24 @@ \@afterindenttrue % \end{macrocode} % -% And, for the sake of consistent 24-line papers, -% orphans and widows are explicitly allowed. +% Orphans and widows are explicitly banned\footnote{According to the +% \ac{MLA} itself: \url{https://style.mla.org/orphaned-words/}}. +% For the odd case in which papers must be consistently 24 lines +% (i.\,e.\ explicitly allowing orphans and widows), the +% \Dopt{fullpage} option may be used (see section~\ref{sec:options}). % % \begin{macrocode} -\widowpenalty=0 -\clubpenalty=0 -\interlinepenalty=0 +\ifMLA@fullpage + \widowpenalty=0 + \clubpenalty=0 + \interlinepenalty=0 +\else + \widowpenalty=10000 + \clubpenalty=10000 +\fi % \end{macrocode} % -% For a final heinous crime against typesetting, +% As a heinous crime against the art of typesetting, % the \citetitle{mlahb} advises flush-left/ragged-right alignment. % (This is acheived with the \Dpkg{ragged2e} package.) % @@ -528,7 +615,9 @@ % \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. +% (if defined) followed by the current page number, right-aligned, +% unless specified otherwise using the \Dopt{nopageheader} option +% (see section~\ref{sec:options}). % This is managed using the \Dpkg{fancyhdr} and \Dpkg{xstring} packages. % % \begin{macrocode} @@ -539,7 +628,13 @@ \fancyhf{} \pagestyle{headings} \pagestyle{norule} -\fancyhead[RO]{{\StrBehind{\@author}{ }[\last]\last} \thepage} +\ifMLA@pageheader + \ifx\@author\@empty + \fancyhead[RO]{\thepage} + \else + \fancyhead[RO]{{\StrBehind{\@author}{ }[\last]\last} \thepage} + \fi +\fi % \end{macrocode} % % The following code is largely a hack to align the header @@ -574,7 +669,7 @@ % % \begin{macro}{\professor} % The instructor who assigned the paper, i.e. -% \mentioned{Dr. Marjorie Stewart}. +% \mentioned{Dr.\ Marjorie Stewart}. % % \begin{macrocode} \newcommand*{\professor}[1]{\gdef\@professor{#1}} @@ -610,15 +705,20 @@ % \term{day month year}} % \changes{v0.4.1}{2019/05/15}{Changed date format back to whatever % is inside \cs{@date}} +% \changes{v0.9}{2020/10/05}{Changed to ignore (not print) undefined +% header macros} +% \changes{v0.9}{2020/10/05}{Fix weird bug where paragraph immediately +% after \cs{begin\{paper\}} (with no newline) is not indented} % \begin{macrocode} \newcommand{\makemlaheader}{% \begin{noindent} - \@author \\ - \@professor \\ - \@course \\ - \@date \\ - \begin{center}\@title\end{center} + \ifx\@author\@empty\else\@author\\\fi + \ifx\@professor\@empty\else\@professor\\\fi + \ifx\@course\@empty\else\@course\\\fi + \ifx\@date\@empty\else\@date\\\fi + \ifx\@title\@empty\else\begin{center}\@title\end{center}\fi \end{noindent} + % for some reason, this blank line is necessary } % \end{macrocode} % \end{macro} @@ -630,12 +730,16 @@ \renewcommand{\maketitle}{\makemlaheader} % \end{macrocode} % -% Finally, the header will print at the beginning of every document. +% Finally, the header will print at the beginning of every document +% unless specified otherwise using the \Dopt{nopaperheader} option +% (see section~\ref{sec:options}). % % \changes{v0.5}{2019/05/18}{Moved header-printing process to % \cs{AtBeginDocument}} % \begin{macrocode} -\AtBeginDocument{\maketitle} +\ifMLA@paperheader + \AtBeginDocument{\maketitle} +\fi % \end{macrocode} % % \subsection{Sectioning} @@ -643,6 +747,8 @@ % % \changes{v0.7}{2019/08/30}{Replaced regular space after dot % in section headings with \cs{enspace}} +% \changes{v0.8}{2020/08/16}{Removed extraneous spacing and newlines +% in section headings} % \begin{macro}{\section} % \changes{v0.2}{2019/05/02}{Changed heading to small-caps} % \begin{macro}{\subsection} @@ -659,7 +765,12 @@ % 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. +% will be set in small-caps by default. +% Plain, unnumbered and entirely unformatted section headings can +% be acheived using the \Dopt{plainheadings} option +% (see section~\ref{sec:options}). +% For custom headings other than these, refer to the +% \Dpkg{fancyhdr} package documentation. % % \begin{macrocode} \renewcommand{\thesection}{\@arabic\c@section} @@ -670,12 +781,16 @@ % Un-fancifying the headings is acheived using % the \Dpkg{titlesec} package. % -% \changes{v0.8}{2020/08/16}{Removed extraneous spacing and newlines -% in section headings} % \begin{macrocode} -\titleformat{\section}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] -\titleformat{\subsection}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] -\titleformat{\subsubsection}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] +\ifMLA@plainheadings + \titleformat{\section}[block]{\normalsize}{}{0pt}{}[] + \titleformat{\subsection}[block]{\normalsize}{}{0pt}{}[] + \titleformat{\subsubsection}[block]{\normalsize}{}{0pt}{}[] +\else + \titleformat{\section}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] + \titleformat{\subsection}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] + \titleformat{\subsubsection}[block]{\normalsize\sc}{\thetitle.\enspace}{0pt}{}[] +\fi \titlespacing*{\section}{0pt}{0pt}{0pt} \titlespacing*{\subsection}{0pt}{0pt}{0pt} \titlespacing*{\subsubsection}{0pt}{0pt}{0pt} @@ -761,15 +876,17 @@ % seems customary and logical. % % \begin{macrocode} -\setlength{\floatsep}{\baselineskip} -\setlength{\intextsep}{\baselineskip} -\setlength{\textfloatsep}{\baselineskip} -\g@addto@macro\@floatboxreset\centering +\ifMLA@figures + \setlength{\floatsep}{\baselineskip} + \setlength{\intextsep}{\baselineskip} + \setlength{\textfloatsep}{\baselineskip} + \g@addto@macro\@floatboxreset\centering +\fi % \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.}, +% 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 @@ -777,12 +894,14 @@ % \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 -} +\ifMLA@figures + \renewcommand{\float@endH}{% + \vspace{-12pt} + \@endfloatbox\vskip\intextsep + \if@flstyle\setbox\@currbox\float@makebox\columnwidth\fi + \box\@currbox\vskip\intextsep\relax\@doendpe + } +\fi % \end{macrocode} % % \end{environment} @@ -795,21 +914,25 @@ % \Dpkg{caption} package. % % \begin{macrocode} -\captionsetup{% - font={normalfont}, - labelformat=simple, - labelsep=period, - position=bottom, - aboveskip=6pt, - belowskip=-10pt -} +\ifMLA@figures + \captionsetup{% + font={normalfont}, + labelformat=simple, + labelsep=period, + position=bottom, + aboveskip=6pt, + belowskip=-10pt + } +\fi % \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.} +\ifMLA@figures + \captionsetup[figure]{name=Fig.} +\fi % \end{macrocode} % % \end{environment} @@ -865,25 +988,29 @@ % This is acheived with the \Dpkg{enumitem} package. % % \begin{macrocode} -\newlist{mlanotes}{description}{1} -\setlist[mlanotes]{% - parsep=0pt, - itemsep=0pt, - topsep=0pt, - leftmargin=\parindent -} +\ifMLA@notes + \newlist{mlanotes}{description}{1} + \setlist[mlanotes]{% + parsep=0pt, + itemsep=0pt, + topsep=0pt, + leftmargin=\parindent + } +\fi % \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} +\ifMLA@notes + \DeclareInstance{enotez-list}{mla}{list}{% + heading = {}, + format = \normalsize\normalfont, + list-type = mlanotes + } + \setenotez{list-name={},list-style=mla,backref} +\fi % \end{macrocode} % % \subsubsection{Bibliography} |