Merge branch 'release/20200509.01' 20200509.01
authorCraig Maloney <craig@decafbad.net>
Sat, 9 May 2020 17:51:16 +0000 (13:51 -0400)
committerCraig Maloney <craig@decafbad.net>
Sat, 9 May 2020 17:51:16 +0000 (13:51 -0400)
17 files changed:
Makefile
Pandoc/css/style.css [new file with mode: 0644]
Pandoc/templates/amazon-epub.html [new file with mode: 0644]
Pandoc/templates/cs-5x8-pdf.latex [new file with mode: 0644]
Pandoc/templates/cs-6x9-pdf.latex [new file with mode: 0644]
Pandoc/templates/custom-epub.html [new file with mode: 0644]
Pandoc/templates/pdf.latex [new file with mode: 0644]
Pandoc/templates/smashwords-epub.html [new file with mode: 0644]
appendixa.md
chapter01.md
chapter02.md
chapter07.md
epilogue.md
gratitude.md
metadata.xml
metadata.yaml
title.txt

index 60304fb9c5eea6d3eb8a00cf5013288dcfed842e..03ff7b4a8592b7daff44781b03e8674e00055fc6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
 BUILD = build
 BOOKNAME = the_mediocre_programmer
 TITLE = title.txt
-METADATA = metadata.xml
+METADATA_XML = metadata.xml
+METADATA_YAML = metadata.yaml
 CHAPTERS = intro.md chapter01.md chapter02.md chapter03.md chapter04.md chapter05.md chapter06.md chapter07.md epilogue.md gratitude.md appendixa.md
 TOC = --toc --toc-depth=2
 COVER_IMAGE = images/cover_ebook_1600x2400.png
@@ -20,16 +21,17 @@ html: $(BUILD)/html/$(BOOKNAME).html
 
 pdf: $(BUILD)/pdf/$(BOOKNAME).pdf
 
-$(BUILD)/epub/$(BOOKNAME).epub: $(TITLE) $(CHAPTERS)
+$(BUILD)/epub/$(BOOKNAME).epub: $(TITLE) $(CHAPTERS) $(METADATA_YAML)
        mkdir -p $(BUILD)/epub
-       pandoc $(TOC) --chapters --number-offset=0 -S --epub-metadata=$(METADATA) --epub-cover-image=$(COVER_IMAGE) -o $@ $^
+       pandoc -s $(TOC) --chapters --number-offset=0 -S --epub-metadata=$(METADATA_XML) --epub-cover-image=$(COVER_IMAGE) -o $@ $^
 
-$(BUILD)/html/$(BOOKNAME).html: $(CHAPTERS)
+$(BUILD)/html/$(BOOKNAME).html: $(CHAPTERS) $(METADATA_YAML)
        mkdir -p $(BUILD)/html
-       pandoc $(TOC) --chapters --number-offset=0 --standalone --to=html5 -o $@ $^
+       pandoc -s $(TOC) --chapters --number-offset=0 --standalone --to=html5 -o $@ $^
 
-$(BUILD)/pdf/$(BOOKNAME).pdf: $(TITLE) $(CHAPTERS)
+$(BUILD)/pdf/$(BOOKNAME).pdf: $(CHAPTERS) $(METADATA_YAML)
        mkdir -p $(BUILD)/pdf
-       pandoc $(TOC) --chapters --number-offset=0 --latex-engine=pdflatex -V documentclass=$(LATEX_CLASS) -o $@ $^
+       # pandoc $(TOC) --chapters --number-offset=0 --latex-engine=pdflatex -V documentclass=$(LATEX_CLASS) -V papersize=6x9 -o $@ $^
+       pandoc -s $(TOC) --chapters --number-offset=0 --template=Pandoc/templates/cs-6x9-pdf.latex --latex-engine=xelatex  -o $@ $^
 
 .PHONY: all book clean epub html pdf
