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},
218 %]{Linux Libertine O}
221 ItalicFont={Linux Biolinum O:style=Italic},
222 BoldFont={Linux Biolinum O:style=Bold},
223 BoldItalicFont={Linux Biolinum O:style=Bold Italic},
228 % BoldFont={Aboriginal Serif Bold},
229 % ItalicFont={Aboriginal Serif Italic},
230 % BoldItalicFont={Aboriginal Serif Bold Italic},
231 % SmallCapsFont={TeX Gyre Termes},
232 % SmallCapsFeatures={Letters=SmallCaps},
235 %% Make our quotes curly
236 \defaultfontfeatures{Mapping=tex-text}
238 %% Provides Creative Commons Icons
241 %% Set Adobe Garamond Pro Bold macro \garmondL
242 %\newcommand*{\garamondL}{\fontspec[Scale=2.0]{Adobe Garamond Pro Bold}\selectfont}
243 %\newcommand*{\garamond}{\fontspec{Adobe Garamond Pro}\selectfont}
245 %% Set URW Gothic macro \goth
246 % This command uses locally installed OTF/TTF Fonts
247 %\newcommand*{\goth}{\fontspec{URW Gothic L}\selectfont}
249 % These commands use free TeX fonts from CTAN that are nearly identical
250 \usepackage{tgadventor}
251 \usepackage[T1]{fontenc}
252 \newfontfamily\sansfont{TeX Gyre Adventor}
255 %% Set Minion Pro macro \minion
256 % This command uses locally installed OTF/TTF Fonts
257 %\newcommand*{\minion}{\fontspec{Minion Pro}\selectfont}
258 %\newcommand*{\minionHead}{\fontspec{MinionPro-BoldIt}\selectfont}
260 % These commands use free TeX fonts from CTAN that are nearly identical
261 %\usepackage{gentium}
262 %\usepackage[T1]{fontenc}
263 %\newfontfamily\minion{Gentium Book Basic}
265 \usepackage{libertine}
266 \usepackage[T1]{fontenc}
267 % \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
268 %\newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
269 \newfontfamily\setmainfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
270 \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
271 \newfontfamily\idtitlefont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
272 \newfontfamily\headerfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
273 \newfontfamily\normalfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
274 \newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Biolinum O}
277 %\renewcommand{\sfdefault}{URW Gothic}
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
281 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
282 %%%%%%%%%%%%%%%%%%% METADATA and MACROS
283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
286 %% Set Title from Yaml Metadata
289 %% Set subtitle if it exists in Yaml Metadata
291 \newcommand{\subtitle}{$subtitle$}
294 %% Set author from Yaml Metadata
295 \author{$for(author)$$author$$endfor$}
297 %% Set editor from Yaml Metadata
298 \def\editor{$for(contributors)$$contributors.editor$$endfor$}
300 %% Set cover artist from Yaml Metadata
301 \def\artist{$for(contributors)$$contributors.artist$$endfor$}
303 %% Set designer from Yaml Metadata
304 \def\designer{$for(contributors)$$contributors.designer$$endfor$}
306 %% Set publisher from Yaml Metadata
307 \def\publisher{$for(publisher)$$publisher$$endfor$}
309 %% Set website from Yaml Metadata
310 \def\website{$for(website)$$website$$endfor$}
312 %% Use the year instead of the full date
315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317 %%%%%%%%%%%%%%%%%%% START THE DOCUMENT
318 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322 %% Start with the frontmatter
323 % These pages don't count for document page numbering
326 %%%%%%%%%%%%%%%%%%%%%%%%%%%
327 %%%%%%%%%%%%%%%%%%%%%%%%%%%
328 %% Create a titlepage
329 %%%%%%%%%%%%%%%%%%%%%%%%%%%
330 %%%%%%%%%%%%%%%%%%%%%%%%%%%
336 % Add a vertical space
339 % Write the Book Title
340 \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother
342 % Add a vertical space
347 \Large \primaryfont $subtitle$ \par
350 % Add a vertical space
353 % Write the author name
354 \Large \normalfont \sansfont \makeatletter \MakeUppercase\@author \makeatother \par
356 % Stop centering everythign
362 %%%%%%%%%%%%%%%%%%%%%%%%%%%
363 %%%%%%%%%%%%%%%%%%%%%%%%%%%
364 %% Create a copyright page
365 %%%%%%%%%%%%%%%%%%%%%%%%%%%
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%
376 % Write the Book Titlecopyright page
377 \makeatletter \small \@title \par \makeatother
379 % Write the CC logo, year, and author
380 Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
381 Some rights reserved. \par
383 % Add a vertical space
386 % Write what country it was published in
387 Published in the United States by \par
389 % Write the publisher name
395 % Add a vertical space
398 % Write the specific license name
399 This book is distributed under a Creative Commons Attribution-Sharealike 4.0 License. \par
401 % Add a vertical space
404 % Write the Creative Commons Icons
407 % Stop centering everythign
413 That means you are free:
415 \setlength{\itemsep}{0pt}
416 \setlength{\parskip}{0pt}
417 \setlength{\parsep}{0pt}
418 \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
419 \item \textbf{To Adapt} -- remix, transform, and build upon the material.
421 The licensor cannot revoke these freedoms as long as you follow the license terms: \par
423 \setlength{\itemsep}{0pt}
424 \setlength{\parskip}{0pt}
425 \setlength{\parsep}{0pt}
426 \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
427 % \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
428 \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
430 \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
432 % Add a vertical space
435 % Start centering again
438 % Attribute the cover artist
439 $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
441 % Attribute the editor
442 $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
444 % Attribute the designer (hey, that's me)
445 $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
447 % Add a vertical space
450 % If ISBNs are defined in Yaml front matter then write them here
451 $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
452 $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
453 $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
461 %%%%%%%%%%%%%%%%%%%%%%%%%%%
462 %%%%%%%%%%%%%%%%%%%%%%%%%%%
463 %% Create a dedication page
464 %%%%%%%%%%%%%%%%%%%%%%%%%%%
465 %%%%%%%%%%%%%%%%%%%%%%%%%%%
476 % Write the Book Title
477 \normalfont\normalsize $dedication$ \par
486 %%%%%%%%%%%%%%%%%%%%%%%%%%%
487 %%%%%%%%%%%%%%%%%%%%%%%%%%%
488 %% Create the chapters
489 %%%%%%%%%%%%%%%%%%%%%%%%%%%
490 %%%%%%%%%%%%%%%%%%%%%%%%%%%
491 % This styles the header/footer for normal 'chapter' pages
494 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % This removes the 'Chapter x' from the header
495 \renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
497 \fancyfoot[C]{} % remove numbered footers
498 \fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
499 \fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
500 \fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
501 \renewcommand{\headrulewidth}{0.0pt}
504 % This says to start the page numbering
507 % Write the body/chapters
508 \primaryfont \normalsize \flushbottom $body$
510 %%%%%%%%%%%%%%%%%%%%%%%%%%%
511 %%%%%%%%%%%%%%%%%%%%%%%%%%%
512 %% Create the bio page
513 %%%%%%%%%%%%%%%%%%%%%%%%%%%
514 %%%%%%%%%%%%%%%%%%%%%%%%%%%
515 % add blank even page before backmatter starts
516 \newcommand*\cleartoleftpage{%
518 \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
523 % Label as backmatter
529 % Add space before/after the page title
530 \titlespacing*{\section}
535 % This designs the page title
536 \titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
538 % Don't indent new paragraphs
539 \setlength{\parindent}{0mm}
541 % Add space between paragraphs
542 \parskip = \baselineskip
544 % Include the file(s) we specified via the pandoc command, in this case our bio.md