-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsutitle.sty
132 lines (124 loc) · 4.93 KB
/
lsutitle.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
%%
%% This is file `lsutitle.sty', a LaTeX class derived from `book.cls'.
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{lsutitle}[2020/02/01 LSU Thesis Title Package]
% \title and \author already defined in latex.ltx to modify \@title and
% \@author, but an empty \author should be an error instead of a warning,
% so for that we would want:
%%\def\@author{\@latex@error{No \noexpand\author given}\@ehc}}
% However, ``amsbook'' redefines \author to instead modify \authors. Thus
% we choose between \@author and \authors (first one that isn't empty),
% otherwise produce the error.
\let\@author\@empty
\let\authors\@empty
\def\@@author{\ifx\@author\@empty\ifx\authors\@empty\@latex@error{No \noexpand\author given}\@ehc\else\authors\fi\else\@author\fi}
% We now similarly define other elements of the title page.
\def\thesistype#1{\gdef\@thesistype{#1}}
\def\@thesistype{Thesis}
\def\soughtdegree#1{\gdef\@soughtdegree{#1}}
\def\@soughtdegree{Doctor of Philosophy}
\def\department#1{\gdef\@department{#1}}
\def\@department{\@latex@error{No \noexpand\department given}\@ehc}
\def\degrees#1{\gdef\@degrees{#1}}
\def\@degrees{\@latex@warning@no@line{No \noexpand\degrees given}}
\def\graduationdate#1{\gdef\@graduationdate{#1}}
\def\@graduationdate{\@latex@warning@no@line{No \noexpand\graduationdate given}}
\renewcommand\maketitle{\begin{titlepage}%
\renewcommand\baselinestretch{}\normalsize
\centering
\begingroup
\LARGE\bfseries\MakeUppercase{\@title}\par
\endgroup
\vspace*{\stretch{1}}
\begingroup
A \@thesistype\\
\ \\
Submitted to the Graduate Faculty of the\\
Louisiana State University and\\
Agricultural and Mechanical College\\
in partial fulfillment of the\\
requirements for the degree of\\
\@soughtdegree\\
\ \\
in\\
\ \\
\@department\\
\endgroup
\vspace*{\stretch{1}}
\begingroup
by\\
\@@author\\
\@degrees\\
\@graduationdate
\endgroup
\end{titlepage}%
}
%% For setting landscape page numbers (required by LSU), the following trick
%% is based off an idea by David Carlisle in
%% https://tex.stackexchange.com/questions/278113/single-landscape-page-with-page-number-at-the-bottom
%% It is included here in lsutitle because putting it in the document class
%% would make it harder for a user to change document classes. It could also
%% be put in a separate package ``lsulandscape'' that could even depend on
%% ``pdflscape'', but putting it here reduces the number of files. To use
%% this, one does
%% \usepackage{pdflscape}
%% \begin{landscape}
%% Landscape material.
%% \fillandplacepagenumber
%% \end{landscape}
%%
%% The code goes to the bottom of the page, creates a box of height/depth 0,
%% aligned on an internal box of height/depth 0, and then with the page
%% number sticking out below precisely the amount determined by \footskip.
\def\fillandplacepagenumber{%
\par\thispagestyle{empty}%
\vbox to\z@{\vss}\vfill
\vbox to\z@{\baselineskip\z@
\hb@xt@\linewidth{\hss}%
\baselineskip\footskip
\hb@xt@\linewidth{%
\hfil\thepage\hfil}\vss}}
%% Epigraph (quotation) support.
\usepackage{epigraph}
\setlength\beforeepigraphskip{0pt}
\setlength\afterepigraphskip{0pt}
\setlength\epigraphrule{0pt}
%% For the next line we typically want
%\renewcommand\epigraphsize{\singlespacing\small}
%% or we might want
%\if@lsuthesisdoublespace
%\renewcommand\epigraphsize{\singlespacing\small}
%\fi
%% but we can't use \singlespacing nor refer to \if@lsuthesisdoublespace
%% because the user might not be using the ``lsuthesis'' class. (That's
%% the entire reason ``lsutitle'' was split into a separate package!)
%% Thus we need a different way to test. When the ``setspace'' package
%% isn't loaded, \baselinestretch should be empty, so that's the condition
%% we test. This isn't fool-proof. The value might be 1 with some other
%% document class, or some other document class might itself load
%% ``setspace'' and do something. But in those cases all the spacing will
%% likely differ from ``lsuthesis'', so our fixups will anyhow be incorrect.
\renewcommand\epigraphsize{\ifx\baselinestretch\@empty\else\def\baselinestretch{1}\normalsize\vskip\baselineskip\fi\small}
%% When an epigraph is set between a \chapter and \section, too much space
%% is produced afterwards. This helper macro fixes the spacing.
\def\shrinkpostepigraphspacing{%
\ifx\baselinestretch\@empty
\vspace{-\baselineskip}%
\else
\vspace{-\dimexpr\baselineskip/\baselinestretch\relax}%
\fi}
%% The user must explicitly invoke the helper macro:
%% \chapter{Title}
%% \epigraph{Quote}{Acknowledgment}
%% \shrinkpostepigraphspacing
%% \section{Title}
%% This is not needed if a regular paragraph follows the epigraph.
%% LSU allows vertically centered pages in the frontmatter, to be used
%% for copyright page, dedication page, and epigraph page.
\newenvironment{centeredpage}{%
\chapter*{}\begin{center}\vspace*{\stretch{1}}}{%
\vspace*{\stretch{1}}\end{center}}
\endinput
%%
%% End of file `lsutitle.sty'.