diff --git a/Pandoc/css/style.css b/Pandoc/css/style.css
new file mode 100644 (file)
index 0000000..93d39d7
--- /dev/null
@@ -0,0 +1,42 @@
+/************** Styling Notes 
+ * Nook has issues with Margin settings, so we default to padding instead since it works as expected across all devices.
+ * Nook has issues with 'shorthand' margin/padding rules (T R B L) so we use the full version (margin-top, etc) instead.
+ * Other notes will be added as needed
+ */
+
+/* Set our 'sane' defaults */
+html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; }
+
+/* Make sure all paragraphs are 'justified' */
+p { text-align: justify; }
+
+/* Don't indent the first paragraph of a chapter */
+p+p { text-indent: 1.5em; }
+
+/* Center but don't indent */
+p+p.center { text-indent: 0; text-align: center; }
+
+/* center */
+.center { text-indent: 0; text-align: center; }
+
+/* Center all of our headings */
+h1, h2, h3, h4, h6 { text-align: center; }
+
+h5 { text-align: center; font-weight: normal; font-size: medium; }
+
+/* Indent our lists */
+li { text-align: left; padding-left: 4em; }
+
+/* Add a top margin for good spacing */
+.top-margin { padding-top: 3em; }
+
+/* Remove the numbers from the Pandoc generated ToC */
+ol.toc { list-style-type:none; }
+
+/* Style our Horizontal Rules */
+hr { border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)); }
+
+/* Style our 'tables'
+ * this is a dirty hack since we're writing fiction and probably not using tables
+ * but I'm using Pandoc's table markdown syntax to center certain text, like songs */
+table {margin-left: auto; margin-right: auto; margin-top: 10px;}
diff --git a/Pandoc/templates/amazon-epub.html b/Pandoc/templates/amazon-epub.html
new file mode 100644 (file)
index 0000000..a79a0f1
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ xml:lang="$lang$"$endif$>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta http-equiv="Content-Style-Type" content="text/css" />
+        <meta name="generator" content="pandoc" />
+        <title>$pagetitle$</title>
+        <link rel="stylesheet" type="text/css" href="$css$" />
+    </head>
+    <body>
+    
+        $if(titlepage)$
+            $for(title)$
+                $if(title.text)$
+                    <h1 class="uppercase">$title.text$</h1>
+                $else$
+                    <h1 class="uppercase">$title$</h1>
+                $endif$
+            $endfor$
+            
+            $if(subtitle)$
+                <h3><em>$subtitle$</em></h3>
+            $endif$
+            
+            $for(year)$
+                <h4>© $year$</h4>
+            $endfor$
+            
+            $for(author)$
+                <h2 class="top-margin">$author$</h2>
+            $endfor$
+            
+            $for(creator)$
+                <h2>$creator.text$</h2>
+            $endfor$
+        
+            $if(publisher)$
+                <h4>$publisher$</h4>
+            $endif$
+            
+            $for(book1)$
+                $if(book1.title)$
+                    <h4 class="top-margin">Also Available</h4>
+                $endif$
+            $endfor$
+            
+            $for(book1)$$if(book1.link)$
+                <p class="center"><a href="$book1.link$">$book1.title$</a></p>
+                $else$
+                <p class="center">$book1.title$</p>
+                $endif$
+            $endfor$
+            $for(book2)$$if(book2.link)$
+                <p class="center"><a href="$book2.link$">$book2.title$</a></p>
+                $else$
+                <p class="center">$book2.title$</p>
+                $endif$
+            $endfor$
+            $for(book3)$$if(book3.link)$
+                <p class="center"><a href="$book3.link$">$book3.title$</a></p>
+                $else$
+                <p class="center">$book3.title$</p>
+                $endif$
+            $endfor$
+            $for(book4)$$if(book4.link)$
+                <p class="center"><a href="$book4.link$">$book4.title$</a></p>
+                $else$
+                <p class="center">$book4.title$</p>
+                $endif$
+            $endfor$
+            $for(book5)$$if(book5.link)$
+                <p class="center"><a href="$book5.link$">$book5.title$</a></p>
+                $else$
+                <p class="center">$book5.title$</p>
+                $endif$
+            $endfor$
+            
+            $if(contributors)$
+            <div class="top-margin">
+            $for(contributors)$
+                $if(contributors.designer)$
+                    <h6>Book Design: $contributors.designer$</h6>
+                $endif$
+                $if(contributors.artist)$
+                    <h6>Cover Artist: $contributors.artist$</h6>
+                $endif$
+                $if(contributors.editor)$
+                    <h6>Editor: $contributors.editor$</h6>
+                $endif$
+            $endfor$
+            </div>
+            $endif$
+            
+        $endif$
+        
+        $body$
+    </body>
+</html>
diff --git a/Pandoc/templates/cs-5x8-pdf.latex b/Pandoc/templates/cs-5x8-pdf.latex
new file mode 100644 (file)
index 0000000..db66d2e
--- /dev/null
@@ -0,0 +1,532 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% BASE DOCUMENT SETTINGS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Set document class
+\documentclass%
+[crop=true,varwidth,border=0.50001bp,11pt]
+{book} % Set document Class
+
+%% Set page size and margins
+\usepackage{geometry}
+  \geometry{
+  paperheight=203.2mm, %actual height measurement of the page
+  paperwidth=127mm, %actual width measurement of the page
+  total={90.54mm, 127mm}, % widht/height of the "text box"/text area on the page
+  top=19.177mm, % top margin
+  bottom=19.177mm, %bottom margin
+  inner=22.352mm, %inner/gutter margin
+  outer=17.907mm, %outer margin
+  }
+
+%% Set lineheight / distance between lines
+\setlength{\baselineskip}{16pt}
+
+%% Set no additional space between paragraphs
+\setlength{\parskip}{0pt}
+
+%% Use this package to enable tables  
+\usepackage{longtable,booktabs}
+
+%% Hide the toprule
+\renewcommand{\toprule}{}
+
+%% Hide the bottomrule
+\renewcommand{\bottomrule}{}
+
+\setlength{\LTpost}{0pt}
+
+%% Set language and hyphenation rules
+\usepackage[english]{babel}
+
+%% Set encoding
+%\usepackage[utf8]{inputenc}
+
+%% Enable widow/orphan control
+%\usepackage[all,defaultlines=3]{nowidow}
+\widowpenalty=10000
+%\clubpenalty=10000
+
+
+%% Prevent lines from spilling over
+\setlength{\emergencystretch}{3em}
+\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+%%%%%%%%% PDF-X stuff, IF USING xelatex %%%%%%%%%
+% Thanks to LSinev for most of this PDF X-1a stuff;
+% https://gist.github.com/LSinev/74ea05423c9208d6677d
+
+%(mm size * 72)/25.4 = bp size
+\usepackage{atbegshi}
+\AtBeginShipout{% %A hook that is executed for every page (after first one)
+    \special{pdf: put @thispage
+      <<
+        /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
+      >>
+    }
+}
+\special{pdf: put @thispage
+  <<
+    /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
+  >>
+}
+\special{pdf:docinfo
+  <<
+    /GTS_PDFXVersion (PDF/X-1:2001)
+    /GTS_PDFXConformance (PDF/X-1a:2001)
+  >>
+}
+
+\special{pdf:put @catalog
+<<
+  /PageMode /UseNone
+  /OutputIntents [
+    <<
+      /Info (none)
+      /Type /OutputIntent
+      /S /GTS_PDFX
+      /OutputConditionIdentifier (Custom)
+      /RegistryName (http://www.color.org/)
+    >>
+  ]
+>>
+}%
+
+\usepackage{datetime} % for \pdfdate command
+
+%% URL / Hyperlink style
+\usepackage[bookmarks=false]{hyperref}
+\NoHyper
+
+
+\hypersetup{pdfstartpage={}}
+
+\hypersetup{unicode=true,
+$if(title-meta)$
+            pdftitle={$title-meta$}, %set pdftitle metadata from Yaml front matter
+$endif$
+            pdfinfo={% Setting some more PDF/X stuff for xelatex
+                ModDate={D:\pdfdate},% PDF/X document should have a modification date
+                Trapped={False},% PDF/X document should have Trapped tag set
+            },
+$if(author-meta)$
+            pdfauthor={$author-meta$}, %set pdfauthor metadata from Yaml front matter
+$endif$
+$if(keywords)$
+            pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$}, %set pdfkeywords metadata from Yaml front matter
+$endif$
+$if(colorlinks)$
+            colorlinks=true,
+            linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
+            citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
+            urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
+$else$
+            pdfborder={0 0 0}, %turn off the url border that normally gets added to urls in pdfs
+$endif$
+            breaklinks=true}
+            
+\urlstyle{same}  % don't use monospace font for urls
+
+%% Export PDF as PDF/X-1a for best Createspace results
+%\usepackage[X-1a]{pdfx}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% TITLE SETTINGS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for styling chapter title headings
+\usepackage{titlesec}
+
+% Turn off subsection numbering for titles
+\renewcommand{\thesection}{}
+
+%% Style the chapter title that appears on the first page of each chapter
+\titlespacing*{\chapter}
+{0pt}%left margin
+{150pt}%top margin
+{25pt}%bottom margin
+
+% This tells it to style the titleformat for chapters
+\titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
+
+%%%%%%%%%%%%%%%%%%
+%% This part says to style the titles for "chapters"
+% \titleformat{\chapter}[display]
+
+%% Use this font
+%{\garamondL}
+
+%% This styles the "Chapter 1" part
+%{\Large Chapter \thechapter \normalfont}
+
+%% This is the spacing between the "Chapter 1" and the actual chapter title
+%{0.5ex}
+
+%% This is the size of the chapter title
+%{\small}%
+
+% Add spacing for the chapter title that appears on the first page of each chapter
+%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% HEADERS AND FOOTERS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for headers and footers
+\usepackage{fancyhdr}
+
+%% Prevent headers from appearing on empty pages
+\usepackage{emptypage}
+
+%% Remove header/footer from the first page of every chapter
+\fancypagestyle{plain}{ 
+\fancyhf{} %remove/clear header/footer content
+\renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
+}
+
+%% Set the header height in: in, mm, cm, pt
+\setlength{\headheight}{.35in}
+
+%% Set the space between header and text
+\setlength{\headsep}{.25in}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% FONTS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Use TrueType system fonts
+\usepackage{fontspec}
+
+%% Used to set some things to all caps
+\usepackage{textcase}
+
+%% Set Main Fonts
+\setmainfont[
+  Ligatures=TeX,
+  ItalicFont={Linux Libertine O:style=Italic},
+  BoldFont={Linux Libertine O:style=Bold},
+  BoldItalicFont={Linux Libertine O:style=Bold Italic},
+]{Linux Libertine O}
+
+%\setmainfont[
+%  Ligatures=TeX,
+%  BoldFont={Aboriginal Serif Bold},
+%  ItalicFont={Aboriginal Serif Italic},
+%  BoldItalicFont={Aboriginal Serif Bold Italic},
+%  SmallCapsFont={TeX Gyre Termes},
+%  SmallCapsFeatures={Letters=SmallCaps},
+%]{Minion Pro}
+
+%% Make our quotes curly
+\defaultfontfeatures{Mapping=tex-text}
+
+%% Provides Creative Commons Icons
+\usepackage{ccicons}
+
+%% Set Adobe Garamond Pro Bold macro \garmondL
+%\newcommand*{\garamondL}{\fontspec[Scale=2.0]{Adobe Garamond Pro Bold}\selectfont}
+%\newcommand*{\garamond}{\fontspec{Adobe Garamond Pro}\selectfont}
+
+%% Set URW Gothic macro \goth
+% This command uses locally installed OTF/TTF Fonts
+%\newcommand*{\goth}{\fontspec{URW Gothic L}\selectfont}
+
+% These commands use free TeX fonts from CTAN that are nearly identical
+\usepackage{tgadventor}
+\usepackage[T1]{fontenc}
+\newfontfamily\sansfont{TeX Gyre Adventor}
+
+
+%% Set Minion Pro macro \minion
+% This command uses locally installed OTF/TTF Fonts
+%\newcommand*{\minion}{\fontspec{Minion Pro}\selectfont}
+%\newcommand*{\minionHead}{\fontspec{MinionPro-BoldIt}\selectfont}
+
+% These commands use free TeX fonts from CTAN that are nearly identical
+%\usepackage{gentium}
+%\usepackage[T1]{fontenc}
+%\newfontfamily\minion{Gentium Book Basic}
+
+\usepackage{libertine}
+\usepackage[T1]{fontenc}
+\newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
+\newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
+
+%\setmainfont
+%\renewcommand{\sfdefault}{URW Gothic}
+%\setmonofont
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% METADATA and MACROS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Set Title from Yaml Metadata
+\title{$title$}
+
+%% Set subtitle if it exists in Yaml Metadata
+$if(subtitle)$
+\newcommand{\subtitle}{$subtitle$}
+$endif$
+
+%% Set author from Yaml Metadata
+\author{$for(author)$$author$$endfor$}
+
+%% Set editor from Yaml Metadata
+\def\editor{$for(contributors)$$contributors.editor$$endfor$}
+
+%% Set cover artist from Yaml Metadata
+\def\artist{$for(contributors)$$contributors.artist$$endfor$}
+
+%% Set designer from Yaml Metadata
+\def\designer{$for(contributors)$$contributors.designer$$endfor$}
+
+%% Set publisher from Yaml Metadata
+\def\publisher{$for(publisher)$$publisher$$endfor$}
+
+%% Set website from Yaml Metadata
+\def\website{$for(website)$$website$$endfor$}
+
+%% Use the year instead of the full date
+\date{$year$}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% START THE DOCUMENT
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+
+%% Start with the frontmatter
+% These pages don't count for document page numbering
+\frontmatter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a titlepage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+% Center everything
+  \begin{center}
+
+% Add a vertical space
+  \vspace*{3cm}
+  
+% Write the Book Title
+  \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother    
+
+% Add a vertical space
+  \vspace{1cm}
+    
+% Write the subtitle
+$if(subtitle)$
+  \Large \primaryfont $subtitle$ \par
+$endif$
+    
+% Add a vertical space
+  \vspace{4cm}
+    
+% Write the author name
+  \Large \normalfont \sansfont  \makeatletter \MakeUppercase\@author \makeatother \par
+
+% Stop centering everythign
+  \end{center}
+
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a copyright page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+
+% Center everything
+  \begin{center} 
+
+% Use Sans font
+  \sansfont
+  
+% Write the Book Titlecopyright page
+  \makeatletter  \small \@title \par \makeatother
+    
+% Write the CC logo, year, and author
+    Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
+    Some rights reserved. \par
+    
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write what country it was published in
+    Published in the United States by \par
+    
+% Write the publisher name
+    \publisher \par
+    
+% Write the website
+    \website \par
+    
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write the specific license name
+    This book is distributed under a Creative Commons attribution-NonCommercial-Sharealike 4.0 License. \par
+
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write the Creative Commons Icons
+    \ccbyncsa
+    
+% Stop centering everythign
+  \end{center}
+       
+% Write license text
+   \scriptsize
+   \noindent \sansfont
+    That means you are free:
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt} 
+          \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
+         \item \textbf{To Adapt} -- remix, transform, and build upon the material.
+      \end{itemize}
+    The licensor cannot revoke these freedoms as long as you follow the license terms: \par
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt}
+          \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
+          \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
+          \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
+      \end{itemize}
+    \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
+    
+% Add a vertical space
+    \vspace{.3cm}
+    
+% Start centering again
+    \begin{center}
+
+% Attribute the cover artist
+      $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
+      
+% Attribute the editor
+      $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
+      
+% Attribute the designer (hey, that's me)
+      $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
+   
+% Add a vertical space
+      \vspace{0.3cm}
+      
+% If ISBNs are defined in Yaml front matter then write them here
+      $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
+      $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
+      $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
+      
+% Stop centering
+    \end{center}
+    
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a dedication page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+
+% Center everything
+  \begin{center}
+
+% Vertically center
+\topskip0pt
+\vspace*{\fill}
+  
+% Write the Book Title
+  \normalfont\normalsize $dedication$ \par
+
+% Stop centering
+\vspace*{\fill}
+    \end{center}
+    
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the chapters
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% This styles the header/footer for normal 'chapter' pages
+\makeatletter
+\pagestyle{fancy}
+%\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % This removes the 'Chapter x' from the header
+\renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
+
+\fancyfoot[C]{} % remove numbered footers
+\fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
+\fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
+\fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
+\renewcommand{\headrulewidth}{0.0pt} 
+\makeatother
+
+% This says to start the page numbering
+\mainmatter
+
+% Write the body/chapters
+\primaryfont \normalsize \flushbottom $body$
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the bio page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% add blank even page before backmatter starts
+\newcommand*\cleartoleftpage{%
+  \clearpage
+  \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
+}
+
+\cleartoleftpage
+
+% Label as backmatter
+\backmatter
+
+% No headers/footers
+\pagestyle{empty}
+
+% Add space before/after the page title
+\titlespacing*{\section}
+{0pt}%left
+{150pt}%top
+{25pt}%bottom
+
+% This designs the page title
+\titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
+
+% Don't indent new paragraphs
+\setlength{\parindent}{0mm}
+
+% Add space between paragraphs
+\parskip = \baselineskip
+
+% Include the file(s) we specified via the pandoc command, in this case our bio.md
+$include-after$
+
+% End the document
+\end{document} 
diff --git a/Pandoc/templates/cs-6x9-pdf.latex b/Pandoc/templates/cs-6x9-pdf.latex
new file mode 100644 (file)
index 0000000..04c3b96
--- /dev/null
@@ -0,0 +1,549 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% BASE DOCUMENT SETTINGS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Set document class
+\documentclass%
+[crop=true,varwidth,border=0.50001bp,11pt]
+{book} % Set document Class
+
+%% Set page size and margins
+\usepackage{geometry}
+  \geometry{
+  paperheight=228.6mm, %actual height measurement of the page
+  paperwidth=152.4mm, %actual width measurement of the page
+  total={108.65mm, 142.53mm}, % widht/height of the "text box"/text area on the page
+  top=30.0mm, % top margin
+  bottom=27.0mm, %bottom margin
+  inner=22.0mm, %inner/gutter margin
+  outer=19.0mm, %outer margin
+  }
+
+%% Set line spacing
+% 1.0 = single space
+% 1.3 = 1.5 space
+% 1.6 = double space
+\linespread{1.3}
+  
+%% Set lineheight / distance between lines
+%\setlength{\baselineskip}{16pt}
+
+%% Set no additional space between paragraphs
+\setlength{\parskip}{0pt}
+
+%% Use this package to enable tables  
+\usepackage{longtable,booktabs}
+
+%% Hide the toprule
+\renewcommand{\toprule}{}
+
+%% Hide the bottomrule
+\renewcommand{\bottomrule}{}
+
+\setlength{\LTpost}{0pt}
+
+%% Set language and hyphenation rules
+\usepackage[english]{babel}
+
+%% Set encoding
+%\usepackage[utf8]{inputenc}
+
+%% Enable widow/orphan control
+%\usepackage[all,defaultlines=3]{nowidow}
+\widowpenalty=10000
+%\clubpenalty=10000
+
+%% Prevent lines from spilling over
+\setlength{\emergencystretch}{3em}
+\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+%%%%%%%%% PDF-X stuff, IF USING xelatex %%%%%%%%%
+% Thanks to LSinev for most of this PDF X-1a stuff;
+% https://gist.github.com/LSinev/74ea05423c9208d6677d
+
+%(mm size * 72)/25.4 = bp size
+\usepackage{atbegshi}
+\AtBeginShipout{% %A hook that is executed for every page (after first one)
+    \special{pdf: put @thispage
+      <<
+        /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
+      >>
+    }
+}
+\special{pdf: put @thispage
+  <<
+    /TrimBox [0 0 360 576] %put here other numbers = size of page in bp
+  >>
+}
+\special{pdf:docinfo
+  <<
+    /GTS_PDFXVersion (PDF/X-1:2001)
+    /GTS_PDFXConformance (PDF/X-1a:2001)
+  >>
+}
+
+\special{pdf:put @catalog
+<<
+  /PageMode /UseNone
+  /OutputIntents [
+    <<
+      /Info (none)
+      /Type /OutputIntent
+      /S /GTS_PDFX
+      /OutputConditionIdentifier (Custom)
+      /RegistryName (http://www.color.org/)
+    >>
+  ]
+>>
+}%
+
+\usepackage{datetime} % for \pdfdate command
+
+%% URL / Hyperlink style
+\usepackage[bookmarks=true]{hyperref}
+
+
+\hypersetup{pdfstartpage={}}
+
+\hypersetup{unicode=true,
+$if(title-meta)$
+            pdftitle={$title-meta$}, %set pdftitle metadata from Yaml front matter
+$endif$
+            pdfinfo={% Setting some more PDF/X stuff for xelatex
+                ModDate={D:\pdfdate},% PDF/X document should have a modification date
+                Trapped={False},% PDF/X document should have Trapped tag set
+            },
+$if(author-meta)$
+            pdfauthor={$author-meta$}, %set pdfauthor metadata from Yaml front matter
+$endif$
+$if(keywords)$
+            pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$}, %set pdfkeywords metadata from Yaml front matter
+$endif$
+$if(colorlinks)$
+            colorlinks=true,
+            linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
+            citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
+            urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
+$else$
+            pdfborder={0 0 0}, %turn off the url border that normally gets added to urls in pdfs
+$endif$
+            breaklinks=true}
+            
+\urlstyle{same}  % don't use monospace font for urls
+
+%% Export PDF as PDF/X-1a for best Createspace results
+%\usepackage[X-1a]{pdfx}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% TITLE SETTINGS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for styling chapter title headings
+\usepackage{titlesec}
+
+% Turn off subsection numbering for titles
+\renewcommand{\thesection}{}
+
+%% Style the chapter title that appears on the first page of each chapter
+\titlespacing*{\chapter}
+{0pt}%left margin
+{150pt}%top margin
+{25pt}%bottom margin
+
+% This tells it to style the titleformat for chapters
+% \titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
+
+%%%%%%%%%%%%%%%%%%
+%% This part says to style the titles for "chapters"
+% \titleformat{\chapter}[display]
+
+%% Use this font
+%{\garamondL}
+
+%% This styles the "Chapter 1" part
+%{\Large Chapter \thechapter \normalfont}
+
+%% This is the spacing between the "Chapter 1" and the actual chapter title
+%{0.5ex}
+
+%% This is the size of the chapter title
+%{\small}%
+
+% Add spacing for the chapter title that appears on the first page of each chapter
+%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% HEADERS AND FOOTERS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for headers and footers
+\usepackage{fancyhdr}
+
+%% Prevent headers from appearing on empty pages
+\usepackage{emptypage}
+
+%% Remove header/footer from the first page of every chapter
+\fancypagestyle{plain}{ 
+\fancyhf{} %remove/clear header/footer content
+\renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
+}
+
+%% Set the header height in: in, mm, cm, pt
+\setlength{\headheight}{0.10in}
+
+%% Set the space between header and text
+\setlength{\headsep}{.25in}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% FONTS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Use TrueType system fonts
+\usepackage{fontspec}
+
+%% Used to set some things to all caps
+\usepackage{textcase}
+
+%% Set Main Fonts
+%\setmainfont[
+  %Ligatures=TeX,
+  %ItalicFont={Linux Libertine O:style=Italic},
+  %BoldFont={Linux Libertine O:style=Bold},
+  %BoldItalicFont={Linux Libertine O:style=Bold Italic},
+%]{Linux Libertine O}
+\setmainfont[
+  Ligatures=TeX,
+  ItalicFont={Linux Biolinum O:style=Italic},
+  BoldFont={Linux Biolinum O:style=Bold},
+  BoldItalicFont={Linux Biolinum O:style=Bold Italic},
+]{Linux Biolinum O}
+
+%\setmainfont[
+%  Ligatures=TeX,
+%  BoldFont={Aboriginal Serif Bold},
+%  ItalicFont={Aboriginal Serif Italic},
+%  BoldItalicFont={Aboriginal Serif Bold Italic},
+%  SmallCapsFont={TeX Gyre Termes},
+%  SmallCapsFeatures={Letters=SmallCaps},
+%]{Minion Pro}
+
+%% Make our quotes curly
+\defaultfontfeatures{Mapping=tex-text}
+
+%% Provides Creative Commons Icons
+\usepackage{ccicons}
+
+%% Set Adobe Garamond Pro Bold macro \garmondL
+%\newcommand*{\garamondL}{\fontspec[Scale=2.0]{Adobe Garamond Pro Bold}\selectfont}
+%\newcommand*{\garamond}{\fontspec{Adobe Garamond Pro}\selectfont}
+
+%% Set URW Gothic macro \goth
+% This command uses locally installed OTF/TTF Fonts
+%\newcommand*{\goth}{\fontspec{URW Gothic L}\selectfont}
+
+% These commands use free TeX fonts from CTAN that are nearly identical
+\usepackage{tgadventor}
+\usepackage[T1]{fontenc}
+\newfontfamily\sansfont{TeX Gyre Adventor}
+
+
+%% Set Minion Pro macro \minion
+% This command uses locally installed OTF/TTF Fonts
+%\newcommand*{\minion}{\fontspec{Minion Pro}\selectfont}
+%\newcommand*{\minionHead}{\fontspec{MinionPro-BoldIt}\selectfont}
+
+% These commands use free TeX fonts from CTAN that are nearly identical
+%\usepackage{gentium}
+%\usepackage[T1]{fontenc}
+%\newfontfamily\minion{Gentium Book Basic}
+
+\usepackage{libertine}
+\usepackage[T1]{fontenc}
+% \newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
+%\newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
+\newfontfamily\setmainfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
+\newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
+\newfontfamily\idtitlefont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
+\newfontfamily\headerfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
+\newfontfamily\normalfont[Ligatures=TeX, Numbers=OldStyle]{Linux Biolinum O}
+\newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Biolinum O}
+
+%\setmainfont
+%\renewcommand{\sfdefault}{URW Gothic}
+%\setmonofont
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% METADATA and MACROS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Set Title from Yaml Metadata
+\title{$title$}
+
+%% Set subtitle if it exists in Yaml Metadata
+$if(subtitle)$
+\newcommand{\subtitle}{$subtitle$}
+$endif$
+
+%% Set author from Yaml Metadata
+\author{$for(author)$$author$$endfor$}
+
+%% Set editor from Yaml Metadata
+\def\editor{$for(contributors)$$contributors.editor$$endfor$}
+
+%% Set cover artist from Yaml Metadata
+\def\artist{$for(contributors)$$contributors.artist$$endfor$}
+
+%% Set designer from Yaml Metadata
+\def\designer{$for(contributors)$$contributors.designer$$endfor$}
+
+%% Set publisher from Yaml Metadata
+\def\publisher{$for(publisher)$$publisher$$endfor$}
+
+%% Set website from Yaml Metadata
+\def\website{$for(website)$$website$$endfor$}
+
+%% Use the year instead of the full date
+\date{$year$}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%% START THE DOCUMENT
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+
+%% Start with the frontmatter
+% These pages don't count for document page numbering
+\frontmatter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a titlepage
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+% Center everything
+  \begin{center}
+
+% Add a vertical space
+  \vspace*{3cm}
+  
+% Write the Book Title
+  \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother    
+
+% Add a vertical space
+  \vspace{1cm}
+    
+% Write the subtitle
+$if(subtitle)$
+  \Large \primaryfont $subtitle$ \par
+$endif$
+    
+% Add a vertical space
+  \vspace{4cm}
+    
+% Write the author name
+  \Large \normalfont \sansfont  \makeatletter \MakeUppercase\@author \makeatother \par
+
+% Stop centering everythign
+  \end{center}
+
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a copyright page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+
+% Center everything
+  \begin{center} 
+
+% Use Sans font
+  \sansfont
+  
+% Write the Book Titlecopyright page
+  \makeatletter  \small \@title \par \makeatother
+    
+% Write the CC logo, year, and author
+    Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
+    Some rights reserved. \par
+    
+% Add a vertical space
+    \vspace{0.4cm}
+
+% Write what country it was published in
+    Published in the United States by \par
+    
+% Write the publisher name
+    \publisher \par
+    
+% Write the website
+    \website \par
+    
+% Add a vertical space
+    \vspace{0.4cm}
+
+% Write the specific license name
+    This book is distributed under a Creative Commons Attribution-Sharealike 4.0 License. \par
+
+% Add a vertical space
+    \vspace{0.4cm}
+
+% Write the Creative Commons Icons
+    \ccbysa
+    
+% Stop centering everythign
+  \end{center}
+       
+% Write license text
+   \scriptsize
+   \noindent \sansfont
+    That means you are free:
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt} 
+          \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
+         \item \textbf{To Adapt} -- remix, transform, and build upon the material.
+      \end{itemize}
+    The licensor cannot revoke these freedoms as long as you follow the license terms: \par
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt}
+          \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
+          % \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
+          \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
+      \end{itemize}
+    \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
+    
+% Add a vertical space
+    \vspace{.5cm}
+    
+% Start centering again
+    \begin{center}
+
+% Attribute the cover artist
+      $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
+      
+% Attribute the editor
+      $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
+      
+% Attribute the designer (hey, that's me)
+      $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
+   
+% Add a vertical space
+      \vspace{0.4cm}
+      
+% If ISBNs are defined in Yaml front matter then write them here
+      $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
+      $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
+      $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
+      
+% Stop centering
+    \end{center}
+    
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a dedication page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+
+% Center everything
+  \begin{center}
+
+% Vertically center
+\topskip0pt
+\vspace*{\fill}
+  
+% Write the Book Title
+  \normalfont\normalsize $dedication$ \par
+
+% Stop centering
+\vspace*{\fill}
+    \end{center}
+    
+% End the page
+\clearpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the chapters
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% This styles the header/footer for normal 'chapter' pages
+\makeatletter
+\pagestyle{fancy}
+%\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % This removes the 'Chapter x' from the header
+\renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
+
+\fancyfoot[C]{} % remove numbered footers
+\fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
+\fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
+\fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
+\renewcommand{\headrulewidth}{0.0pt} 
+\makeatother
+
+% This says to start the page numbering
+\mainmatter
+
+% Write the body/chapters
+\primaryfont \normalsize \flushbottom $body$
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the bio page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% add blank even page before backmatter starts
+\newcommand*\cleartoleftpage{%
+  \clearpage
+  \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
+}
+
+\cleartoleftpage
+
+% Label as backmatter
+\backmatter
+
+% No headers/footers
+\pagestyle{empty}
+
+% Add space before/after the page title
+\titlespacing*{\section}
+{0pt}%left
+{150pt}%top
+{25pt}%bottom
+
+% This designs the page title
+\titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
+
+% Don't indent new paragraphs
+\setlength{\parindent}{0mm}
+
+% Add space between paragraphs
+\parskip = \baselineskip
+
+% Include the file(s) we specified via the pandoc command, in this case our bio.md
+$include-after$
+
+% End the document
+\end{document} 
diff --git a/Pandoc/templates/custom-epub.html b/Pandoc/templates/custom-epub.html
new file mode 100644 (file)
index 0000000..d884687
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ xml:lang="$lang$"$endif$>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta http-equiv="Content-Style-Type" content="text/css" />
+        <meta name="generator" content="pandoc" />
+        <title>$pagetitle$</title>
+        <link rel="stylesheet" type="text/css" href="$css$" />
+    </head>
+    <body>
+    
+        $if(titlepage)$
+            $for(title)$
+                $if(title.text)$
+                    <h1 class="uppercase">$title.text$</h1>
+                $else$
+                    <h1 class="uppercase">$title$</h1>
+                $endif$
+            $endfor$
+            
+            $if(subtitle)$
+                <h3><em>$subtitle$</em></h3>
+            $endif$
+            
+            $for(year)$
+                <h4>© $year$</h4>
+            $endfor$
+            
+            $for(author)$
+                <h2 class="top-margin">$author$</h2>
+            $endfor$
+            
+            $for(creator)$
+                <h2>$creator.text$</h2>
+            $endfor$
+        
+            $if(publisher)$
+                <h4>$publisher$</h4>
+            $endif$
+            
+            $for(book1)$
+                $if(book1.title)$
+                    <p class="center top-margin"><i>Also Available</i></p>
+                    <p>&nbsp;</p>
+                $endif$
+            $endfor$
+            
+            $for(book1)$
+                $if(book1.title)$
+                    <p class="center">$book1.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book2)$
+                $if(book2.title)$
+                    <p class="center">$book2.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book3)$
+                $if(book3.title)$
+                    <p class="center">$book3.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book4)$
+                $if(book4.title)$
+                    <p class="center">$book4.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book5)$
+                $if(book5.title)$
+                    <p class="center">$book5.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(magnet)$
+                $if(magnet.link)$
+                    <p class="center top-margin"><a href="$magnet.link$"><img alt="Free Bonus" src="../Images/file0.jpg"></a></p>
+                $else$
+                    <p class="center top-margin"><img alt="Free Bonus" src="../Images/file0.jpg"></p>
+                $endif$
+            $endfor$
+            
+            $if(contributors)$
+            <div class="top-margin">
+            $for(contributors)$
+                $if(contributors.designer)$
+                    <h6>Book Design: $contributors.designer$</h6>
+                $endif$
+                $if(contributors.artist)$
+                    <h6>Cover Artist: $contributors.artist$</h6>
+                $endif$
+                $if(contributors.editor)$
+                    <h6>Editor: $contributors.editor$</h6>
+                $endif$
+            $endfor$
+            </div>
+            $endif$
+        $endif$
+        
+        $body$
+    </body>
+</html>
diff --git a/Pandoc/templates/pdf.latex b/Pandoc/templates/pdf.latex
new file mode 100644 (file)
index 0000000..9b8f650
--- /dev/null
@@ -0,0 +1,403 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%% Base Document Settings
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\documentclass%
+[12pt] % Set default font size
+{book} % Set document Class
+
+%% Set page size and margins
+\usepackage{geometry}
+  \geometry{
+  paperheight=203.2mm, %actual height measurement of the page
+  paperwidth=127mm, %actual width measurement of the page
+  total={90.54mm, 127mm}, % widht/height of the "text box"/text area on the page
+  top=22.352mm, % top margin
+  bottom=19.177mm, %bottom margin
+  inner=19.177mm, %inner/gutter margin
+  outer=19.177mm, %outer margin
+  }
+%% Set line spacing
+% 1.0 = single space
+% 1.3 = 1.5 space
+% 1.6 = double space
+\linespread{1.3}
+%% Set no additional space between paragraphs
+\setlength{\parskip}{0pt}
+%% Use this package to enable tables  
+\usepackage{longtable,booktabs}
+
+%% Hide the toprule
+\renewcommand{\toprule}{}
+
+%% Hide the bottomrule
+\renewcommand{\bottomrule}{}
+
+\setlength{\LTpost}{0pt}
+
+  
+%% Set language and hyphenation rules
+\usepackage[english]{babel}
+
+%% Set encoding
+\usepackage[utf8]{inputenc}
+
+%% Enable widow/orphan control
+%\usepackage[all,defaultlines=2]{nowidow}
+\widowpenalty=10000
+\clubpenalty=10000
+
+%% Prevent overfull lines
+\setlength{\emergencystretch}{3em}
+\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%% Title Settings
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for styling chapter title headings
+\usepackage{titlesec}
+
+% Turn off subsection numbering for titles
+\renewcommand{\thesection}{}
+
+%% Style the chapter title that appears on the first page of each chapter
+\titlespacing*{\chapter}
+{0pt}%left margin
+{150pt}%top margin
+{25pt}%bottom margin
+
+% This tells it to style the titleformat for chapters
+\titleformat{\chapter}[display]{\bfseries\titlefont}{\Large Chapter \thechapter \normalfont}{0.5mm}{\small}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% Headers & Footers
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for headers and footers
+\usepackage{fancyhdr}
+
+%% Prevent headers from appearing on empty pages
+\usepackage{emptypage}
+
+%% Remove header/footer from the first page of every chapter
+\fancypagestyle{plain}{ 
+\fancyhf{} %remove/clear header/footer content
+\renewcommand{\headrulewidth}{0.0pt} %remove black line/"rule" from header
+}
+
+%% Set the header height in: in, mm, cm, pt
+\setlength{\headheight}{.35in}
+
+%% Set the space between header and text
+\setlength{\headsep}{.25in}
+
+%% Set the header height in: in, mm, cm, pt
+%\headheight=in
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%% Images
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Needed for images; used for cover
+\usepackage{incgraph,tikz}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%% Fonts
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Use TrueType system fonts
+\usepackage{fontspec}
+
+%% Set Main Fonts
+\setmainfont[
+  Ligatures=TeX,
+  ItalicFont={Linux Libertine O:style=Italic},
+]{Linux Libertine O}
+
+%\setmainfont[
+%  Ligatures=TeX,
+%  BoldFont={Aboriginal Serif Bold},
+%  ItalicFont={Aboriginal Serif Italic},
+%  BoldItalicFont={Aboriginal Serif Bold Italic},
+%  SmallCapsFont={TeX Gyre Termes},
+%  SmallCapsFeatures={Letters=SmallCaps},
+%]{Minion Pro}
+
+
+%% Make our quotes curly
+\defaultfontfeatures{Mapping=tex-text}
+
+%% Provides Creative Commons Icons
+\usepackage{ccicons}
+\usepackage{tgadventor}
+\usepackage[T1]{fontenc}
+\newfontfamily\sansfont{TeX Gyre Adventor}
+
+
+%% Set Minion Pro macro \primaryfont
+% This command uses locally installed OTF/TTF Fonts
+%\newcommand*{\primaryfont}{\fontspec{Minion Pro}\selectfont}
+%\newcommand*{\primaryfontHead}{\fontspec{MinionPro-BoldIt}\selectfont}
+
+% These commands use free TeX fonts from CTAN that are nearly identical
+%\usepackage{gentium}
+%\usepackage[T1]{fontenc}
+%\newfontfamily\primaryfont{Gentium Book Basic}
+
+\usepackage{libertine}
+\usepackage[T1]{fontenc}
+\newfontfamily\primaryfont[Ligatures=TeX, Numbers=OldStyle]{Linux Libertine O}
+\newfontfamily\titlefont[Scale=1.75, Ligatures=TeX]{Linux Libertine O}
+
+%\setmainfont
+%\setsansfont
+%\setmonofont
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Metadata Settings
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Set Title from Yaml Metadata
+\title{$title$}
+
+%% Set subtitle if it exists in Yaml Metadata
+$if(subtitle)$
+\newcommand{\subtitle}{$subtitle$}
+$endif$
+
+%% Set author from Yaml Metadata
+\author{$for(author)$$author$$endfor$}
+
+%% Set editor from Yaml Metadata
+\def\editor{$for(contributors)$$contributors.editor$$endfor$}
+
+%% Set cover artist from Yaml Metadata
+\def\artist{$for(contributors)$$contributors.artist$$endfor$}
+
+%% Set designer from Yaml Metadata
+\def\designer{$for(contributors)$$contributors.designer$$endfor$}
+
+%% Set publisher from Yaml Metadata
+\def\publisher{$for(publisher)$$publisher$$endfor$}
+
+%% Set website from Yaml Metadata
+\def\website{$for(website)$$website$$endfor$}
+
+%% Use the year instead of the full date
+\date{$year$}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Start the document
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{document}
+
+%% Start with the frontmatter
+% These pages don't count for document page numbering
+\frontmatter
+
+% TeX 'magic' required so we can use macros/variables with @
+\makeatletter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Create a cover page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers or footers
+\pagestyle{empty}
+
+% The image
+\incgraph[documentpaper]
+[height=\paperheight]{$cover-image$} % Fit to height
+
+%% Stretch image to fit page
+%  [width=\paperwidth,height=\paperheight]{$cover-image$}
+
+% End the page
+\clearpage
+%%%%%%%%%%%%%%%%%%%%%%
+%% Create a titlepage
+%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+% Center everything
+  \begin{center}
+
+% Add a vertical space
+  \vspace*{3cm}
+  
+% Write the Book Title
+  \makeatletter \Huge \bfseries \titlefont \textbf{\textsc{\@title}} \par \makeatother    
+
+% Add a vertical space
+  \vspace{1cm}
+    
+% Write the subtitle
+$if(subtitle)$
+  \Large \primaryfont $subtitle$ \par
+$endif$
+    
+% Add a vertical space
+  \vspace{3cm}
+    
+% Write the author name
+  \Large \normalfont \sansfont  \makeatletter \MakeUppercase\@author \makeatother \par
+
+% Stop centering everythign
+  \end{center}
+
+% End the page
+\clearpage
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create a copyright page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% No headers/footers
+\pagestyle{empty}
+
+% Center everything
+  \begin{center} 
+
+% Use Sans font
+  \sansfont
+  
+% Write the Book Titlecopyright page
+  \makeatletter  \scriptsize \@title \par \makeatother
+    
+% Write the CC logo, year, and author
+    \scriptsize Copyright \ccLogo\ \makeatletter \@date \ \@author \makeatother \par
+    \scriptsize Some rights reserved. \par
+    
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write what country it was published in
+    \scriptsize Published in the United States by \par
+    
+% Write the publisher name
+    \scriptsize \publisher \par
+    
+% Write the website
+    \scriptsize \website \par
+    
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write the specific license name
+    \scriptsize This book is distributed under a Creative Commons attribution-NonCommercial-Sharealike 4.0 License. \par
+
+% Add a vertical space
+    \vspace{0.3cm}
+
+% Write the Creative Commons Icons
+    \ccbyncsa
+    
+% Stop centering everythign
+  \end{center}
+       
+% Write license text
+   \scriptsize
+   \noindent \sansfont \linespread{1.0}
+    That means you are free:
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt} 
+          \item \textbf{To Share} -- copy and redistribute the material in any medium or format.
+         \item \textbf{To Adapt} -- remix, transform, and build upon the material.
+      \end{itemize}
+    The licensor cannot revoke these freedoms as long as you follow the license terms: \par
+      \begin{itemize}
+        \setlength{\itemsep}{0pt}
+        \setlength{\parskip}{0pt}
+        \setlength{\parsep}{0pt}
+          \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
+          \item \textbf{NonCommercial} -- You may not use the material for commercial purposes. \par
+          \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
+      \end{itemize}
+    \textbf No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
+    
+% Add a vertical space
+    \vspace{.3cm}
+    
+% Start centering again
+    \begin{center}
+
+% Attribute the cover artist
+      $for(contributors)$$if(contributors.artist)$ Cover Artist: \artist \par$endif$$endfor$
+      
+% Attribute the editor
+      $for(contributors)$$if(contributors.editor)$ Editor: \editor \par$endif$$endfor$
+      
+% Attribute the designer (hey, that's me)
+      $for(contributors)$$if(contributors.designer)$ Design: \designer \par$endif$$endfor$
+   
+% Add a vertical space
+      \vspace{0.3cm}
+      
+% If ISBNs are defined in Yaml front matter then write them here
+      $if(paperback-isbn)$Paperback ISBN: {$paperback-isbn$} \par $endif$
+      $if(hardcover-isbn)$HardcoverISBN: {$hardcover-isbn$}\par $endif$
+      $if(epub-isbn)$ePub ISBN: {$epub-isbn$} \par $endif$
+      
+% Stop centering
+    \end{center}
+    
+% End the page
+\clearpage \normalsize
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the chapters
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% This styles the header/footer for normal 'chapter' pages
+\pagestyle{fancy}
+\renewcommand{\chaptermark}[1]{\markboth {\@chapapp\ \thechapter \hspace{1mm}-\hspace{1mm}{#1}}{}}
+
+\fancyfoot[C]{} % remove numbered footers
+\fancyhead[RO,LE]{\primaryfont\bfseries \thepage} % add page numbers to the header
+\fancyhead[LO]{\primaryfont\bfseries \textsc \leftmark} % add subtitle to header
+\fancyhead[RE]{\primaryfont\bfseries \textsc \@title}
+\renewcommand{\headrulewidth}{0.0pt} 
+
+% This says to start the page numbering
+\mainmatter
+
+% Write the body/chapters
+\primaryfont $body$
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Create the bio page
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% add blank even page before backmatter starts
+\newcommand*\cleartoleftpage{%
+  \clearpage
+  \ifodd\value{page}\hbox{}\thispagestyle{empty}\newpage\fi
+}
+
+\cleartoleftpage
+
+% Label as backmatter
+\backmatter
+
+% No headers/footers
+\pagestyle{empty}
+
+% Add space before/after the page title
+\titlespacing*{\section}
+{0pt}%left
+{150pt}%top
+{25pt}%bottom
+
+% This designs the page title
+\titleformat{\section}[display]{\bfseries\titlefont}{}{0.5mm}{\centering \Large} % Don't say 'chapter X'
+
+% Don't indent new paragraphs
+\setlength{\parindent}{0mm}
+
+% Add space between paragraphs
+\parskip = \baselineskip
+
+% Include the file(s) we specified via the pandoc command, in this case our bio.md
+$include-after$
+% End the document
+\end{document} 
diff --git a/Pandoc/templates/smashwords-epub.html b/Pandoc/templates/smashwords-epub.html
new file mode 100644 (file)
index 0000000..28821d5
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ xml:lang="$lang$"$endif$>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta http-equiv="Content-Style-Type" content="text/css" />
+        <meta name="generator" content="pandoc" />
+        <title>$pagetitle$</title>
+        <link rel="stylesheet" type="text/css" href="$css$" />
+    </head>
+    <body>
+    
+        $if(titlepage)$
+            $for(title)$
+                $if(title.text)$
+                    <h1 class="uppercase">$title.text$</h1>
+                $else$
+                    <h1 class="uppercase">$title$</h1>
+                $endif$
+            $endfor$
+            
+            $if(subtitle)$
+                <h3><em>$subtitle$</em></h3>
+            $endif$
+            
+            $for(year)$
+                <h4>© $year$</h4>
+            $endfor$
+            
+            $for(author)$
+                <h2 class="top-margin">$author$</h2>
+            $endfor$
+            
+            $for(creator)$
+                <h2>$creator.text$</h2>
+            $endfor$
+        
+            $if(publisher)$
+                <h4>$publisher$</h4>
+            $endif$
+            
+            <br><p class="center"><em>Smashwords Edition</em></p>
+            
+            $for(book1)$
+                $if(book1.title)$
+                    <p class="center top-margin"><i>Also Available</i></p>
+                    <br>
+                $endif$
+            $endfor$
+            
+            $for(book1)$
+                $if(book1.title)$
+                    <p class="center">$book1.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book2)$
+                $if(book2.title)$
+                    <p class="center">$book2.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book3)$
+                $if(book3.title)$
+                    <p class="center">$book3.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book4)$
+                $if(book4.title)$
+                    <p class="center">$book4.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(book5)$
+                $if(book5.title)$
+                    <p class="center">$book5.title$</p>
+                $endif$
+            $endfor$
+            
+            $for(magnet)$
+                $if(magnet.link)$
+                    <p class="center top-margin"><a href="$magnet.link$"><img alt="Free Bonus" src="../Images/file0.jpg"></a></p>
+                $else$
+                    <p class="center top-margin"><img alt="Free Bonus" src="../Images/file0.jpg"></p>
+                $endif$
+            $endfor$
+            
+            $if(contributors)$
+            <div class="top-margin">
+            $for(contributors)$
+                $if(contributors.designer)$
+                    <h6>Book Design: $contributors.designer$</h6>
+                $endif$
+                $if(contributors.artist)$
+                    <h6>Cover Artist: $contributors.artist$</h6>
+                $endif$
+                $if(contributors.editor)$
+                    <h6>Editor: $contributors.editor$</h6>
+                $endif$
+            $endfor$
+            </div>
+            $endif$
+        $endif$
+        
+        $body$
+    </body>
+</html>
index 75d11a1c49f3deef9182a8c5bd1401f1c54b6d3c..153898fdaa41ed1cb95cf93f81ddae9120d1e1a9 100644 (file)
@@ -1,4 +1,6 @@
-# Appendix A {-}
+\appendix
+
+# My journey
 
 My journey as a programmer started when I was in elementary school. I became interested in computers after reading about them in the World Book Encyclopedia and hoped to work with them some day. What I didn't realize was that those encyclopedias were out-of-date and only showed the larger, more expensive mainframe and mini-computers of the 1960s and not the more modern microcomputers that were introduced in the late 1970s. When I realized that an Apple ][ was a microcomputer and that it was designed for the home market I began my quest to get a computer of my own (AKA: I started dropping not-so-subtle hints to my parents that I wanted a computer). I scoured magazines like Popular Computing and Byte Magazine looking for the right computer; from the Commodore VIC-20 and Sinclair ZX-80 to the Radio Shack TRS-80 Model III (Even the Rockwell AIM-65 or Heathkit H89 would have worked. I wasn't picky back then.) My dad took me to computer stores and I marveled at the variety of machines that were there (and likely made a few sales-people nervous as I poked and prodded the new and rather expensive machines). Finally my dad picked up an Atari 400 computer with tape drive, and I began learning BASIC programming in earnest. Around the same time my school opened a "computer lab" with three Commodore PET 4032 machines (complete with floppy disk drives), and I found myself spending every moment I could with those machines. In high school I took two programming courses, one in BASIC and the other in Pascal (which was my first exposure to procedural languages, and the basic concepts of computer science). In college I majored in Computer Science with a Bachelor of Science and did my best to keep up with all of the things that they tried to teach me. Unfortunately, I wasn't a great student (especially in mathematics). I struggled with and later dropped my compilers class, and felt like I was falling behind where other students succeeded. Most of our classes used Pascal, which I was becoming more familiar with, but there were a few classes that used COBOL, Ada, SNOBOL, C, and assembly language. I graduated with modest scores and returned home.
 
