1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %%%%%% Base Document Settings
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 [12pt] % Set default font size
6 {book} % Set document Class
8 %% Set page size and margins
11 paperheight=203.2mm, %actual height measurement of the page
12 paperwidth=127mm, %actual width measurement of the page
13 total={90.54mm, 127mm}, % widht/height of the "text box"/text area on the page
14 top=22.352mm, % top margin
15 bottom=19.177mm, %bottom margin
16 inner=19.177mm, %inner/gutter margin
17 outer=19.177mm, %outer margin
26 %% Set no additional space between paragraphs
27 \setlength{\parskip}{0pt}
29 %% Use this package to enable tables
30 \usepackage{longtable,booktabs}
33 \renewcommand{\toprule}{}
35 %% Hide the bottomrule
36 \renewcommand{\bottomrule}{}
38 \setlength{\LTpost}{0pt}
41 %% Set language and hyphenation rules
42 \usepackage[english]{babel}
45 \usepackage[utf8]{inputenc}
47 %% Enable widow/orphan control
48 %\usepackage[all,defaultlines=2]{nowidow}
52 %% Prevent overfull lines
53 \setlength{\emergencystretch}{3em}
54 \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
56 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %% Needed for styling chapter title headings
62 % Turn off subsection numbering for titles
63 \renewcommand{\thesection}{}
65 %% Style the chapter title that appears on the first page of each chapter
66 \titlespacing*{\chapter}
71 % This tells it to style the titleformat for chapters
72 \titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 %%%%% Headers & Footers
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 %% Needed for headers and footers
80 %% Prevent headers from appearing on empty pages
81 \usepackage{emptypage}
83 %% Remove header/footer from the first page of every chapter
84 \fancypagestyle{plain}{
85 \fancyhf{} %remove/clear header/footer content
86 \renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
89 %% Set the header height in: in, mm, cm, pt
90 \setlength{\headheight}{.35in}
92 %% Set the space between header and text
93 \setlength{\headsep}{.25in}
95 %% Set the header height in: in, mm, cm, pt
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 %% Needed for images; used for cover
102 \usepackage{incgraph,tikz}
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %% Use TrueType system fonts
108 \usepackage{fontspec}
113 ItalicFont={Linux Libertine O:style=Italic},
118 % BoldFont={Aboriginal Serif Bold},
119 % ItalicFont={Aboriginal Serif Italic},
120 % BoldItalicFont={Aboriginal Serif Bold Italic},
121 % SmallCapsFont={TeX Gyre Termes},
122 % SmallCapsFeatures={Letters=SmallCaps},
126 %% Make our quotes curly
127 \defaultfontfeatures{Mapping=tex-text}
129 %% Provides Creative Commons Icons
131 \usepackage{tgadventor}
132 \usepackage[T1]{fontenc}
133 \newfontfamily\sansfont{TeX Gyre Adventor}
136 %% Set Minion Pro macro \primaryfont
137 % This command uses locally installed OTF/TTF Fonts
138 %\newcommand*{\primaryfont}{\fontspec{Minion Pro}\selectfont}
139 %\newcommand*{\primaryfontHead}{\fontspec{MinionPro-BoldIt}\selectfont}
141 % These commands use free TeX fonts from CTAN that are nearly identical
142 %\usepackage{gentium}
143 %\usepackage[T1]{fontenc}
144 %\newfontfamily\primaryfont{Gentium Book Basic}
146 \usepackage{libertine}
147 \usepackage[T1]{fontenc}
148 \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
149 \newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
155 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156 %%%% Metadata Settings
157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159 %% Set Title from Yaml Metadata
162 %% Set subtitle if it exists in Yaml Metadata
164 \newcommand{\subtitle}{$subtitle$}
167 %% Set author from Yaml Metadata
168 \author{$for(author)$$author$$endfor$}
170 %% Set editor from Yaml Metadata
171 \def\editor{$for(contributors)$$contributors.editor$$endfor$}
173 %% Set cover artist from Yaml Metadata
174 \def\artist{$for(contributors)$$contributors.artist$$endfor$}
176 %% Set designer from Yaml Metadata
177 \def\designer{$for(contributors)$$contributors.designer$$endfor$}
179 %% Set publisher from Yaml Metadata
180 \def\publisher{$for(publisher)$$publisher$$endfor$}
182 %% Set website from Yaml Metadata
183 \def\website{$for(website)$$website$$endfor$}
185 %% Use the year instead of the full date
188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
189 %%%% Start the document
190 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 %% Start with the frontmatter
194 % These pages don't count for document page numbering
197 % TeX 'magic' required so we can use macros/variables with @
200 %%%%%%%%%%%%%%%%%%%%%%%%%%%
201 %%%% Create a cover page
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%
203 % No headers or footers
207 \incgraph[documentpaper]
208 [height=\paperheight]{$cover-image$} % Fit to height
210 %% Stretch image to fit page
211 % [width=\paperwidth,height=\paperheight]{$cover-image$}
215 %%%%%%%%%%%%%%%%%%%%%%
216 %% Create a titlepage
217 %%%%%%%%%%%%%%%%%%%%%%
223 % Add a vertical space
226 % Write the Book Title
227 \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother
229 % Add a vertical space
234 \Large \primaryfont $subtitle$ \par
237 % Add a vertical space
240 % Write the author name
241 \Large \normalfont \sansfont \makeatletter \MakeUppercase\@author \makeatother \par
243 % Stop centering everythign
250 %%%%%%%%%%%%%%%%%%%%%%%%%%%
251 %% Create a copyright page
252 %%%%%%%%%%%%%%%%%%%%%%%%%%%
262 % Write the Book Titlecopyright page
263 \makeatletter \scriptsize \@title \par \makeatother
265 % Write the CC logo, year, and author
266 \scriptsize Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
267 \scriptsize Some rights reserved. \par
269 % Add a vertical space
272 % Write what country it was published in
273 \scriptsize Published in the United States by \par
275 % Write the publisher name
276 \scriptsize \publisher \par
279 \scriptsize \website \par
281 % Add a vertical space
284 % Write the specific license name
285 \scriptsize This book is distributed under a Creative Commons attribution-NonCommercial-Sharealike 4.0 License. \par
287 % Add a vertical space
290 % Write the Creative Commons Icons
293 % Stop centering everythign
298 \noindent \sansfont \linespread{1.0}
299 That means you are free:
301 \setlength{\itemsep}{0pt}
302 \setlength{\parskip}{0pt}
303 \setlength{\parsep}{0pt}
304 \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
305 \item \textbf{To Adapt} -- remix, transform, and build upon the material.
307 The licensor cannot revoke these freedoms as long as you follow the license terms: \par
309 \setlength{\itemsep}{0pt}
310 \setlength{\parskip}{0pt}
311 \setlength{\parsep}{0pt}
312 \item \textbf{Attribution} -- You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. \par
313 \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
314 \item \textbf{Share Alike} -- If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. \par
316 \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
318 % Add a vertical space
321 % Start centering again
324 % Attribute the cover artist
325 $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
327 % Attribute the editor
328 $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
330 % Attribute the designer (hey, that's me)
331 $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
333 % Add a vertical space
336 % If ISBNs are defined in Yaml front matter then write them here
337 $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
338 $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
339 $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
345 \clearpage \normalsize
347 %%%%%%%%%%%%%%%%%%%%%%%%%%%
348 %% Create the chapters
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%
350 % This styles the header/footer for normal 'chapter' pages
352 \renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
354 \fancyfoot[C]{} % remove numbered footers
355 \fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
356 \fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
357 \fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
358 \renewcommand{\headrulewidth}{0.0pt}
360 % This says to start the page numbering
363 % Write the body/chapters
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%
368 %% Create the bio page
369 %%%%%%%%%%%%%%%%%%%%%%%%%%%
370 %%%%%%%%%%%%%%%%%%%%%%%%%%%
371 % add blank even page before backmatter starts
372 \newcommand*\cleartoleftpage{%
374 \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
379 % Label as backmatter
385 % Add space before/after the page title
386 \titlespacing*{\section}
391 % This designs the page title
392 \titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
394 % Don't indent new paragraphs
395 \setlength{\parindent}{0mm}
397 % Add space between paragraphs
398 \parskip = \baselineskip
400 % Include the file(s) we specified via the pandoc command, in this case our bio.md