-
Notifications
You must be signed in to change notification settings - Fork 0
/
novel.latex
204 lines (164 loc) · 5.54 KB
/
novel.latex
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
\documentclass[12pt,openany]{book} % paper size is in preamble.sty
%\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage[english]{babel}
\usepackage[autostyle, english = american]{csquotes}
\usepackage{caption}
\MakeOuterQuote{"}
%%%%%%%%%% BOOK INFORMATION %%%%%%%%%%
\newcommand{\authorname}{$author$}
\newcommand{\booktitle}{$title$}
\newcommand{\subtitle}{$subtitle$}
\newcommand{\publisher}{$publisher$}
\newcommand{\editionyear}{$year$}
\newcommand{\isbn}{$isbn$} % replace this with your own ISBN
\title{\booktitle}
\author{\authorname}
% \usepackage{misc/options} REPLACED BY THE FOLLOWING
% \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype} % Better typography
\usepackage{lettrine} % Add drop caps to chapter openings
\usepackage{graphicx}
% \usepackage{ebgaramond}
\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
\newcommand{\hsp}{\kern 1pt} % for nested quotation marks
% Paragraph formatting
\renewcommand{\baselinestretch}{1.125} % Allow paragraphs to breathe by spreading the lines further
\setlength{\parskip}{0pt} % Fixed space between paragraphs (i.e. disable variable parskip)
\setlength{\parindent}{1em}
% Don’t add extra space after sentences
\frenchspacing
% Reduce widows/orphans
\widowpenalty=10000
\clubpenalty=10000
% Page size
\usepackage[
paperheight=9in,
paperwidth=6in,
top=0.75in,
bottom=0.75in,
outer=0.75in,
inner=0.875in
]{geometry}
% Reduce overfull \hbox{} warnings
\sloppy
% Contents page
\usepackage[titles]{tocloft}
\renewcommand{\cftchapfont}{\large\itshape}
\renewcommand{\cftchappagefont}{\normalfont}
\renewcommand{\numberline}[1]{}
% chapter headings
\renewcommand\thechapter{\Roman{chapter}}
\usepackage[center,sc]{titlesec}
% figures
\usepackage{wrapfig}
\makeatletter
\newcommand{\checkheight}[1]{%
\par \penalty-100\begingroup%
\setlength{\dimen@}{#1}%
\dimen@ii\pagegoal \advance\dimen@ii-\pagetotal
\ifdim \dimen@>\dimen@ii
\break
\fi\endgroup}
\makeatother
% headers/footers
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhf[CFE,CFO]{\thepage} % Set page numbers in the footer
%\fancyhead[LE,RO]{\thepage} % Set page numbers in the left/right sides of the header
\fancyhead[CE]{\itshape\authorname} % Author name in middle of left-side page header
\fancyhead[CO]{\itshape\booktitle} % Book title in middle of right-side page header
%%% font customization %%%
$for(fontfamilies)$
\newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
$endfor$
$if(mainfont)$
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
\usepackage[
protrusion=true, % Enable character protrusion
final, % Enable microtype settings in the final document
]{microtype}
% % Page geometry
% $if(geometry)$
% \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
% $else$
% \usepackage[a4paper, margin=2cm]{geometry}
% $endif$
% Highlighting fixing Shaded issues
$if(highlighting-macros)$
$highlighting-macros$
$endif$
\begin{document}
\captionsetup{labelformat=empty}
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
\frontmatter
%%% Title page %%%
\pagestyle{empty}
% Half title page
{
\centering
~
\vspace{24pt}
{\scshape\Huge \booktitle \par}
}
\cleardoublepage
% Title page
\begin{titlepage}
\centering
~
\vspace{24pt}
{\scshape\Huge \booktitle\par}
\vspace{6pt}
{\scshape\large \subtitle\par}
\vspace{\stretch{1.25}}
{\itshape\large by\par}
\vspace{6pt}
{\itshape\Large \authorname\par}
\vspace{\stretch{6}}
{\large \publisher\par}
\end{titlepage}
%%% copyright page %%%
{\small
\setlength{\parindent}{0em}\setlength{\parskip}{1em}
~
\vfill
Copyright \copyright{} \editionyear{} \authorname
All rights reserved. No part of this publication may be reproduced, stored or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise without written permission from the publisher. It is illegal to copy this book, post it to a website, or distribute it by any other means without permission.
This novel is entirely a work of fiction. The names, characters and incidents portrayed in it are the work of the author’s imagination. Any resemblance to actual persons, living or dead, events or localities is entirely coincidental.
First edition, \editionyear{}
ISBN \isbn{} % see main.tex
Published by \publisher{}
}
%%% Preface %%%
% \input{frontmatter/preface}
$if(preface)$
\chapter{Preface}
$preface$
\cleardoublepage % Make sure contents page starts on right-side page
$endif$
%%% Table of contents %%%
\tableofcontents\thispagestyle{empty}\cleardoublepage
\mainmatter
\pagestyle{fancy}
$body$
\end{document}