index fd3a6fe4290d7ceacdf8de921bbdc860d26a7cbe..56ae6ab89056f5cfc6c457d9a7f4a1ae837342eb 100644 (file)
@@ -1,4 +1,4 @@
-# The Journey of the mediocre programmer
+# Journey of The Mediocre Programmer
 ## How we got here
 
 You have your own unique story of how you got here as a programmer. You might have found out about programming as a curious child who wanted to see what the computer could do. Or you could have arrived as an adult who heard about these things called computers that you could program. Whatever the case, you had a journey to get to this point, and you learned a certain amount to get here. You spent your free time learning how to code, or you were fortunate to be able to work on programming as part of your job. You went to school to learn more about programming or you took training classes. You bought books or read articles online to learn more about programming. Whatever path you took you began your journey as a programmer.
index 42ef70ce11bbf2305d5b41d93a87ca7331191cad..2b8e9eef3f3b73a3b7fc791f9d59703f5cb0cab2 100644 (file)
@@ -16,7 +16,7 @@ The post-mortem can be a fascinating look into the development of a project. I'v
 
 A post-mortem also has the benefit of hindsight. Decisions that were clear and definite at the time might not make much sense when viewed with data obtained later in the project's lifespan. There's also an issue with "selective memory" where something might not be remembered with the same clarity, or may be conflated with other events. Confident statements like "We knew this one thing wouldn't have worked" might actually have been "We weren't sure if this would work so we tried several things. They all didn't work.". Consider anyone writing about their past as an unreliable narrator. True, they may be the best and most knowledgeable narrator we have, but they do not have an objective perspective on whatever they were creating. They have their own biases and reasons for the stories they present in a post-mortem. Treat a post-mortem like you would treat an auto-biography of a famous person: a primary source with an agenda to show the subject in the best way possible.
 
