-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.tex
302 lines (258 loc) · 10.6 KB
/
book.tex
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
%% ----------------------------------------------------------------------------
%% Printed Book - [Your Book Name Here] - MASTER LaTeX File
% -----------------------------------------------------------------------------
% Copyright 2017 [your name] - All rights reserved.
%
% This is the KOMA-Script LaTeX version of this work. This is designed to
% be formatted as a PDF for distribution to a POD printer as a 6"x9" book.
% This can also be useful to typeset a hyperlinked PDF for direct reading.
%
% Note: the ./cover subdirectory contains LaTeX for formatting the color
% printed cover. The TotalPageCount of BookParameters.tex is set by running
% the makebook script based on info in the LaTeX log file.
%
% Use the ./bin/makebook script to generate the various book formats.
% -----------------------------------------------------------------------------
\documentclass[ % KOMA-Script Book Formatting
twoside=true,
paper=6in:9in,
DIV=calc,
BCOR=1.25in, % Inner gutters width
fontsize=11pt,
pagesize=pdftex,
parskip=half
]{scrbook}
%% ----------------------------------------------------------------------------
%% ----- Document Information
\input{BookParameters.tex}
\evensidemargin=0.38in % Pushes left pages to right.
\topmargin=-0.8in % Pushes entire page contents down
\textwidth=4.5in % width of actual text area
\usepackage{scrhack} % fix \float@addtolists detected! in KOMA scripts.
%\usepackage{showframe} % Show the layout frame on every page
\ifdefined\uselayouts
\usepackage{layouts} % Page layout diagram output
\printinunitsof{in} % Show layout units as inches.
\fi
%% ----------------------------------------------------------------------------
%% ----- CONTROL PARAMETERS FOR OUTPUT SELECTION -----
%% The default for producing the article form PDF should be: All options false.
%% Note: F11, Shift-Alt-F1, F1, F12, F1, F1 (Bibliography, Reauthor, Reindex,
%% and PDFLatex twice after changing)
%% Sometimes all files except .tex and .bib need to be deleted to prevent
%% build errors.
%% Setting NOINDEX parameteter, then F1, F12, then unset NOINDEX may help.
%%
\Boolean{ISBOOK} {true} % This is formatted as a book
\Boolean{FINALFORM} {true} % Ready for publication
\Boolean{EDITMODE} {no} % Editing mode (double spaced)
% Warning. Watermarks generate errors, but the doc still builds.
\Boolean{WATERMARK} {false} % Place a watermark on the text (SLOW)
\Boolean{TOHTML} {no} % Format for Tex4HT conversion
\Boolean{TOMOBI} {no} % Extra Formatting for Kindle .MOBI
\Boolean{TOEPUB} {no} % Extra Formatting for IDPF .EPUB
\Boolean{RAWHTML} {no} % Allow /HCode directly in text [no PDF]
\Boolean{TOPRESS} {true} % Format for paper printing
\Boolean{NOCOLOR} {no} % Format for monochrome output
\Boolean{SUBCAPTIONS} {true} % Allow subcaptioned figures.
\Boolean{PARENTIMAGES}{false} % Images are in a parent directory.
\Boolean{CHAPTERNOTES}{no} % Place endnotes at end of each chapter
\Boolean{NOBODY} {no} % Incude only the intro [for debugging]
\Boolean{NOLISTS} {yes} % Do not generate lists of figures and tables
\Boolean{NOFIGLIST} {yes} % Do not generate list of figures
\Boolean{NOFIGSRCS} {yes} % Do not generate a list of figure sources
\Boolean{NOTABLIST} {true} % Do not generate list of tables
\Boolean{NOINDEX} {yes} % Do not generate index entries
\Boolean{NOAUTHORS} {yes} % Do not include the Authors section
\Boolean{NOHYPERREF} {yes} % Disables hyperref - href linking
\Boolean{NOABBR} {yes} % Suppress abbreviations
\Boolean{NOIMAGES} {yes} % Disable Graphics inclusion [for debugging]
\Boolean{ONECOLUMN} {no} % Use single column for indexes, authors, etc.
\Boolean{IMAGEMATH} {no} % Use saved images for complex math expressions
%% ----------------------------------------------------------------------------
\advance\hoffset by -0.7 truein\relax
\input{tex/zzInit.tex}% % Document packages and commands
\usepackage{lipsum}
%\usepackage{showidx} % Enable index display in margins for checking
\def\theaipage{\string\hyperpage{\thepage}}
\let\footnote=\endnote % Convert all footnotes into endnotes
\setlength{\columnsep}{1cm} % Space between two columns
\appto{\theindex}{\spaceskip=.33333em plus .33333em minus .11111em }
\ifthenelse{\boolean{EDITMODE}}{\linespread{1.6}}{}
\InitMakeIndex % Set up \index commands
\makeindex % Enable \index commands (oddly, must be at top level)
%------------------------------------------------------------------------------
% KOMA-Script extended page formatting
\ifthenelse{\boolean{FINALFORM}}{}{%
% Put nasty black marks next to HBOX too wide issues
\KOMAoptions{draft=true}
}
%\usepackage[automark,headsepline]{scrlayer-scrpage}
\usepackage[automark]{scrlayer-scrpage}
\deftripstyle{draftstyle}
{} % header left, middle, right
{}
{\headmark}
{\TheAuthor} % footer left, middle, right
{DRAFT:\today}
{\pagemark}
%------------------------------------------------------------------------------
%% Nomenclature and abbreviation commands
\input{tex/zzAbbr.tex}
%------------------------------------------------------------------------------
%------------------------------------------------------------------------------
\begin{document}
%------------------------------------------------------------------------------
% Half Title page, followed by Frontispiece / intro quote page
\frontmatter % book only
% The pageanchor=false/true around the title pages eliminates an annoying
% warning: a destination with the same identifier has been already used,
% duplicate ignored
\hypersetup{pageanchor=false}
\pagenumbering{gobble} % Unnumbered cover page
\newlength{\drop}
\begin{center}
\vspace*{3in}
\Huge{\textsf\TheMainTitle}
\end{center}
\cleardoublepage
\begin{center}
\vspace*{2in}
\vspace*{1in}
\textit{a P. F.}
\end{center}
%------------------------------------------------------------------------------
% Title Page
%\input{tex/zzTitlepage.tex}
%------------------------------------------------------------------------------
% Copyright Page
\newpage
\input{tex/zzCopyright.tex}
\StopIndent
\hypersetup{pageanchor=true}
%------------------------------------------------------------------------------
% Table of Contents (short vesion, then detailed version)
%\newpage
%\pagenumbering{roman} % lowercase roman numerals
%\setcounter{page}{3} % Set the page number
%%
%% Name the sections as needed
%%\renewcommand{\contentsname}{\huge{Contents}}%
%\renewcommand*\contentsname{\huge{Detailed Contents}}
%\renewcommand{\listfigurename}{List of Figures}%
%\renewcommand{\listtablename}{List of Tables}%
%%
%\pagestyle{plain}
%\begingroup% Isolate these changes to just the shorttoc command.
% %\normalsize%
% \setlength{\parskip}{-2pt}% More negative for tighter spacing.
% \pdfbookmark[1]{Contents}{toc}%
% \shorttoc{Summary Contents}{0}% Tighter spacing, Chapter names only.
%\endgroup%
%\tableofcontents
%
%% ----------------------------------------------------------------------------
%% Figures and Tables lists\
\ifthenelse{\boolean{NOLISTS}}{}{%
\cleardoublepage\phantomsection%
\ifthenelse{\boolean{NOFIGLIST}}{}{%
\addcontentsline{toc}{chapter}{List of Figures}%
\listoffigures%
}%
\ifthenelse{\boolean{NOTABLIST}}{}{%
\addcontentsline{toc}{chapter}{List of Tables}%
\listoftables%
}%
}%
%% ----------------------------------------------------------------------------
%% Preface page(s)
\newpage
\newpage
\hypersetup{pageanchor=false}
\chapter*{}
\addcontentsline{toc}{chapter}{Preface}
\input{tex/preface}
%% ----------------------------------------------------------------------------
%% ----------------------------------------------------------------------------
%% Chapters
\mainmatter % book only.
\pagestyle{empty}
\clearpage
\pagenumbering{arabic} % lowercase arabic numbers
\setcounter{page}{1} % Set the first page number
%\input{tex/introduction}
\ifthenelse{\boolean{NOBODY}}{}{
\input{tex/dechargements}%
}
\ChapterSuffix%
%% ----------------------------------------------------------------------------
%% ----------------------------------------------------------------------------
\backmatter
%\BookEndNotes
%% ----------------------------------------------------------------------------
%% ----------------------------------------------------------------------------
%% References [Bibliography of /cited works]
%\setcounter{page}{499}% Set the page number
%\cleardoublepage\phantomsection%
%\addcontentsline{toc}{chapter}{Bibliography}%
%\bibliography{tex/bib/book}%
%% NOTE! Changing the bibliography style will cause massive reformatting of
%% all of the text. You will need to check every page for bad box warnings:
%% ()over/under full \hbox) lines. Don't do this lightly.
%%
%\bibliographystyle{apalike} % Prime Author and year
%\bibliographystyle{plain} % Just numbers
%% ----------------------------------------------------------------------------
%% Cited Authors
%\PrintAuthorIndex
%
%% ----------------------------------------------------------------------------
%% List of Figure Sources
\ifthenelse{\boolean{NOLISTS}}{}{%
\cleardoublepage\phantomsection%
\ifthenelse{\boolean{NOFIGLIST}}{}{%
% List of Figure Sources (attributions)
\ifthenelse{\boolean{NOFIGSRCS}}{}{%
\newpage
\RunningHeads{FIGURE SOURCES}%
\addcontentsline{toc}{chapter}{List of Figure Sources}%
\listofsources
\noindent\textbf{Note}: Additional information on sources and attributions for illustrations and figures can be found online at
\URL{http://YourBooksURL.com/}
}
}
}
%
%% ----------------------------------------------------------------------------
%% Nomenclature, Terms, Abbreviations, Acronyms, and Glossary
\ifthenelse{\boolean{NOABBR}}{}{
\newpage
\addcontentsline{toc}{chapter}{Abbreviations and Terms}
\PrintAcronyms%
}%
%
%% ----------------------------------------------------------------------------
%% Permuted index
\ifthenelse{\boolean{NOINDEX}}{}{%
\cleardoublepage\phantomsection%
% \setcounter{page}{999} % Set the page number [debugging]
\renewcommand{\indexname}{Index}%
\addcontentsline{toc}{chapter}{The Index}%
\raggedright
\PrintIndex%
}%
\RunningHeads{}
%
%% ----------------------------------------------------------------------------
%% Page of metrics and diagram about the physical and logical page format.
\ifdefined\uselayouts
\clearpage
\currentpage
\pagediagram
\pagevalues
\fi
%%
----------------------------------------------------------------------------
\clearpage
\typeout{\detokenize{\TRAP-LOG-MESSAGE}\{\TheAuthor message\}}.
\end{document}