1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %%%%%%%%%%%%%%%%%%% BASE DOCUMENT SETTINGS
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 [crop=true,varwidth,border=0.50001bp,11pt]
9 {book} % Set document Class
11 %% Set page size and margins
14 paperheight=203.2mm, %actual height measurement of the page
15 paperwidth=127mm, %actual width measurement of the page
16 total={90.54mm, 127mm}, % widht/height of the "text box"/text area on the page
17 top=19.177mm, % top margin
18 bottom=19.177mm, %bottom margin
19 inner=22.352mm, %inner/gutter margin
20 outer=17.907mm, %outer margin
23 %% Set lineheight / distance between lines
24 \setlength{\baselineskip}{16pt}
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}
40 %% Set language and hyphenation rules
41 \usepackage[english]{babel}
44 %\usepackage[utf8]{inputenc}
46 %% Enable widow/orphan control
47 %\usepackage[all,defaultlines=3]{nowidow}
52 %% Prevent lines from spilling over
53 \setlength{\emergencystretch}{3em}
54 \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
56 %%%%%%%%% PDF-X stuff, IF USING xelatex %%%%%%%%%
57 % Thanks to LSinev for most of this PDF X-1a stuff;
58 % https://gist.github.com/LSinev/74ea05423c9208d6677d
60 %(mm size * 72)/25.4 = bp size
62 \AtBeginShipout{% %A hook that is executed for every page (after first one)
63 \special{pdf: put @thispage
65 /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
69 \special{pdf: put @thispage
71 /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
76 /GTS_PDFXVersion (PDF/X-1:2001)
77 /GTS_PDFXConformance (PDF/X-1a:2001)
81 \special{pdf:put @catalog
89 /OutputConditionIdentifier (Custom)
90 /RegistryName (http://www.color.org/)
96 \usepackage{datetime} % for \pdfdate command
98 %% URL / Hyperlink style
99 \usepackage[bookmarks=false]{hyperref}
103 \hypersetup{pdfstartpage={}}
105 \hypersetup{unicode=true,
107 pdftitle={$title-meta$}, %set pdftitle metadata from Yaml front matter
109 pdfinfo={% Setting some more PDF/X stuff for xelatex
110 ModDate={D:\pdfdate},% PDF/X document should have a modification date
111 Trapped={False},% PDF/X document should have Trapped tag set
114 pdfauthor={$author-meta$}, %set pdfauthor metadata from Yaml front matter
117 pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$}, %set pdfkeywords metadata from Yaml front matter
121 linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
122 citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
123 urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
125 pdfborder={0 0 0}, %turn off the url border that normally gets added to urls in pdfs
129 \urlstyle{same} % don't use monospace font for urls
131 %% Export PDF as PDF/X-1a for best Createspace results
132 %\usepackage[X-1a]{pdfx}
135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137 %%%%%%%%%%%%%%%%%%% TITLE SETTINGS
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 %% Needed for styling chapter title headings
141 \usepackage{titlesec}
143 % Turn off subsection numbering for titles
144 \renewcommand{\thesection}{}
146 %% Style the chapter title that appears on the first page of each chapter
147 \titlespacing*{\chapter}
152 % This tells it to style the titleformat for chapters
153 \titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
156 %% This part says to style the titles for "chapters"
157 % \titleformat{\chapter}[display]
162 %% This styles the "Chapter 1" part
163 %{\Large Chapter \thechapter \normalfont}
165 %% This is the spacing between the "Chapter 1" and the actual chapter title
168 %% This is the size of the chapter title
171 % Add spacing for the chapter title that appears on the first page of each chapter
174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176 %%%%%%%%%%%%%%%%%%% HEADERS AND FOOTERS
177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 %% Needed for headers and footers
180 \usepackage{fancyhdr}
182 %% Prevent headers from appearing on empty pages
183 \usepackage{emptypage}
185 %% Remove header/footer from the first page of every chapter
186 \fancypagestyle{plain}{
187 \fancyhf{} %remove/clear header/footer content
188 \renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
191 %% Set the header height in: in, mm, cm, pt
192 \setlength{\headheight}{.35in}
194 %% Set the space between header and text
195 \setlength{\headsep}{.25in}
197 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
199 %%%%%%%%%%%%%%%%%%% FONTS
200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202 %% Use TrueType system fonts
203 \usepackage{fontspec}
205 %% Used to set some things to all caps
206 \usepackage{textcase}
211 ItalicFont={Linux Libertine O:style=Italic},
212 BoldFont={Linux Libertine O:style=Bold},
213 BoldItalicFont={Linux Libertine O:style=Bold Italic},
218 % BoldFont={Aboriginal Serif Bold},
219 % ItalicFont={Aboriginal Serif Italic},
220 % BoldItalicFont={Aboriginal Serif Bold Italic},
221 % SmallCapsFont={TeX Gyre Termes},
222 % SmallCapsFeatures={Letters=SmallCaps},
225 %% Make our quotes curly
226 \defaultfontfeatures{Mapping=tex-text}
228 %% Provides Creative Commons Icons
231 %% Set Adobe Garamond Pro Bold macro \garmondL
232 %\newcommand*{\garamondL}{\fontspec[Scale=2.0]{Adobe Garamond Pro Bold}\selectfont}
233 %\newcommand*{\garamond}{\fontspec{Adobe Garamond Pro}\selectfont}
235 %% Set URW Gothic macro \goth
236 % This command uses locally installed OTF/TTF Fonts
237 %\newcommand*{\goth}{\fontspec{URW Gothic L}\selectfont}
239 % These commands use free TeX fonts from CTAN that are nearly identical
240 \usepackage{tgadventor}
241 \usepackage[T1]{fontenc}
242 \newfontfamily\sansfont{TeX Gyre Adventor}
245 %% Set Minion Pro macro \minion
246 % This command uses locally installed OTF/TTF Fonts
247 %\newcommand*{\minion}{\fontspec{Minion Pro}\selectfont}
248 %\newcommand*{\minionHead}{\fontspec{MinionPro-BoldIt}\selectfont}
250 % These commands use free TeX fonts from CTAN that are nearly identical
251 %\usepackage{gentium}
252 %\usepackage[T1]{fontenc}
253 %\newfontfamily\minion{Gentium Book Basic}
255 \usepackage{libertine}
256 \usepackage[T1]{fontenc}
257 \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
258 \newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
261 %\renewcommand{\sfdefault}{URW Gothic}
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 %%%%%%%%%%%%%%%%%%% METADATA and MACROS
267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 %% Set Title from Yaml Metadata
273 %% Set subtitle if it exists in Yaml Metadata
275 \newcommand{\subtitle}{$subtitle$}
278 %% Set author from Yaml Metadata
279 \author{$for(author)$$author$$endfor$}
281 %% Set editor from Yaml Metadata
282 \def\editor{$for(contributors)$$contributors.editor$$endfor$}
284 %% Set cover artist from Yaml Metadata
285 \def\artist{$for(contributors)$$contributors.artist$$endfor$}
287 %% Set designer from Yaml Metadata
288 \def\designer{$for(contributors)$$contributors.designer$$endfor$}
290 %% Set publisher from Yaml Metadata
291 \def\publisher{$for(publisher)$$publisher$$endfor$}
293 %% Set website from Yaml Metadata
294 \def\website{$for(website)$$website$$endfor$}
296 %% Use the year instead of the full date
299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
301 %%%%%%%%%%%%%%%%%%% START THE DOCUMENT
302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306 %% Start with the frontmatter
307 % These pages don't count for document page numbering
310 %%%%%%%%%%%%%%%%%%%%%%%%%%%
311 %%%%%%%%%%%%%%%%%%%%%%%%%%%
312 %% Create a titlepage
313 %%%%%%%%%%%%%%%%%%%%%%%%%%%
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%
320 % Add a vertical space
323 % Write the Book Title
324 \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother
326 % Add a vertical space
331 \Large \primaryfont $subtitle$ \par
334 % Add a vertical space
337 % Write the author name
338 \Large \normalfont \sansfont \makeatletter \MakeUppercase\@author \makeatother \par
340 % Stop centering everythign
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%
347 %%%%%%%%%%%%%%%%%%%%%%%%%%%
348 %% Create a copyright page
349 %%%%%%%%%%%%%%%%%%%%%%%%%%%
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%
360 % Write the Book Titlecopyright page
361 \makeatletter \small \@title \par \makeatother
363 % Write the CC logo, year, and author
364 Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
365 Some rights reserved. \par
367 % Add a vertical space
370 % Write what country it was published in
371 Published in the United States by \par
373 % Write the publisher name
379 % Add a vertical space
382 % Write the specific license name
383 This book is distributed under a Creative Commons attribution-NonCommercial-Sharealike 4.0 License. \par
385 % Add a vertical space
388 % Write the Creative Commons Icons
391 % Stop centering everythign
397 That means you are free:
399 \setlength{\itemsep}{0pt}
400 \setlength{\parskip}{0pt}
401 \setlength{\parsep}{0pt}
402 \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
403 \item \textbf{To Adapt} -- remix, transform, and build upon the material.
405 The licensor cannot revoke these freedoms as long as you follow the license terms: \par
407 \setlength{\itemsep}{0pt}
408 \setlength{\parskip}{0pt}
409 \setlength{\parsep}{0pt}
410 \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
411 \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
412 \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
414 \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
416 % Add a vertical space
419 % Start centering again
422 % Attribute the cover artist
423 $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
425 % Attribute the editor
426 $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
428 % Attribute the designer (hey, that's me)
429 $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
431 % Add a vertical space
434 % If ISBNs are defined in Yaml front matter then write them here
435 $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
436 $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
437 $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
445 %%%%%%%%%%%%%%%%%%%%%%%%%%%
446 %%%%%%%%%%%%%%%%%%%%%%%%%%%
447 %% Create a dedication page
448 %%%%%%%%%%%%%%%%%%%%%%%%%%%
449 %%%%%%%%%%%%%%%%%%%%%%%%%%%
460 % Write the Book Title
461 \normalfont\normalsize $dedication$ \par
470 %%%%%%%%%%%%%%%%%%%%%%%%%%%
471 %%%%%%%%%%%%%%%%%%%%%%%%%%%
472 %% Create the chapters
473 %%%%%%%%%%%%%%%%%%%%%%%%%%%
474 %%%%%%%%%%%%%%%%%%%%%%%%%%%
475 % This styles the header/footer for normal 'chapter' pages
478 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % This removes the 'Chapter x' from the header
479 \renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
481 \fancyfoot[C]{} % remove numbered footers
482 \fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
483 \fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
484 \fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
485 \renewcommand{\headrulewidth}{0.0pt}
488 % This says to start the page numbering
491 % Write the body/chapters
492 \primaryfont \normalsize \flushbottom $body$
494 %%%%%%%%%%%%%%%%%%%%%%%%%%%
495 %%%%%%%%%%%%%%%%%%%%%%%%%%%
496 %% Create the bio page
497 %%%%%%%%%%%%%%%%%%%%%%%%%%%
498 %%%%%%%%%%%%%%%%%%%%%%%%%%%
499 % add blank even page before backmatter starts
500 \newcommand*\cleartoleftpage{%
502 \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
507 % Label as backmatter
513 % Add space before/after the page title
514 \titlespacing*{\section}
519 % This designs the page title
520 \titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
522 % Don't indent new paragraphs
523 \setlength{\parindent}{0mm}
525 % Add space between paragraphs
526 \parskip = \baselineskip
528 % Include the file(s) we specified via the pandoc command, in this case our bio.md