-There's nothing wrong with reading a post-mortem about a project -- we can learn a great deal about how a project is run (or shouldn't be run) and what pitfalls to be aware of if we go down a similar path, but understand that you're reading one account (whether by one person or one team of people). They have the perspective of someone deep in the conflict. You're looking at their recollections of tactics, not the overall strategy that brought that them to the place.
+There's nothing wrong with reading a post-mortem about a project --- we can learn a great deal about how a project is run (or shouldn't be run) and what pitfalls to be aware of if we go down a similar path, but understand that you're reading one account (whether by one person or one team of people). They have the perspective of someone deep in the conflict. You're looking at their recollections of tactics, not the overall strategy that brought that them to the place.
 
 ## Ranking programmers
 
index b7281b8d3131c92c3e3ef45ff252f2f666f5600a..275b25986055adeb997e1c7a6571b22d12fa4537 100644 (file)
@@ -102,11 +102,11 @@ Burnout is tricky to self-diagnose because it is a collection of seemingly unrel
 
 There are some things we can do to understand and help alleviate burnout:
 
-1. Realize that we're burned out, or about to burn out. Acknowledging that we're about to burn out is key to not experiencing the burnout. That seems simple enough but we tend to ignore the symptoms when we're nearing the throes of burnout. If we can recognize that we're about to burn out then we can take measures to avoid it. And if we realize that we're burned out we can take measures to be kind to ourselves and help ourselves out of this burned-out state.
-1. Examine our emotions. Sit for a while and notice what emotions come into view. Are we feeling stress, fear, anxiety, nervousness, or anger? Notice what feelings emerge and recognize these feelings. Examine where these feelings are coming from and what might be triggering these emotions.
-1. Re-negotiate our commitments. Many times burnout is the result of over commitment, whether to ourselves or others. We always have too much to do, and despite our best efforts we will always acquire new obligations. Perhaps the plans we made were too aggressive, or something changed in the world that disrupted our plans. Whatever the reasons we may need to re-evaluate what is expected of us and what we are capable of doing. If we see that we've created an intractable situation for ourselves we need to figure out how to remove some of these obligations or re-negotiate them.
-1. Give our "drive" a rest. Unlike our mechanical counterparts we need downtime and rest. We can't work a straight eight or more hours without at least some moments where we aren't working. Programming demands a lot of mental bandwidth and pushing ourselves to exhaustion can lead to emotional instability, stress, and burnout.
-1. Examine if this is truly how we want to live our lives. We need to determine if what we're doing is really what we want to be doing. If we're not happy with what we're doing then every moment we continue doing it can compound our feelings of unhappiness. If we feel nothing but dread for our current situation then we may need to renegotiate our commitments. That can be something as simple as agreeing not to learn something right now, or can be as complex as taking on different work or changing careers.
+* Realize that we're burned out, or about to burn out. Acknowledging that we're about to burn out is key to not experiencing the burnout. That seems simple enough but we tend to ignore the symptoms when we're nearing the throes of burnout. If we can recognize that we're about to burn out then we can take measures to avoid it. And if we realize that we're burned out we can take measures to be kind to ourselves and help ourselves out of this burned-out state.
+* Examine our emotions. Sit for a while and notice what emotions come into view. Are we feeling stress, fear, anxiety, nervousness, or anger? Notice what feelings emerge and recognize these feelings. Examine where these feelings are coming from and what might be triggering these emotions.
+* Re-negotiate our commitments. Many times burnout is the result of over commitment, whether to ourselves or others. We always have too much to do, and despite our best efforts we will always acquire new obligations. Perhaps the plans we made were too aggressive, or something changed in the world that disrupted our plans. Whatever the reasons we may need to re-evaluate what is expected of us and what we are capable of doing. If we see that we've created an intractable situation for ourselves we need to figure out how to remove some of these obligations or re-negotiate them.
+* Give our "drive" a rest. Unlike our mechanical counterparts we need downtime and rest. We can't work a straight eight or more hours without at least some moments where we aren't working. Programming demands a lot of mental bandwidth and pushing ourselves to exhaustion can lead to emotional instability, stress, and burnout.
+* Examine if this is truly how we want to live our lives. We need to determine if what we're doing is really what we want to be doing. If we're not happy with what we're doing then every moment we continue doing it can compound our feelings of unhappiness. If we feel nothing but dread for our current situation then we may need to renegotiate our commitments. That can be something as simple as agreeing not to learn something right now, or can be as complex as taking on different work or changing careers.
 
 By understanding that we're headed toward burnout (or are burned-out already) we can take measures to course-correct so we can approach our programming practice with joy and enthusiasm. Sometimes taking a step back and re-evaluating what we're doing can help us not sit in the constant loops of frustration, anger, and guilt. Changing our story to better fit reality can keep us from trying to match an impossible dream. 
 
