-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnovel.cls
105 lines (91 loc) · 3.23 KB
/
novel.cls
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
% Auth: Nicklas Vraa
% Docs: https://github.com/NicklasVraa/LiX
% ------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{novel}[2023/02/10 For works of fiction]
% Intercept class options.
\newcommand{\numColumns}{1}
\DeclareOption{twocolumn}{
\renewcommand{\numColumns}{2}
\PassOptionsToClass{\CurrentOption}{book}
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass[12pt,oneside]{book}
% SETUP: -----------------------------------------------------------------------
\RequirePackage[basics, cover, figures, formatting, header, headings, isbn, license, metadata, publish, refs, size]{lix}
\RequirePackage{ebgaramond, setspace, silence, titlesec, titletoc, titling}
\WarningsOff*
% FONT OVERRIDES: --------------------------------------------------------------
\authorfont{\normalsize}
\RenewDocumentCommand{\l}{mg}{
\lettrine[nindent=2.4pt, findent=-1.5pt, loversize=0.25]{#1}{\IfValueTF{#2}{#2}{}}
}
% SIZE, MARGINS: ---------------------------------------------------------------
\geometry{letterpaper, top=36mm, bottom=40mm, left=40mm, right=40mm}
% COVER: -----------------------------------------------------------------------
\setlength{\droptitle}{-110mm}%
% HEADINGS: --------------------------------------------------------------------
\setcounter{secnumdepth}{1}% Levels of heading that will be numbered.
\titlespacing{\chapter}{-1pt}{-45pt}{10pt}
\titlespacing\numberless{0pt}{14pt}{4pt}
\titlespacing\section{0pt}{14pt}{4pt}
\titlespacing\subsection{0pt}{14pt}{4pt}
\titlespacing\subsubsection{0pt}{14pt}{4pt}
\titleformat*{\section}{\bfseries\scshape}
\titleformat*{\subsection}{\bfseries\scshape}
\titleformat*{\subsubsection}{\bfseries\scshape}
\titleformat{\chapter}[display]{%
\normalsize%
}{% Prefix.
\centering\hspace{1pt}\small\scshape\color{darkgray}\chaptertitlename \ \thechapter%
}{% Vertical space between.
-9pt%
}{% Chapter name.
\centering\LARGE\bfseries\scshape%
}
% PAGESTYLES: ------------------------------------------------------------------
\setlength{\headsep}{5mm}%
\pagestyle{fancy}%
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}%
\fancyhead[L]{}%
\fancyhead[C]{\small\scshape\color{darkgray} \chaptername\ \thechapter\ --\ \leftmark}%
\fancyhead[R]{}%
\fancyfoot[C]{\large\scshape\thepage}%
\renewcommand{\headrulewidth}{0pt}%
\fancypagestyle{firstPageOfChapter}{%
\fancyhead{}%
\renewcommand{\headrulewidth}{0pt}%
}
\fancypagestyle{metadataPage}{%
\fancyhead{}\fancyfoot{}%
\renewcommand{\headrulewidth}{0pt}%
}
% LAYOUT: ----------------------------------------------------------------------
\wrap{%
\@ifundefined{theTitle}{}{%
\@ifundefined{theSubtitle}{%
\oldtitle{\Huge\textbf{\textsc{\theTitle}}}%
}{%
\oldtitle{\Huge\textbf{\textsc{\theTitle}}\\[0.4ex]%
\large\scshape\theSubtitle}%
}
}
\@ifundefined{theAuthor}{%
\oldauthor{}%
}{%
\oldauthor{\theAuthor}%
}
\@ifundefined{theDate}{%
\olddate{}%
}{%
\olddate{\normalsize{\theDate}}%
}
\addMetadata
\addFrontCover
\addBackCover
\@ifundefined{theTitle}{}{%
\maketitle%
}
\addFormalPage
}