summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/mitthesis/mitthesis.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/mitthesis/mitthesis.cls')
-rw-r--r--macros/latex/contrib/mitthesis/mitthesis.cls124
1 files changed, 87 insertions, 37 deletions
diff --git a/macros/latex/contrib/mitthesis/mitthesis.cls b/macros/latex/contrib/mitthesis/mitthesis.cls
index 65e018443a..b48703d745 100644
--- a/macros/latex/contrib/mitthesis/mitthesis.cls
+++ b/macros/latex/contrib/mitthesis/mitthesis.cls
@@ -7,8 +7,8 @@
%% MIT Libraries' requirements as of 2023.
%%
%% This file's version and date:
- \def\versionno{1.10}
- \def\versiondate{2023/09/23\space}
+ \def\versionno{1.11}
+ \def\versiondate{2023/11/02\space}
%%
%% Author: John H. Lienhard, V
%% Department of Mechanical Engineering
@@ -57,6 +57,7 @@
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}% compare version to date; \If... added to latex 2020/10/01
\providecommand\IfPackageAtLeastTF{\@ifpackagelater}% compare version to date; \If... added to latex 2020/10/01
+\providecommand\IfPackageLoadedTF{\@ifpackageloaded}% \If...added to latex 2021/11/15
\IfFormatAtLeastTF{2020/10/01}{%
\typeout{^^JYour LaTeX format is dated \fmtversion. LaTeX distributions from 2022/11/01 or later are strongly recommended for best results^^J}
@@ -90,6 +91,15 @@
\RequirePackage{xparse}
\fi
+% Allow pre 2021/11/15 formats to see the graphicx alt key without causing an error
+\IfFormatAtLeastTF{2021/11/15}{
+ \relax
+}{
+ \AtBeginDocument{
+ \IfPackageLoadedTF{graphicx}{\define@key{Gin}{alt}{}}{\relax}
+ }
+}
+
%%%%%%%%%%%%%% Options for the class %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\IfFormatAtLeastTF{2022/11/01}{%
@@ -158,13 +168,14 @@
% We'd like these sections to have pdf bookmarks and to have the two lists appear in the table of contents
\patchcmd{\tableofcontents}{\@starttoc{toc}}{\pdfbookmark[0]{Table of Contents}{toc}\@starttoc{toc}}{}{}
-\patchcmd{\listoffigures}{\chapter*{\listfigurename}}{\chapter*{\listfigurename}\addcontentsline{toc}{chapter}{\protect\textbf{\listfigurename}}}{}{}
-\patchcmd{\listoftables}{\chapter*{\listtablename}}{\chapter*{\listtablename}\addcontentsline{toc}{chapter}{\protect\textbf{\listtablename}}}{}{}
+\patchcmd{\listoffigures}{\chapter*{\listfigurename}}{\chapter*{\listfigurename}\addcontentsline{toc}{chapter}{\listfigurename}}{}{}
+\patchcmd{\listoftables}{\chapter*{\listtablename}}{\chapter*{\listtablename}\addcontentsline{toc}{chapter}{\listtablename}}{}{}
%%%%%%%%%%%%% Geometry, mathtools, graphics, design, fonts, hyperrefs, bookmarks, footnotes %%%%%%%%%%%%%%%%%%%
-\RequirePackage[letterpaper,top=1in,bottom=1in,left=1in,right=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in]{geometry}
+%\RequirePackage[letterpaper,top=1in,bottom=0.97136in,left=1in,right=1in,marginparwidth=50pt,headsep=12pt,footskip=0.47136in]{geometry} % bottom margin allows 45\baselineskip in \textheight
+\RequirePackage[letterpaper,top=1in,bottom=1in,left=1in,right=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in,heightrounded]{geometry} % 44\baselineskip = \texteheight - \topskip = 650.0pt - 12pt with rounded height
\RequirePackage{mathtools}% loads and extends amsmath; must load before hyperref and unicode-math
@@ -206,7 +217,7 @@
filecolor=red,
}
\ifmit@lineno
- \renewcommand{\linenumberfont}{\sffamily\tiny\color{violet}}
+ \renewcommand{\linenumberfont}{\sffamily\mdseries\tiny\color{violet}}% add mdseries 2023/10/11
\fi
}
\fi
@@ -352,6 +363,12 @@
\tl_gset:Nx \g_dd_thesisdate_tl { \tl_trim_spaces:n {#1} }
}
+% If for some reason you don't want a warning when you supply the wrong month
+\NewDocumentCommand\SuppressMonthError{}
+ {
+ \msg_redirect_name:nnn { \ClassName } { wrong_month } { none }
+ }
+
%%%%%%%%%% End Degree Date Module %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -432,6 +449,8 @@
}
+\tl_new:N \g__author_namesize_tl
+\tl_gset:Nn \g__author_namesize_tl { \large }
\cs_new:Nn \__author_block: {
\int_zero_new:N \l__author_authorno_int
\int_incr:N \l__author_authorno_int
@@ -440,7 +459,7 @@
}
{by\par
\int_until_do:nNnn { \l__author_authorno_int } = { \g_author_authorcnt_int } {
- \seq_item:cn { g_author_name_seq } { \l__author_authorno_int } \par
+ { \g__author_namesize_tl \seq_item:cn { g_author_name_seq } { \l__author_authorno_int } } \par
\tl_set:Nx \l_tmpa_tl { \seq_item:cn { g_author_prevdegree_seq } { \l__author_authorno_int} }
\tl_if_empty:NF \l_tmpa_tl { \normalsize \l_tmpa_tl }% no linebreak or par for empty items
\tl_set:Nx \l_tmpa_tl { \seq_item:cn { g_author_secondprevdegree_seq } { \l__author_authorno_int} }
@@ -452,7 +471,7 @@
\par and\par
\int_incr:N \l__author_authorno_int
}
- \seq_item:cn { g_author_name_seq } { \l__author_authorno_int } \par
+ { \g__author_namesize_tl \seq_item:cn { g_author_name_seq } { \l__author_authorno_int } } \par
\tl_set:Nx \l_tmpa_tl { \seq_item:cn { g_author_prevdegree_seq } { \l__author_authorno_int} }
\tl_if_empty:NF \l_tmpa_tl { \normalsize \l_tmpa_tl }% no linebreak or par for empty items
\tl_set:Nx \l_tmpa_tl { \seq_item:cn { g_author_secondprevdegree_seq } { \l__author_authorno_int} }
@@ -461,12 +480,16 @@
\tl_if_empty:NF \l_tmpa_tl { \linebreak\normalsize \l_tmpa_tl }
\tl_set:Nx \l_tmpa_tl { \seq_item:cn { g_author_fourthprevdegree_seq } {\l__author_authorno_int} }
\tl_if_empty:NF \l_tmpa_tl { \linebreak\normalsize \l_tmpa_tl }
- \par\medskip
+ \par
}
}
\msg_new:nnnn { \ClassName } { no_author }
{ Missing\ author!\ You\ must\ issue\ the\ \Author{name}{department}\ command. }{
You\ MUST\ issue\ the\ \Author{name}{department}\ command\ after\ \string\begin{document}\ and\ before\ \string\maketitle. }
+\NewDocumentCommand\AuthorNameSize{m}{
+ \tl_gset:Nn \g__author_namesize_tl {#1}
+}
+
\cs_new:Nn \__author_abstractblock: {
\int_zero_new:N \l__author_authorno_int
@@ -493,6 +516,7 @@
\seq_new:N \g_supervisor_title_seq
\int_gzero_new:N \g_supervisor_supervisorcnt_int
+
\NewDocumentCommand\Supervisor{mm}{
\tl_if_blank:nTF{#1}{
\msg_error:nn { \ClassName } { blank_supervisor }
@@ -640,12 +664,12 @@
\linebreak \mbox {in\ partial\ fulfillment\ of\ the\ requirements\ for\ the\
\int_compare:nNnTF { \g_degree_degreecnt_int } > {1} {degrees} {degree}
\ of}
- \par\medskip
+ \par%\medskip, removed 2023/10/25 to work better with four block layout of title page
\int_until_do:nNnn { \l__degree_degreeno_int } = { \g_degree_degreecnt_int } {
\text_uppercase:n {\seq_item:cn { g_degree_name_seq } { \l__degree_degreeno_int }}\par and\par
\int_incr:N \l__degree_degreeno_int
}
- \text_uppercase:n {\seq_item:cn { g_degree_name_seq } { \l__degree_degreeno_int }}\par\medskip
+ \text_uppercase:n {\seq_item:cn { g_degree_name_seq } { \l__degree_degreeno_int }}\par
}
\msg_new:nnnn { \ClassName } { no_degree }
{ Missing\ degree!\ You\ must\ issue\ the\ \Degree{name}{department}\ command. }{
@@ -712,6 +736,8 @@
\int_gzero_new:N \g__signature_supno_int
\int_gzero_new:N \g__signature_accno_int
\g__signature_sigsize_tl
+ \dim_set:Nn \topsep {0pt}
+ \dim_set:Nn \partopsep {0pt}
\begin{tabbing}
\hspace{1.35in} \= \hspace{1in} \kill
\int_do_while:nNnn { \g__signature_autno_int } < { \g_author_authorcnt_int } {
@@ -735,13 +761,14 @@
\\
\> \seq_item:cn { g_acceptor_title_seq } { \g__signature_accno_int }
}
- \\[1em]
- }
+ \int_compare:nNnTF { \g__signature_accno_int } = { \g_acceptor_acceptorcnt_int }
+ { \\ }{ \\[1em]}
+ }
}
\end{tabbing}
}
\msg_new:nnnn { \ClassName } { weird_sigsize }
- { \SignatureBlockSize\ expects\ a\ font-sizing\ command,\ such\ as\ \small,\ \footnotesize,\ etc.}{You\ used\ a\ weird\ input\ value\ here.\ If\ you\ did\ so\ deliberately,\ try\ continuing.}
+ { \SignatureBlockSize\ expects\ a\ font-sizing\ command,\ such\ as\ \small,\ \footnotesize,\ etc.}{You\ used\ a\ weird\ input\ value\ here.\ If\ you\ did\ so\ deliberately,\ try\ continuing.}
\msg_new:nnnn { \ClassName } { no_acceptor }
{ Missing\ acceptor!\ You\ must\ issue\ the\ \Acceptor{name}{department}{title}\ command. }{
You\ MUST\ issue\ the\ \Acceptor{name}{department}{title}\ command\ after\ \string\begin{document}\ and\ before\ \string\maketitle.}
@@ -789,7 +816,7 @@
\cs_if_exist:NT \pdfmeta_xmp_add:n {
\pdfmeta_xmp_add:n {<xmpRights:WebStatement>#2</xmpRights:WebStatement>}
}
- \cs_if_exist:NTF \msg_note:nnn % added to expl3 2021/05/18
+ \cs_if_exist:NTF \msg_note:nnn % command was added to expl3 2021/05/18
{
\msg_note:nnn { \ClassName } { cclicense} {#1}
}
@@ -825,8 +852,32 @@
\cs_new:Npn \Institution #1 { \tl_gset:Nn \g_titlepage_institution_name_tl {\tl_trim_spaces:n #1} }
-\RenewDocumentCommand\maketitle{s}{%
- \cs_if_exist:NTF \DegreeMonth { \scan_stop: } { \msg_error:nn { \ClassName } { no_degree_date } }% msg defined in degree-date section
+%%%%%%% Adjust vertical skips between the major blocks of the title page
+
+\bool_new:N \g_titlepage_squashglue_bool
+\cs_new_protected:Nn \__titlepage_bottomskip: {
+ \if_bool:N \g_titlepage_squashglue_bool
+ { \skip_vertical:n { 0pt plus 1filll } }
+ \else:
+ { \skip_vertical:n { 0pt plus 12fill } }
+ \fi:
+}
+\NewDocumentCommand\Squash{}{ \bool_set_true:N \g_titlepage_squashglue_bool }% Squashes all glue from bottom upward
+
+\bool_new:N \g_titlepage_tighten_bool
+\cs_new_protected:Nn \__titlepage_blockskip:nn {
+ \if_bool:N \g_titlepage_tighten_bool
+ { \skip_vertical:n { 6pt plus #2fill } }
+ \else:
+ { \skip_vertical:n { #1pt plus #2fill } }
+ \fi:
+}
+\NewDocumentCommand\Tighten{}{ \bool_set_true:N \g_titlepage_tighten_bool }% Reduces 12pt and 18pt skips to 6pt
+
+%%%%%%%%%%%%
+
+\RenewDocumentCommand\maketitle{s}{
+ \cs_if_exist:NTF \DegreeMonth { \scan_stop: } { \msg_error:nn { \ClassName } { no_degree_date } }% msg def'd in degree-date section
%
\bool_if:NTF \g__cclicense_tf_bool {
\tl_gset:Nn \g_copyright_copyrightlicencse_tl
@@ -846,34 +897,33 @@
{
\tl_gset:Nn \g__copyright_crwords_tl_ {The\ author\ hereby\ grants}
}
- \IfBooleanTF{#1}{%
+ \IfBooleanTF{#1}{
\tl_gset:Nn \g_copyright_mitpermission_tl {\scan_stop:}
}{
\tl_gset:Nn \g_copyright_mitpermission_tl {\g__copyright_crwords_tl_\ \g__copyright_mitpermissionlast_tl}
}
%
\clearpage
- \thispagestyle{empty}%
- \phantomsection\addcontentsline{toc}{chapter}{\protect\textbf{Title page}}%
+ \thispagestyle{empty}
{\centering \vbox_to_ht:nn { \vsize }% to prevent signature block from breaking across page
{
- \setlength{\parskip}{0.5\baselineskip plus 2pt minus 2pt}\setlength{\parindent}{0pt}%
- {\Large\textbf{\g_mitthesis_title_tl}\par}
+ \setlength{\parskip}{7.5pt plus 1pt minus 1pt}% edited all vertical space on this page 2023/10/25
+ \setlength{\parindent}{0pt}
+ {\Large\textbf{\g_mitthesis_title_tl}\phantomsection\addcontentsline{toc}{chapter}{Title\ page}\par} % revise for tagging in future
+ \__titlepage_blockskip:nn {12}{1.5}% new idea
\__author_block:
- \par
+ \__titlepage_blockskip:nn {12}{1.5}
\__degree_block:
at\ the\par
\text_uppercase:n { \g_titlepage_institution_name_tl }\par
- \DegreeMonth\ \DegreeYear
- \par
- \copyright\space\DegreeYear\space\CopyrightAuthor\@.\c_space_token \g_copyright_copyrightlicencse_tl % In case name ends with III, IV, V,...
- \par
- \skip_vertical:n {\baselineskip}
- %
- \__signature_block:
- \vfill % to avoid overstretched glue
+ \DegreeMonth\ \DegreeYear\par
+ \__titlepage_blockskip:nn {12}{2}
+ \copyright\space\DegreeYear\space\CopyrightAuthor\@.\c_space_token \g_copyright_copyrightlicencse_tl % \@. in case name ends with III, IV, V,...
+ \__titlepage_blockskip:nn {18}{2}
+ \vbox:n {\__signature_block:}
+ \__titlepage_bottomskip:
}
- }%
+ }
\hypersetup{
pdfcopyright={Copyright\ \DegreeYear\ by\ \CopyrightAuthor.\ \g_copyright_pdfrightstext_tl},
pdfauthor={\g__author_pdfca_tl},
@@ -893,9 +943,8 @@
\RenewDocumentEnvironment{abstract}{+b}{
\newpage
- \phantomsection\addcontentsline{toc}{chapter}{\protect\textbf{\abstractname}}
\begin{center}
- {\large{\textbf{\g_mitthesis_title_tl}}\par}
+ {\large{\textbf{\g_mitthesis_title_tl}}\phantomsection\addcontentsline{toc}{chapter}{\abstractname}\par} % revise for tagging as LaTeX evolves further
\setlength{\parskip}{0.5\baselineskip plus 2pt minus 2pt}
\__author_abstractblock:
\par
@@ -936,7 +985,8 @@
% nomenclature subheadings
\NewDocumentCommand\EntryHeading{m}{%
\itemsep3\p@ plus 1\p@ minus 1\p@
- \goodbreak\item[\itshape#1\hfill]\setlength\itemsep\savitemsep\@itempenalty=1000
+ \goodbreak\item[\itshape#1\hfill]\mbox{}% mbox added for tagged pdf 2023/10/11
+ \setlength{\itemsep}{\savitemsep}\@itempenalty=1000
}
%
% Increase first optional argument to a dimension > 2em if wide entries cause undesired misalignment of columns.
@@ -946,7 +996,7 @@
\setlength\columnsep{2em}
\setlength{\nomenwidth}{#1}
\csname #3\endcsname *{#2}% this level will vary amongst users!
- \phantomsection\addcontentsline{toc}{#3}{#2}%
+ \phantomsection\addcontentsline{toc}{#3}{#2}% tagged pdf may not capture both of these ... 2023/10/18
\raggedright
\begin{list}{}{%
\setlength{\itemsep}{0pt}%
@@ -955,7 +1005,7 @@
\setlength{\labelwidth}{\nomenwidth}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}%
- \setlength\savitemsep\itemsep%
+ \setlength{\savitemsep}{\itemsep}%
}%
}{\end{list}\ignorespacesafterend}