index d9db6c7c884a690ba314ef27649144dc64b4718a..ece4a314141e264870b2f3154161f38b0e886691 100644 (file)
@@ -1,4 +1,4 @@
-# Epilogue {-}
+# Epilogue
 
 It's a cliché for an author to say the book they wrote is the one they wished they had read when they were confronted with the topics presented in the book. Perhaps it's a cliché because it's true: this book contains the advice that would have helped me when I started this journey. Too often I've wondered if I've measured up to whatever metrics I created to represent the ideal programmer. Many times I saw the success of my peers and wondered if I was defective as a programmer or deficient in my learning. What was I getting wrong that others were getting right? 
 
index 89f1c47e06414a9b876f440f7ecb3ee371c1403e..01e96c42fef0688c4edea7a832b2c80c92081784 100644 (file)
@@ -1,10 +1,10 @@
-# Gratitude {-}
+# Gratitude
 
 This book would not exist without the folks who have accompanied me on my journey, both as instructors and as colleagues. My thanks and appreciation to all of my instructors in my formative years for giving me their best efforts to teach me programming in its various forms. I am indebted to all of my colleagues and programming friends over the years who shared their knowledge with me and trusted me enough to help them along the way. I am also blessed to have many communities that help sustain me, including the [Michigan!/usr/group][1], [PyOhio][2], [Coffee House Coders][3], and the [Ubuntu Michigan Loco][4]. Also to those who don't fit in these neat categories; know that if we have spent any time discussing programming or other matters that our discussions are deeply appreciated.
 
 I also am grateful for the work of Leo Babauta of [Zen Habits][5] which provided me the ideas of mindfulness and focus containers. They have been transformative in my own work, as this book demonstrates. I committed to spending at least 10 minutes each morning writing each section, and the results are the work you see before you.
 
