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=228.6mm, %actual height measurement of the page
15 paperwidth=152.4mm, %actual width measurement of the page
16 total={108.65mm, 142.53mm}, % widht/height of the "text box"/text area on the page
17 top=30.0mm, % top margin
18 bottom=27.0mm, %bottom margin
19 inner=22.0mm, %inner/gutter margin
20 outer=19.0mm, %outer margin
29 %% Set lineheight / distance between lines
30 %\setlength{\baselineskip}{16pt}
32 %% Set no additional space between paragraphs
33 \setlength{\parskip}{0pt}
35 %% Use this package to enable tables
36 \usepackage{longtable,booktabs}
39 \renewcommand{\toprule}{}
41 %% Hide the bottomrule
42 \renewcommand{\bottomrule}{}
44 \setlength{\LTpost}{0pt}
46 %% Set language and hyphenation rules
47 \usepackage[english]{babel}
50 %\usepackage[utf8]{inputenc}
52 %% Enable widow/orphan control
53 %\usepackage[all,defaultlines=3]{nowidow}
57 %% Prevent lines from spilling over
58 \setlength{\emergencystretch}{3em}
59 \providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
61 %%%%%%%%% PDF-X stuff, IF USING xelatex %%%%%%%%%
62 % Thanks to LSinev for most of this PDF X-1a stuff;
63 % https://gist.github.com/LSinev/74ea05423c9208d6677d
65 %(mm size * 72)/25.4 = bp size
67 \AtBeginShipout{% %A hook that is executed for every page (after first one)
68 \special{pdf: put @thispage
70 /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
74 \special{pdf: put @thispage
76 /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
81 /GTS_PDFXVersion (PDF/X-1:2001)
82 /GTS_PDFXConformance (PDF/X-1a:2001)
86 \special{pdf:put @catalog
94 /OutputConditionIdentifier (Custom)
95 /RegistryName (http://www.color.org/)
101 \usepackage{datetime} % for \pdfdate command
103 %% URL / Hyperlink style
104 \usepackage[bookmarks=true]{hyperref}
107 \hypersetup{pdfstartpage={}}
109 \hypersetup{unicode=true,
111 pdftitle={$title-meta$}, %set pdftitle metadata from Yaml front matter
113 pdfinfo={% Setting some more PDF/X stuff for xelatex
114 ModDate={D:\pdfdate},% PDF/X document should have a modification date
115 Trapped={False},% PDF/X document should have Trapped tag set
118 pdfauthor={$author-meta$}, %set pdfauthor metadata from Yaml front matter
121 pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$}, %set pdfkeywords metadata from Yaml front matter
125 linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
126 citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
127 urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
129 pdfborder={0 0 0}, %turn off the url border that normally gets added to urls in pdfs
133 \urlstyle{same} % don't use monospace font for urls
135 %% Export PDF as PDF/X-1a for best Createspace results
136 %\usepackage[X-1a]{pdfx}
139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
141 %%%%%%%%%%%%%%%%%%% TITLE SETTINGS
142 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 %% Needed for styling chapter title headings
145 \usepackage{titlesec}
147 % Turn off subsection numbering for titles
148 \renewcommand{\thesection}{}
150 %% Style the chapter title that appears on the first page of each chapter
151 \titlespacing*{\chapter}
156 % This tells it to style the titleformat for chapters
157 \titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
160 %% This part says to style the titles for "chapters"
161 % \titleformat{\chapter}[display]
166 %% This styles the "Chapter 1" part
167 %{\Large Chapter \thechapter \normalfont}
169 %% This is the spacing between the "Chapter 1" and the actual chapter title
172 %% This is the size of the chapter title
175 % Add spacing for the chapter title that appears on the first page of each chapter
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180 %%%%%%%%%%%%%%%%%%% HEADERS AND FOOTERS
181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183 %% Needed for headers and footers
184 \usepackage{fancyhdr}
186 %% Prevent headers from appearing on empty pages
187 \usepackage{emptypage}
189 %% Remove header/footer from the first page of every chapter
190 \fancypagestyle{plain}{
191 \fancyhf{} %remove/clear header/footer content
192 \renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
195 %% Set the header height in: in, mm, cm, pt
196 \setlength{\headheight}{0.10in}
198 %% Set the space between header and text
199 \setlength{\headsep}{.25in}
201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203 %%%%%%%%%%%%%%%%%%% FONTS
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
206 %% Use TrueType system fonts
207 \usepackage{fontspec}
209 %% Used to set some things to all caps
210 \usepackage{textcase}
215 ItalicFont={Linux Libertine O:style=Italic},
216 BoldFont={Linux Libertine O:style=Bold},
217 BoldItalicFont={Linux Libertine O:style=Bold Italic},
222 % BoldFont={Aboriginal Serif Bold},
223 % ItalicFont={Aboriginal Serif Italic},
224 % BoldItalicFont={Aboriginal Serif Bold Italic},
225 % SmallCapsFont={TeX Gyre Termes},
226 % SmallCapsFeatures={Letters=SmallCaps},
229 %% Make our quotes curly
230 \defaultfontfeatures{Mapping=tex-text}
232 %% Provides Creative Commons Icons
235 %% Set Adobe Garamond Pro Bold macro \garmondL
236 %\newcommand*{\garamondL}{\fontspec[Scale=2.0]{Adobe Garamond Pro Bold}\selectfont}
237 %\newcommand*{\garamond}{\fontspec{Adobe Garamond Pro}\selectfont}
239 %% Set URW Gothic macro \goth
240 % This command uses locally installed OTF/TTF Fonts
241 %\newcommand*{\goth}{\fontspec{URW Gothic L}\selectfont}
243 % These commands use free TeX fonts from CTAN that are nearly identical
244 \usepackage{tgadventor}
245 \usepackage[T1]{fontenc}
246 \newfontfamily\sansfont{TeX Gyre Adventor}
249 %% Set Minion Pro macro \minion
250 % This command uses locally installed OTF/TTF Fonts
251 %\newcommand*{\minion}{\fontspec{Minion Pro}\selectfont}
252 %\newcommand*{\minionHead}{\fontspec{MinionPro-BoldIt}\selectfont}
254 % These commands use free TeX fonts from CTAN that are nearly identical
255 %\usepackage{gentium}
256 %\usepackage[T1]{fontenc}
257 %\newfontfamily\minion{Gentium Book Basic}
259 \usepackage{libertine}
260 \usepackage[T1]{fontenc}
261 \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
262 \newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
265 %\renewcommand{\sfdefault}{URW Gothic}
268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 %%%%%%%%%%%%%%%%%%% METADATA and MACROS
271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274 %% Set Title from Yaml Metadata
277 %% Set subtitle if it exists in Yaml Metadata
279 \newcommand{\subtitle}{$subtitle$}
282 %% Set author from Yaml Metadata
283 \author{$for(author)$$author$$endfor$}
285 %% Set editor from Yaml Metadata
286 \def\editor{$for(contributors)$$contributors.editor$$endfor$}
288 %% Set cover artist from Yaml Metadata
289 \def\artist{$for(contributors)$$contributors.artist$$endfor$}
291 %% Set designer from Yaml Metadata
292 \def\designer{$for(contributors)$$contributors.designer$$endfor$}
294 %% Set publisher from Yaml Metadata
295 \def\publisher{$for(publisher)$$publisher$$endfor$}
297 %% Set website from Yaml Metadata
298 \def\website{$for(website)$$website$$endfor$}
300 %% Use the year instead of the full date
303 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305 %%%%%%%%%%%%%%%%%%% START THE DOCUMENT
306 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310 %% Start with the frontmatter
311 % These pages don't count for document page numbering
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%
315 %%%%%%%%%%%%%%%%%%%%%%%%%%%
316 %% Create a titlepage
317 %%%%%%%%%%%%%%%%%%%%%%%%%%%
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%
324 % Add a vertical space
327 % Write the Book Title
328 \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother
330 % Add a vertical space
335 \Large \primaryfont $subtitle$ \par
338 % Add a vertical space
341 % Write the author name
342 \Large \normalfont \sansfont \makeatletter \MakeUppercase\@author \makeatother \par
344 % Stop centering everythign
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%
352 %% Create a copyright page
353 %%%%%%%%%%%%%%%%%%%%%%%%%%%
354 %%%%%%%%%%%%%%%%%%%%%%%%%%%
364 % Write the Book Titlecopyright page
365 \makeatletter \small \@title \par \makeatother
367 % Write the CC logo, year, and author
368 Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
369 Some rights reserved. \par
371 % Add a vertical space
374 % Write what country it was published in
375 Published in the United States by \par
377 % Write the publisher name
383 % Add a vertical space
386 % Write the specific license name
387 This book is distributed under a Creative Commons Attribution-Sharealike 4.0 License. \par
389 % Add a vertical space
392 % Write the Creative Commons Icons
395 % Stop centering everythign
401 That means you are free:
403 \setlength{\itemsep}{0pt}
404 \setlength{\parskip}{0pt}
405 \setlength{\parsep}{0pt}
406 \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
407 \item \textbf{To Adapt} -- remix, transform, and build upon the material.
409 The licensor cannot revoke these freedoms as long as you follow the license terms: \par
411 \setlength{\itemsep}{0pt}
412 \setlength{\parskip}{0pt}
413 \setlength{\parsep}{0pt}
414 \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
415 % \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
416 \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
418 \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
420 % Add a vertical space
423 % Start centering again
426 % Attribute the cover artist
427 $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
429 % Attribute the editor
430 $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
432 % Attribute the designer (hey, that's me)
433 $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
435 % Add a vertical space
438 % If ISBNs are defined in Yaml front matter then write them here
439 $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
440 $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
441 $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
449 %%%%%%%%%%%%%%%%%%%%%%%%%%%
450 %%%%%%%%%%%%%%%%%%%%%%%%%%%
451 %% Create a dedication page
452 %%%%%%%%%%%%%%%%%%%%%%%%%%%
453 %%%%%%%%%%%%%%%%%%%%%%%%%%%
464 % Write the Book Title
465 \normalfont\normalsize $dedication$ \par
474 %%%%%%%%%%%%%%%%%%%%%%%%%%%
475 %%%%%%%%%%%%%%%%%%%%%%%%%%%
476 %% Create the chapters
477 %%%%%%%%%%%%%%%%%%%%%%%%%%%
478 %%%%%%%%%%%%%%%%%%%%%%%%%%%
479 % This styles the header/footer for normal 'chapter' pages
482 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % This removes the 'Chapter x' from the header
483 \renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
485 \fancyfoot[C]{} % remove numbered footers
486 \fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
487 \fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
488 \fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
489 \renewcommand{\headrulewidth}{0.0pt}
492 % This says to start the page numbering
495 % Write the body/chapters
496 \primaryfont \normalsize \flushbottom $body$
498 %%%%%%%%%%%%%%%%%%%%%%%%%%%
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%
500 %% Create the bio page
501 %%%%%%%%%%%%%%%%%%%%%%%%%%%
502 %%%%%%%%%%%%%%%%%%%%%%%%%%%
503 % add blank even page before backmatter starts
504 \newcommand*\cleartoleftpage{%
506 \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
511 % Label as backmatter
517 % Add space before/after the page title
518 \titlespacing*{\section}
523 % This designs the page title
524 \titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
526 % Don't indent new paragraphs
527 \setlength{\parindent}{0mm}
529 % Add space between paragraphs
530 \parskip = \baselineskip
532 % Include the file(s) we specified via the pandoc command, in this case our bio.md