-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.tex
136 lines (111 loc) · 3.02 KB
/
template.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
\documentclass[11pt,ebook]{memoir}
%\usepackage[paperwidth=6in, paperheight=9in]{geometry}
\usepackage{graphicx}
\usepackage{ellipsis}
\usepackage{microtype}
\DeclareGraphicsExtensions{.jpg,.png}
\nonzeroparskip
\setlength{\parindent}{0pt}
\newcommand*\cleartoleftpage{%
\clearpage
\ifodd\value{page}\hbox{}\newpage\fi
}
\copypagestyle{entry}{plain}
\renewcommand{\thechapter}{}
\renewcommand{\chaptername}{}
\pagestyle{plain}
\begin{document}
\frontmatter
% Half title
\thispagestyle{empty}
\vspace*{1in}
\begin{center}
\HUGE{\textsf{Make Way For Piggies}}
\end{center}
% Full title
\cleardoublepage
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
\HUGE{\textsf{Make Way For Piggies}}\par
\vspace{0.15in}
\includegraphics[width=1in]{static_files/wiggins-150x71.png}\par
\vspace{0.15in}
\LARGE{The Pregnancy of Huxley Craig}\par
\vspace{0.1in}
\large{as recorded in the}\par
\large{Facebook Posts of his Mom}\par
\LARGE{Sally Honda}\par
\vspace{1in}
\large{Edited by his Dad}\par
\LARGE{Dan Craig}\par
\vspace{0.2in}
\large{http://makewayforpiggies.huxleycraig.com}
\end{center}
\clearpage
% Copyright page
\begingroup
\vspace*{\fill}
\footnotesize
\setlength{\parindent}{0pt}
\setlength{\parskip}{\baselineskip}
\textcopyright{} Copyright 2012 Sally Honda and Dan Craig\\*
Version %{{ version %}}\\*
For full version history go to\\*
https://github.com/drcraig/make-way-for-piggies
This work is licensed under the\\*
Creative Commons Attribution--NonCommercial--ShareAlike 3.0 Unported License.
To view a copy of this license, visit \\*
http://creativecommons.org/licenses/by-nc-sa/3.0/\\*
or send a letter to \\*
Creative Commons\\*
444 Castro Street, Suite 900\\*
Mountain View, California, 94041, USA.
\vspace*{\fill}
\endgroup
\clearpage
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\chapter{Preface}
%{{ preface|escape_tex -%}}
\mainmatter
%{- for section in sections -%}
\thispagestyle{cleared}
\chapter{%{{ section.title %}}}
\LARGE{%{{ section.text|escape_tex %}}}
\cleardoublepage
%{- for post in section.posts -%}
%{- if post.image %}
\cleartoleftpage
\vspace*{\fill}
\vspace*{-0.65in}
\includegraphics[width=\textwidth]{static_files/%{{ post.image %}}}
\vspace*{\fill}
\clearpage
%{- endif %}
\thispagestyle{entry}
\makeevenhead{entry}{%{{ post.humantimestamp %}}}{}{}
\makeoddhead{entry}{}{}{%{{ post.humantimestamp %}}}
\topskip0pt
%{- if not post.text|length > 550 %}
\vspace*{\fill}
\vspace*{-1.5 in}
%{- endif %}
\LARGE{%{{ post.text|escape_tex|newline|hyphenate_hashtags %}}}
\vspace*{\fill}
\newpage
%{- endfor %}
%{- endfor %}
\backmatter
\chapter{Colophon}
\normalsize
The Facebook posts in this book were compiled using a custom
JavaScript written with the assistance of Chris Guidry.
Pictures and their captions were downloaded manually. The
posts were collected into a JSON file and transformed into
\LaTeX\ and HTML with Python and Jinja. The \LaTeX\ rendition
uses the Memoir class.
The source code and data for this book can be found on GitHub
at http://github.com/drcraig/make-way-for-piggies.
\end{document}