-Thank you to those who helped me directly with this project. Thank you to my mom, Sharon Maloney, for help in my editing  of this book. Any mist steaks what remain are an responsibilities of the author. Thank you to Beau Sheldon for reviewing the chapter on mental health and for helping me to better understand and highlight areas where folks struggle. Thank you to my friend, David Revoy, for his amazing cover art and for his inspiration throughout the project. Thank you to the beta readers for your valuable comments and feedback (their names are currently listed on the Framagit repo but will be listed here in a future revision).
+Thank you to those who helped me directly with this project. Thank you to my mom, Sharon Maloney, for help in my editing  of this book. Any mist steaks what remain are an responsibilities of the author. Thank you to Beau Sheldon for reviewing the chapter on mental health and for helping me to better understand and highlight areas where folks struggle. Thank you to my friend, David Revoy, for his amazing cover art and for his inspiration throughout the project. Thank you to the beta readers for your valuable comments and feedback in the Framagit Repository, including (in alphabetical order by handle or first name): Brendan Kidwell, D. Joe Anderson, David Revoy, Jer Lance, Matthew Piccinato, Matthew Balch, Midgard, Nicholas Guarracino, RJ Quiralta, Valvin, and Wilhelm Fitzpatrick.
 
 My deepest gratitude goes to my wife JoDee and my parents for their support and belief in me. Words cannot express the love and thanks I have for you.
 
index fe471d6b80b6f5dae1e59a63051dc37c5fdf82f2..6b6c9f8d99245a07476d952e2d5b34ea9b53c65b 100644 (file)
@@ -1,2 +1,2 @@
-<dc:rights>Copyright 2018, Craig Maloney. Released under a CC-BY-SA International 4.0 License</dc:rights>
+<dc:rights>Copyright 2019, Craig Maloney. Released under a CC-BY-SA International 4.0 License</dc:rights>
 <dc:language>en-US</dc:language>
index 90fe1e75bb827476c29ed925fa4e16f837e29875..c13b150ed31de854f8e24e9e42eec7927a8f2bdf 100644 (file)
@@ -1,5 +1,12 @@
 ---
 title: 'The Mediocre Programmer'
 author:
-    - Craig Maloney
+- Craig Maloney
+contributors:
+    - artist: David Revoy
+      editor: Sharon Maloney
+publisher: 'Craig Maloney'
+website: 'http://themediocreprogrammer.com'
 tags: [developer, programmer, mediocre]
+year: 2019
+---
index 8f7e82c79cf9ca8e443682edd092486b4c2e43a4..1bce45e2534694622bdd45a6b7986a261e9d87db 100644 (file)
--- a/title.txt
+++ b/title.txt
@@ -1,3 +1,3 @@
 % The Mediocre Programmer
 % Written by Craig Maloney
-% \textcopyright 2018 by Craig Maloney. \break Released under the CC-BY-SA International 4.0 license.\break Edited by Sharon Maloney. \break Cover artwork by David Revoy.
+% \textcopyright 2018 by Craig Maloney. \par Released under the CC-BY-SA International 4.0 license.\par Edited by Sharon Maloney. \break Cover artwork by David Revoy.