verkilo 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/verkilo +5 -0
- data/lib/verkilo.rb +30 -0
- data/lib/verkilo/book.rb +123 -0
- data/lib/verkilo/cli.rb +62 -0
- data/lib/verkilo/log.rb +38 -0
- data/lib/verkilo/shelf.rb +32 -0
- data/lib/verkilo/version.rb +3 -0
- data/resources/.keep +0 -0
- data/resources/default.tex +497 -0
- data/resources/epub.html +107 -0
- data/resources/frontmatter.tex +125 -0
- data/resources/hi-dates.tex +10 -0
- data/resources/hi-fancypagebreak.tex +88 -0
- data/resources/hi-fonts.tex +19 -0
- data/resources/hi-title.tex +1 -0
- data/resources/latex.lua +132 -0
- data/resources/metadata.yml +21 -0
- data/resources/packages.tex +10 -0
- data/resources/pdf-old.tex +749 -0
- data/resources/reference.docx +0 -0
- data/resources/style.css +422 -0
- data/resources/template.tex +516 -0
- data/resources/title.tex +59 -0
- data/resources/track-changes.lua +247 -0
- data/resources/user.css +7 -0
- data/resources/yaml.md +5 -0
- data/verkilo.gemspec +42 -0
- metadata +132 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
reservation: >
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
|
+
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
6
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
7
|
+
3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Ben Wilson and his contributors.
|
8
|
+
4. Neither the name of the Copyright Holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
9
|
+
|
10
|
+
disclaimer: >
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
12
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
13
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
14
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
15
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
16
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
17
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
18
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
19
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
20
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
21
|
+
---
|
@@ -0,0 +1,10 @@
|
|
1
|
+
\usepackage{graphicx}
|
2
|
+
\usepackage{fontspec}
|
3
|
+
\usepackage{xunicode}
|
4
|
+
\usepackage{xltxtra}
|
5
|
+
\usepackage{adforn}
|
6
|
+
\usepackage{pifont}
|
7
|
+
\usepackage{fixltx2e} % provides \textsubscript
|
8
|
+
\DisemulatePackage{setspace}
|
9
|
+
\DisemulatePackage{crop}
|
10
|
+
\renewcommand*{\maketitle}{}
|
@@ -0,0 +1,749 @@
|
|
1
|
+
\PassOptionsToPackage{unicode=true$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} % options for packages loaded elsewhere
|
2
|
+
\PassOptionsToPackage{hyphens}{url}
|
3
|
+
$if(colorlinks)$
|
4
|
+
% \PassOptionsToPackage{dvipsnames,svgnames*,x11names*,natural}{xcolor}
|
5
|
+
$endif$$if(dir)$$if(latex-dir-rtl)$
|
6
|
+
\PassOptionsToPackage{RTLdocument}{bidi}
|
7
|
+
$endif$$endif$%
|
8
|
+
|
9
|
+
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
|
10
|
+
% \usepackage[dvipsnames,svgnames*,x11names*]{xcolor}
|
11
|
+
\usepackage[svgnames]{xcolor}
|
12
|
+
\usepackage[explicit]{titlesec}
|
13
|
+
\usepackage{graphicx}
|
14
|
+
% \usepackage{lipsum}
|
15
|
+
\usepackage[all]{nowidow}
|
16
|
+
\usepackage[none]{hyphenat}
|
17
|
+
|
18
|
+
$if(beamer)$
|
19
|
+
$if(background-image)$
|
20
|
+
\usebackgroundtemplate{%
|
21
|
+
\includegraphics[width=\paperwidth]{$background-image$}%
|
22
|
+
}
|
23
|
+
$endif$
|
24
|
+
\usepackage{pgfpages}
|
25
|
+
|
26
|
+
\setbeamertemplate{caption}[numbered]
|
27
|
+
\setbeamertemplate{caption label separator}{: }
|
28
|
+
\setbeamercolor{caption name}{fg=normal text.fg}
|
29
|
+
\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
|
30
|
+
$for(beameroption)$
|
31
|
+
\setbeameroption{$beameroption$}
|
32
|
+
$endfor$
|
33
|
+
|
34
|
+
\raggedbottom
|
35
|
+
$if(section-titles)$
|
36
|
+
\setbeamertemplate{part page}{
|
37
|
+
\centering
|
38
|
+
\begin{beamercolorbox}[sep=16pt,center]{part title}
|
39
|
+
\usebeamerfont{part title}\insertpart\par
|
40
|
+
\end{beamercolorbox}
|
41
|
+
}
|
42
|
+
\setbeamertemplate{section page}{
|
43
|
+
\centering
|
44
|
+
\begin{beamercolorbox}[sep=12pt,center]{part title}
|
45
|
+
\usebeamerfont{section title}\insertsection\par
|
46
|
+
\end{beamercolorbox}
|
47
|
+
}
|
48
|
+
\setbeamertemplate{subsection page}{
|
49
|
+
\centering
|
50
|
+
\begin{beamercolorbox}[sep=8pt,center]{part title}
|
51
|
+
\usebeamerfont{subsection title}\insertsubsection\par
|
52
|
+
\end{beamercolorbox}
|
53
|
+
}
|
54
|
+
\AtBeginPart{
|
55
|
+
\frame{\partpage}
|
56
|
+
}
|
57
|
+
\AtBeginSection{
|
58
|
+
\ifbibliography
|
59
|
+
\else
|
60
|
+
\frame{\sectionpage}
|
61
|
+
\fi
|
62
|
+
}
|
63
|
+
\AtBeginSubsection{
|
64
|
+
\frame{\subsectionpage}
|
65
|
+
}
|
66
|
+
$endif$
|
67
|
+
$endif$
|
68
|
+
$if(beamerarticle)$
|
69
|
+
\usepackage{beamerarticle} % needs to be loaded first
|
70
|
+
$endif$
|
71
|
+
% $if(fontfamily)$
|
72
|
+
% \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
|
73
|
+
% $else$
|
74
|
+
% % \usepackage{lmodern}
|
75
|
+
% \usepackage{fontspec}
|
76
|
+
% \usepackage{xunicode}
|
77
|
+
% \usepackage{xltxtra}
|
78
|
+
% \defaultfontfeatures{Mapping=tex-text}
|
79
|
+
%
|
80
|
+
% % \usepackage{cabin}
|
81
|
+
% % \usepackage{librecaslon}
|
82
|
+
% % \setmainfont{Libre Caslon Text}
|
83
|
+
% % \setsansfont{Droid Sans}
|
84
|
+
% % \setmonofont{Droid Sans Mono}
|
85
|
+
% % % \setsansfont{cabin}
|
86
|
+
% $endif$
|
87
|
+
\usepackage{fontspec}
|
88
|
+
\usepackage{xunicode}
|
89
|
+
\usepackage{xltxtra}
|
90
|
+
|
91
|
+
$if(seriffont)$
|
92
|
+
\setmainfont{$seriffont$}
|
93
|
+
$else$
|
94
|
+
\setmainfont{Libre Baskerville}
|
95
|
+
$endif$
|
96
|
+
$if(sansfont)$
|
97
|
+
\setsansfont{$sansfont$}
|
98
|
+
$else$
|
99
|
+
\setsansfont{Libre Franklin}
|
100
|
+
$endif$
|
101
|
+
$if(monofont)$
|
102
|
+
\setmonofont{$monofont$}
|
103
|
+
$else$
|
104
|
+
\setmonofont{Inconsolata}
|
105
|
+
$endif$
|
106
|
+
\usepackage{sectsty}
|
107
|
+
\allsectionsfont{\sffamily}
|
108
|
+
|
109
|
+
% Dates
|
110
|
+
%-------
|
111
|
+
\usepackage{datetime}
|
112
|
+
\newdateformat{yearonly}{\THEYEAR}
|
113
|
+
\newdateformat{usmonthyear}{\monthname[\THEMONTH], \THEYEAR}
|
114
|
+
\newcommand{\monthyear}{%
|
115
|
+
\ifcase\month\or January\or February\or March\or April\or May\or June\or
|
116
|
+
July\or August\or September\or October\or November\or
|
117
|
+
December\fi\space\number\year
|
118
|
+
}
|
119
|
+
|
120
|
+
\usepackage{amssymb,amsmath}
|
121
|
+
\usepackage{ifxetex,ifluatex}
|
122
|
+
\usepackage{fixltx2e} % provides \textsubscript
|
123
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
124
|
+
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
|
125
|
+
\usepackage[utf8]{inputenc}
|
126
|
+
\usepackage{textcomp} % provides euro and other symbols
|
127
|
+
\else % if luatex or xelatex
|
128
|
+
$if(mathspec)$
|
129
|
+
\ifxetex
|
130
|
+
\usepackage{mathspec}
|
131
|
+
\else
|
132
|
+
\usepackage{unicode-math}
|
133
|
+
\fi
|
134
|
+
$else$
|
135
|
+
\usepackage{unicode-math}
|
136
|
+
$endif$
|
137
|
+
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
|
138
|
+
$if(mathfont)$
|
139
|
+
$if(mathspec)$
|
140
|
+
\ifxetex
|
141
|
+
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
|
142
|
+
\else
|
143
|
+
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
|
144
|
+
\fi
|
145
|
+
$else$
|
146
|
+
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
|
147
|
+
$endif$
|
148
|
+
$endif$
|
149
|
+
$if(CJKmainfont)$
|
150
|
+
\ifxetex
|
151
|
+
\usepackage{xeCJK}
|
152
|
+
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
|
153
|
+
\fi
|
154
|
+
$endif$
|
155
|
+
$if(luatexjapresetoptions)$
|
156
|
+
\ifluatex
|
157
|
+
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
|
158
|
+
\fi
|
159
|
+
$endif$
|
160
|
+
$if(CJKmainfont)$
|
161
|
+
\ifluatex
|
162
|
+
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
|
163
|
+
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
|
164
|
+
\fi
|
165
|
+
$endif$
|
166
|
+
\fi
|
167
|
+
$if(beamer)$
|
168
|
+
$if(theme)$
|
169
|
+
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
|
170
|
+
$endif$
|
171
|
+
$if(colortheme)$
|
172
|
+
\usecolortheme{$colortheme$}
|
173
|
+
$endif$
|
174
|
+
$if(fonttheme)$
|
175
|
+
\usefonttheme{$fonttheme$}
|
176
|
+
$endif$
|
177
|
+
$if(mainfont)$
|
178
|
+
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
|
179
|
+
$endif$
|
180
|
+
$if(innertheme)$
|
181
|
+
\useinnertheme{$innertheme$}
|
182
|
+
$endif$
|
183
|
+
$if(outertheme)$
|
184
|
+
\useoutertheme{$outertheme$}
|
185
|
+
$endif$
|
186
|
+
$endif$
|
187
|
+
% use upquote if available, for straight quotes in verbatim environments
|
188
|
+
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
|
189
|
+
% use microtype if available
|
190
|
+
\IfFileExists{microtype.sty}{%
|
191
|
+
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
|
192
|
+
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
|
193
|
+
}{}
|
194
|
+
$if(indent)$
|
195
|
+
$else$
|
196
|
+
\IfFileExists{parskip.sty}{%
|
197
|
+
\usepackage{parskip}
|
198
|
+
}{% else
|
199
|
+
\setlength{\parindent}{0pt}
|
200
|
+
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
201
|
+
}
|
202
|
+
$endif$
|
203
|
+
$if(verbatim-in-note)$
|
204
|
+
\usepackage{fancyvrb}
|
205
|
+
$endif$
|
206
|
+
$if(colorlinks)$
|
207
|
+
% \usepackage{xcolor}
|
208
|
+
$endif$
|
209
|
+
\usepackage{hyperref}
|
210
|
+
\hypersetup{
|
211
|
+
$if(title-meta)$
|
212
|
+
pdftitle={$title-meta$},
|
213
|
+
$endif$
|
214
|
+
$if(author-meta)$
|
215
|
+
pdfauthor={$author-meta$},
|
216
|
+
$endif$
|
217
|
+
$if(keywords)$
|
218
|
+
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
|
219
|
+
$endif$
|
220
|
+
$if(colorlinks)$
|
221
|
+
colorlinks=true,
|
222
|
+
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
|
223
|
+
filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$,
|
224
|
+
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
|
225
|
+
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
|
226
|
+
$else$
|
227
|
+
pdfborder={0 0 0},
|
228
|
+
$endif$
|
229
|
+
breaklinks=true}
|
230
|
+
\urlstyle{same} % don't use monospace font for urls
|
231
|
+
$if(verbatim-in-note)$
|
232
|
+
\VerbatimFootnotes % allows verbatim text in footnotes
|
233
|
+
$endif$
|
234
|
+
|
235
|
+
$if(bleed)$
|
236
|
+
\newcommand{\AFourSize}{ paperwidth=210mm, paperheight=297mm,margin=2cm,twoside}
|
237
|
+
\newcommand{\Letter}{ paperwidth=8.625in,paperheight=11.25in,margin=1.0in,twoside}
|
238
|
+
\newcommand{\LargeTrade}{paperwidth=8.125in,paperheight=10.25in,outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
239
|
+
\newcommand{\Textbook}{ paperwidth=7.125in,paperheight=10.25in,outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
240
|
+
\newcommand{\Trade}{ paperwidth=6.125in,paperheight=9.25in, outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
241
|
+
\newcommand{\Digest}{ paperwidth=5.625in,paperheight=8.75in, outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
242
|
+
\newcommand{\SmallTrade}{paperwidth=5.375in,paperheight=8.25in, outer=16mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
243
|
+
\newcommand{\Novella}{ paperwidth=5.125in,paperheight=8.25in, outer=16mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
244
|
+
\newcommand{\UKAFormat}{ paperwidth=114mm, paperheight=184mm, outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
245
|
+
\newcommand{\UKBFormat}{ paperwidth=132mm, paperheight=204mm, outer=20mm,bottom=20mm,top=23mm,inner=2cm,twoside}
|
246
|
+
$else$
|
247
|
+
\newcommand{\AFourSize}{ paperwidth=21.00cm,paperheight=29.70cm,margin=20mm,twoside}
|
248
|
+
\newcommand{\Letter}{ paperwidth=21.59cm,paperheight=27.94cm,margin=25mm,twoside} % 8.5x11"
|
249
|
+
\newcommand{\LargeTrade}{paperwidth=20.32cm,paperheight=25.40cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 8x10"
|
250
|
+
\newcommand{\Textbook}{ paperwidth=17.78cm,paperheight=25.40cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 7x10"
|
251
|
+
\newcommand{\Trade}{ paperwidth=15.24cm,paperheight=22.86cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 6x9"
|
252
|
+
\newcommand{\Digest}{ paperwidth=13.97cm,paperheight=21.59cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 5.50x8.5"
|
253
|
+
\newcommand{\SmallTrade}{paperwidth=13.34cm,paperheight=20.32cm,outer=13mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 5.25x8"
|
254
|
+
\newcommand{\Novella}{ paperwidth=12.70cm,paperheight=20.32cm,outer=13mm,bottom=17mm,top=2cm,inner=2cm,twoside} % 5x8"
|
255
|
+
\newcommand{\UKBFormat}{ paperwidth=12.90cm,paperheight=19.80cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside}
|
256
|
+
\newcommand{\UKAFormat}{ paperwidth=11.10cm,paperheight=17.80cm,outer=17mm,bottom=17mm,top=2cm,inner=2cm,twoside}
|
257
|
+
$endif$
|
258
|
+
\newcommand{\AFourSizeLinespace}{ 1.4}
|
259
|
+
\newcommand{\LetterLinespace}{ 1.4} % 11"
|
260
|
+
\newcommand{\LargeTradeLinespace}{1.4} % 10"
|
261
|
+
\newcommand{\TextbookLinespace}{ 1.4} % 10"
|
262
|
+
\newcommand{\TradeLinespace}{ 1.2} % 9"
|
263
|
+
\newcommand{\DigestLinespace}{ 1.1}
|
264
|
+
\newcommand{\SmallTradeLinespace}{1.1}
|
265
|
+
\newcommand{\NovellaLinespace}{ 1.1}
|
266
|
+
\newcommand{\UKBFormatLinespace}{ 1.1}
|
267
|
+
\newcommand{\UKAFormatLinespace}{ 1.1}
|
268
|
+
|
269
|
+
|
270
|
+
% \newcommand{\AFourSize}{ paperwidth=210mm, paperheight=297mm,margin=2cm,twoside}
|
271
|
+
% \newcommand{\Letter}{ paperwidth=8.50in,paperheight=11in, margin=1.0in,twoside}
|
272
|
+
% \newcommand{\LargeTrade}{paperwidth=8.00in,paperheight=10in, left=0.875in,outer=0.825in,top=0.825in,bottom=0.825in,twoside}
|
273
|
+
% \newcommand{\USTextbook}{paperwidth=7.00in,paperheight=10in, left=0.875in,outer=0.825in,top=0.825in,bottom=0.825in,twoside}
|
274
|
+
% \newcommand{\Trade}{ paperwidth=6.00in,paperheight=9in, left=0.875in,right=0.625in,top=0.525in,bottom=0.625in,twoside}
|
275
|
+
% \newcommand{\Digest}{ paperwidth=5.50in,paperheight=8.5in,left=0.875in,right=0.625in,top=0.825in,bottom=0.625in,twoside}
|
276
|
+
% \newcommand{\SmallTrade}{paperwidth=5.25in,paperheight=8in, left=0.875in,right=0.625in,top=0.825in,bottom=0.625in,twoside}
|
277
|
+
% \newcommand{\Novella}{ paperwidth=5.00in,paperheight=8in, left=0.775in,right=0.525in,top=0.825in,bottom=0.625in,twoside}
|
278
|
+
% \newcommand{\MassMarket}{paperwidth=4.25in,paperheight=7in, left=0.775in,right=0.525in,top=0.825in,bottom=0.625in,twoside}
|
279
|
+
% \newcommand{\UKAFormat}{ paperwidth=111mm, paperheight=178mm,left=2cm,right=15mm,top=2cm,bottom=16mm,twoside}
|
280
|
+
% \newcommand{\UKBFormat}{ paperwidth=129mm, paperheight=198mm,left=2cm,right=15mm,top=2cm,bottom=16mm,twoside}
|
281
|
+
$if(trimsize)$
|
282
|
+
\usepackage[\$trimsize$]{geometry}
|
283
|
+
$else$
|
284
|
+
\usepackage[\Trade]{geometry}
|
285
|
+
$endif$
|
286
|
+
$if(crop)$
|
287
|
+
\usepackage[letter,frame,center]{crop}
|
288
|
+
$endif$
|
289
|
+
|
290
|
+
\usepackage{setspace}
|
291
|
+
$if(linestretch)$
|
292
|
+
\setstretch{$linestretch$}
|
293
|
+
$else$
|
294
|
+
\setstretch{\$trimsize$Linespace}
|
295
|
+
$endif$
|
296
|
+
|
297
|
+
|
298
|
+
$if(beamer)$
|
299
|
+
\newif\ifbibliography
|
300
|
+
$endif$
|
301
|
+
$if(listings)$
|
302
|
+
\usepackage{listings}
|
303
|
+
\newcommand{\passthrough}[1]{#1}
|
304
|
+
$endif$
|
305
|
+
$if(lhs)$
|
306
|
+
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
|
307
|
+
$endif$
|
308
|
+
$if(highlighting-macros)$
|
309
|
+
$highlighting-macros$
|
310
|
+
$endif$
|
311
|
+
$if(tables)$
|
312
|
+
\usepackage{longtable,booktabs}
|
313
|
+
$if(beamer)$
|
314
|
+
\usepackage{caption}
|
315
|
+
% These lines are needed to make table captions work with longtable:
|
316
|
+
\makeatletter
|
317
|
+
\def\fnum@table{\tablename~\thetable}
|
318
|
+
\makeatother
|
319
|
+
$else$
|
320
|
+
% Fix footnotes in tables (requires footnote package)
|
321
|
+
\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
|
322
|
+
$endif$
|
323
|
+
$endif$
|
324
|
+
$if(graphics)$
|
325
|
+
\usepackage{graphicx,grffile}
|
326
|
+
\makeatletter
|
327
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
328
|
+
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
329
|
+
\makeatother
|
330
|
+
% Scale images if necessary, so that they will not overflow the page
|
331
|
+
% margins by default, and it is still possible to overwrite the defaults
|
332
|
+
% using explicit options in \includegraphics[width, height, ...]{}
|
333
|
+
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
334
|
+
$endif$
|
335
|
+
$if(links-as-notes)$
|
336
|
+
% Make links footnotes instead of hotlinks:
|
337
|
+
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
|
338
|
+
$endif$
|
339
|
+
$if(strikeout)$
|
340
|
+
\usepackage[normalem]{ulem}
|
341
|
+
% avoid problems with \sout in headers with hyperref:
|
342
|
+
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
|
343
|
+
$endif$
|
344
|
+
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
345
|
+
\providecommand{\tightlist}{%
|
346
|
+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
347
|
+
$if(numbersections)$
|
348
|
+
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
|
349
|
+
$else$
|
350
|
+
\setcounter{secnumdepth}{0}
|
351
|
+
$endif$
|
352
|
+
$if(beamer)$
|
353
|
+
$else$
|
354
|
+
$if(subparagraph)$
|
355
|
+
$else$
|
356
|
+
% Redefines (sub)paragraphs to behave more like sections
|
357
|
+
\ifx\paragraph\undefined\else
|
358
|
+
\let\oldparagraph\paragraph
|
359
|
+
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
|
360
|
+
\fi
|
361
|
+
\ifx\subparagraph\undefined\else
|
362
|
+
\let\oldsubparagraph\subparagraph
|
363
|
+
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
|
364
|
+
\fi
|
365
|
+
$endif$
|
366
|
+
$endif$
|
367
|
+
$if(pagestyle)$
|
368
|
+
\pagestyle{$pagestyle$}
|
369
|
+
$endif$
|
370
|
+
|
371
|
+
% set default figure placement to htbp
|
372
|
+
\makeatletter
|
373
|
+
\def\fps@figure{htbp}
|
374
|
+
\makeatother
|
375
|
+
|
376
|
+
% HEADER DESIGN
|
377
|
+
\usepackage{fancyhdr} % headers
|
378
|
+
\pagestyle{fancy} % style for headers
|
379
|
+
\usepackage{pifont} % for the copyright symbol
|
380
|
+
\usepackage{adforn} % for fancy symbols
|
381
|
+
|
382
|
+
\headheight 0.25in % height of header
|
383
|
+
\headsep 0.25in % dist between top of text and bottom of header
|
384
|
+
\parskip 0in
|
385
|
+
\parindent 0.25in % = 6.35mm
|
386
|
+
\newcommand{\str}{\rule{0pt}{16pt}} % strut used in toc
|
387
|
+
%%% header stuff
|
388
|
+
\newcommand{\currpage}{\footnotesize\thepage} % use in headers
|
389
|
+
\fancyhead{} % clear header fields, required
|
390
|
+
\fancyfoot{} % clear footer fields, required
|
391
|
+
% \fancyfoot[C]{\currpage}
|
392
|
+
\fancyhead[LE,RO]{\currpage}
|
393
|
+
|
394
|
+
\fancyhead[CO]{ \footnotesize\MakeUppercase{$title$} } % Odd Page, Right side
|
395
|
+
\fancyhead[CE]{ \footnotesize\MakeUppercase{$author$} } % Even Page, Right side
|
396
|
+
\renewcommand\headrulewidth{0pt} % for no rule line under header
|
397
|
+
|
398
|
+
\titleformat{\chapter}[display]
|
399
|
+
{\normalfont\sffamily\huge\bfseries\color{$if(chapter-color)$$chapter-color$$else$Black$endif$}}
|
400
|
+
{\chaptertitlename\ \thechapter}{20pt}{\Huge}
|
401
|
+
% \titleformat{\chapter}[display]
|
402
|
+
% {\bfseries\Large}
|
403
|
+
% {\filright\MakeUppercase{\chaptertitlename} \Huge\thechapter}
|
404
|
+
% {1ex}
|
405
|
+
% {\titlerule\vspace{1ex}\filleft}
|
406
|
+
% [\vspace{1ex}\titlerule]
|
407
|
+
|
408
|
+
$if(lang)$
|
409
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
410
|
+
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
|
411
|
+
$if(babel-newcommands)$
|
412
|
+
$babel-newcommands$
|
413
|
+
$endif$
|
414
|
+
\else
|
415
|
+
% load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
|
416
|
+
\usepackage{polyglossia}
|
417
|
+
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
|
418
|
+
$for(polyglossia-otherlangs)$
|
419
|
+
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
|
420
|
+
$endfor$
|
421
|
+
\fi
|
422
|
+
$endif$
|
423
|
+
$if(dir)$
|
424
|
+
\ifxetex
|
425
|
+
% load bidi as late as possible as it modifies e.g. graphicx
|
426
|
+
\usepackage{bidi}
|
427
|
+
\fi
|
428
|
+
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
429
|
+
\TeXXeTstate=1
|
430
|
+
\newcommand{\RL}[1]{\beginR #1\endR}
|
431
|
+
\newcommand{\LR}[1]{\beginL #1\endL}
|
432
|
+
\newenvironment{RTL}{\beginR}{\endR}
|
433
|
+
\newenvironment{LTR}{\beginL}{\endL}
|
434
|
+
\fi
|
435
|
+
$endif$
|
436
|
+
$if(natbib)$
|
437
|
+
\usepackage[$natbiboptions$]{natbib}
|
438
|
+
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
|
439
|
+
$endif$
|
440
|
+
$if(biblatex)$
|
441
|
+
\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
|
442
|
+
$for(bibliography)$
|
443
|
+
\addbibresource{$bibliography$}
|
444
|
+
$endfor$
|
445
|
+
$endif$
|
446
|
+
% ===============================================
|
447
|
+
% Bringing PlainFancyBreak from Memoir class.
|
448
|
+
\makeatletter
|
449
|
+
\newcommand{\plainfancybreak}{\@ifstar{\@spfbreak}{\@pfbreak}}
|
450
|
+
\newcommand{\@pfbreak}[3]{\par
|
451
|
+
\@tempdimc\pagegoal \advance\@tempdimc-\pagetotal
|
452
|
+
\ifdim #1>\@tempdimc \@fbreak{#3}\else \@pbreak{#2}\fi}
|
453
|
+
\newcommand{\@spfbreak}[3]{\par
|
454
|
+
\@tempdimc\pagegoal \advance\@tempdimc-\pagetotal
|
455
|
+
\ifdim #1>\@tempdimc \@sfbreak{#3}\else \@spbreak{#2}\fi}
|
456
|
+
|
457
|
+
\newcommand*{\pen@ltyabovepfbreak}{2}
|
458
|
+
\newcommand*{\pen@ltybelowpfbreak}{-4}
|
459
|
+
|
460
|
+
\newlength{\pfbreakskip}
|
461
|
+
\setlength{\pfbreakskip}{2\baselineskip}
|
462
|
+
$if(fancybreak)$
|
463
|
+
\newcommand{\pfbreakdisplay}{$fancybreak$}
|
464
|
+
$else$
|
465
|
+
\newcommand{\pfbreakdisplay}{* \quad * \quad*}
|
466
|
+
$endif$
|
467
|
+
|
468
|
+
\def\pfbre@kdispl@y{\vbox to 1\pfbreakskip{\vss
|
469
|
+
\hb@xt@ \columnwidth{\hss \pfbreakdisplay \hss}%
|
470
|
+
\vss}}
|
471
|
+
|
472
|
+
\edef\nopfbreakOutput{\the\output}
|
473
|
+
\def\pfbreakOutput{%
|
474
|
+
\ifnum\outputpenalty=\pen@ltyabovepfbreak
|
475
|
+
\nopfbreakOutput
|
476
|
+
\pfbre@kdispl@y
|
477
|
+
\nobreak
|
478
|
+
\vskip-\pfbreakskip
|
479
|
+
\else\ifnum\outputpenalty=\pen@ltybelowpfbreak
|
480
|
+
\unvbox 255\relax
|
481
|
+
\nobreak
|
482
|
+
\vskip-\pfbreakskip
|
483
|
+
\pfbre@kdispl@y
|
484
|
+
\break
|
485
|
+
\else
|
486
|
+
\nopfbreakOutput
|
487
|
+
\fi
|
488
|
+
\fi}
|
489
|
+
\output={\pfbreakOutput}
|
490
|
+
|
491
|
+
\newcommand{\pfbreak}{\@ifstar{\@spfbreakgap}{\@pfbreakgap}}
|
492
|
+
\newcommand{\@pfbreakgap}{%
|
493
|
+
\par {%
|
494
|
+
\skip@\lastskip
|
495
|
+
\nobreak
|
496
|
+
\vskip -\ifdim\prevdepth>\maxdepth \maxdepth
|
497
|
+
\else\ifdim\prevdepth>-1000pt\prevdepth
|
498
|
+
\else\ifinner 0pt
|
499
|
+
\else \pagedepth
|
500
|
+
\fi \fi \fi
|
501
|
+
\vskip -\skip@
|
502
|
+
\ifdim\skip@<\pfbreakskip
|
503
|
+
\advance\skip@ -1\skip@ \advance\skip@ 1\pfbreakskip
|
504
|
+
\fi
|
505
|
+
\penalty\pen@ltyabovepfbreak
|
506
|
+
\vskip\skip@
|
507
|
+
\penalty\pen@ltybelowpfbreak
|
508
|
+
}
|
509
|
+
\@afterindentfalse
|
510
|
+
\@afterheading
|
511
|
+
}
|
512
|
+
\newcommand{\@spfbreakgap}{%
|
513
|
+
\par {%
|
514
|
+
\skip@\lastskip
|
515
|
+
\nobreak
|
516
|
+
\vskip -\ifdim\prevdepth>\maxdepth \maxdepth
|
517
|
+
\else\ifdim\prevdepth>-1000pt\prevdepth
|
518
|
+
\else\ifinner 0pt
|
519
|
+
\else \pagedepth
|
520
|
+
\fi \fi \fi
|
521
|
+
\vskip -\skip@
|
522
|
+
\ifdim\skip@<\pfbreakskip
|
523
|
+
\advance\skip@ -1\skip@ \advance\skip@ 1\pfbreakskip
|
524
|
+
\fi
|
525
|
+
\penalty\pen@ltyabovepfbreak
|
526
|
+
\vskip\skip@
|
527
|
+
\penalty\pen@ltybelowpfbreak
|
528
|
+
}
|
529
|
+
\@afterindenttrue
|
530
|
+
\@afterheading
|
531
|
+
}
|
532
|
+
\makeatother
|
533
|
+
% /PlainFancyBreak
|
534
|
+
|
535
|
+
$for(header-includes)$
|
536
|
+
$header-includes$
|
537
|
+
$endfor$
|
538
|
+
\begin{document}
|
539
|
+
\sloppy % ignore problems with line overflow / underflow
|
540
|
+
\setcounter{page}{1}
|
541
|
+
% ===============================================
|
542
|
+
% Old Beamer frontmatter
|
543
|
+
% $if(title)$
|
544
|
+
% $if(beamer)$
|
545
|
+
% \frame{\titlepage}
|
546
|
+
% $else$
|
547
|
+
% % \maketitle
|
548
|
+
% $endif$
|
549
|
+
% $if(abstract)$
|
550
|
+
% \begin{abstract}
|
551
|
+
% $abstract$
|
552
|
+
% \end{abstract}
|
553
|
+
% $endif$
|
554
|
+
% $endif$
|
555
|
+
|
556
|
+
% ===============================================
|
557
|
+
% Frontmatter
|
558
|
+
\pagenumbering{roman}
|
559
|
+
\pagestyle{empty}
|
560
|
+
% ------------------------------------------------
|
561
|
+
% r.1 - Half-Title - Recto
|
562
|
+
\begin{center}
|
563
|
+
\vspace*{\fill}
|
564
|
+
|
565
|
+
\LARGE\textbf{\textsf{$title$}}
|
566
|
+
|
567
|
+
\vspace*{\fill}
|
568
|
+
\vspace*{\fill}
|
569
|
+
\end{center}
|
570
|
+
\clearpage
|
571
|
+
|
572
|
+
% ------------------------------------------------
|
573
|
+
% r.2 - Series Title Page - Verso
|
574
|
+
\newpage
|
575
|
+
\emph{ }\newline
|
576
|
+
$if(other-titles)$
|
577
|
+
\begin{center}
|
578
|
+
\textbf{Also by $author$}
|
579
|
+
|
580
|
+
$for(other-titles)$
|
581
|
+
$other-titles$\newline
|
582
|
+
$endfor$
|
583
|
+
\end{center}
|
584
|
+
$endif$
|
585
|
+
\clearpage
|
586
|
+
|
587
|
+
% ------------------------------------------------
|
588
|
+
% r.3 Titlepage - Recto
|
589
|
+
\begin{center}
|
590
|
+
\vspace*{\fill}
|
591
|
+
|
592
|
+
\Huge\textbf{\textsf{$title$}}
|
593
|
+
$if(subtitle)$
|
594
|
+
|
595
|
+
\vspace*{0.125in}
|
596
|
+
\Large\textbf{\textsf{$subtitle$}}
|
597
|
+
$endif$
|
598
|
+
|
599
|
+
\vspace*{0.25in}
|
600
|
+
\line(1,0){150}
|
601
|
+
\vspace*{0.25in}
|
602
|
+
|
603
|
+
\Large\textsf{$author$}
|
604
|
+
|
605
|
+
\vspace*{\fill}
|
606
|
+
\vspace*{\fill}
|
607
|
+
$if(imprint)$
|
608
|
+
\includegraphics[width=1in]{$imprint$}\\[0cm]
|
609
|
+
\vspace*{0.25in}
|
610
|
+
$endif$
|
611
|
+
\end{center}
|
612
|
+
\clearpage
|
613
|
+
|
614
|
+
% ------------------------------------------------
|
615
|
+
% r.4 Copyright Page
|
616
|
+
\vspace*{\fill}
|
617
|
+
|
618
|
+
\par\noindent\emph{$title$}\newline
|
619
|
+
\par\noindent\emph{$rights$}\newline
|
620
|
+
|
621
|
+
\footnotesize
|
622
|
+
$if(reservation)$\par\noindent $reservation$\newline$endif$
|
623
|
+
|
624
|
+
$for(isbn)$
|
625
|
+
\par\noindent ISBN $isbn$
|
626
|
+
$endfor$\newline
|
627
|
+
|
628
|
+
\footnotesize
|
629
|
+
$if(disclaimer)$\par\noindent $disclaimer$\newline$endif$
|
630
|
+
|
631
|
+
% Producer Acknowledgements
|
632
|
+
\par\noindent Interior Design: Merovex Press % Per license terms for use of template.
|
633
|
+
$for(credits)$
|
634
|
+
\par\noindent $credits$
|
635
|
+
$endfor$\newline
|
636
|
+
|
637
|
+
\par\noindent $for(author)$
|
638
|
+
\par\noindent $author$
|
639
|
+
$endfor$\newline
|
640
|
+
|
641
|
+
$if(website)$
|
642
|
+
\par\noindent Visit us at \url{$website$}\newline
|
643
|
+
$endif$
|
644
|
+
|
645
|
+
\par\noindent $country$
|
646
|
+
\newline
|
647
|
+
|
648
|
+
$if(printing)$
|
649
|
+
\par\noindent\textit{$printing$}
|
650
|
+
\newline
|
651
|
+
$endif$
|
652
|
+
|
653
|
+
$if(version)$
|
654
|
+
\par\noindent Version: $version$
|
655
|
+
$endif$
|
656
|
+
\vspace*{\fill}
|
657
|
+
\clearpage\normalsize
|
658
|
+
|
659
|
+
% -----------------------------------------------
|
660
|
+
% r.5 - Dedication
|
661
|
+
$if(thanks)$
|
662
|
+
$thanks$
|
663
|
+
\newpage
|
664
|
+
$endif$
|
665
|
+
|
666
|
+
% -----------------------------------------------
|
667
|
+
% Table of Contents
|
668
|
+
$if(toc)$
|
669
|
+
$if(toc-title)$
|
670
|
+
\renewcommand*\contentsname{$toc-title$}
|
671
|
+
$endif$
|
672
|
+
$if(beamer)$
|
673
|
+
\begin{frame}
|
674
|
+
$if(toc-title)$
|
675
|
+
\frametitle{$toc-title$}
|
676
|
+
$endif$
|
677
|
+
\tableofcontents[hideallsubsections]
|
678
|
+
\end{frame}
|
679
|
+
$else$
|
680
|
+
{
|
681
|
+
$if(colorlinks)$
|
682
|
+
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
|
683
|
+
$endif$
|
684
|
+
\makeatletter
|
685
|
+
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{3.0em}}
|
686
|
+
\makeatother
|
687
|
+
\setcounter{tocdepth}{$toc-depth$}
|
688
|
+
\tableofcontents
|
689
|
+
}
|
690
|
+
$endif$
|
691
|
+
$endif$
|
692
|
+
|
693
|
+
% -----------------------------------------------
|
694
|
+
% List of Tables
|
695
|
+
$if(lot)$
|
696
|
+
\listoftables
|
697
|
+
$endif$
|
698
|
+
|
699
|
+
% -----------------------------------------------
|
700
|
+
% List of Figures
|
701
|
+
$if(lof)$
|
702
|
+
\listoffigures
|
703
|
+
$endif$
|
704
|
+
|
705
|
+
\newpage % End Frontmatter
|
706
|
+
|
707
|
+
% ===============================================
|
708
|
+
% Mainmatter
|
709
|
+
\pagenumbering{arabic}\pagestyle{fancy}
|
710
|
+
$body$
|
711
|
+
|
712
|
+
% ===============================================
|
713
|
+
% Backmatter
|
714
|
+
$if(natbib)$
|
715
|
+
$if(bibliography)$
|
716
|
+
$if(biblio-title)$
|
717
|
+
$if(book-class)$
|
718
|
+
\renewcommand\bibname{$biblio-title$}
|
719
|
+
$else$
|
720
|
+
\renewcommand\refname{$biblio-title$}
|
721
|
+
$endif$
|
722
|
+
$endif$
|
723
|
+
$if(beamer)$
|
724
|
+
\begin{frame}[allowframebreaks]{$biblio-title$}
|
725
|
+
\bibliographytrue
|
726
|
+
$endif$
|
727
|
+
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
|
728
|
+
$if(beamer)$
|
729
|
+
\end{frame}
|
730
|
+
$endif$
|
731
|
+
$endif$
|
732
|
+
$endif$
|
733
|
+
|
734
|
+
$if(biblatex)$
|
735
|
+
$if(beamer)$
|
736
|
+
\begin{frame}[allowframebreaks]{$biblio-title$}
|
737
|
+
\bibliographytrue
|
738
|
+
\printbibliography[heading=none]
|
739
|
+
\end{frame}
|
740
|
+
$else$
|
741
|
+
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
|
742
|
+
$endif$
|
743
|
+
$endif$
|
744
|
+
|
745
|
+
$for(include-after)$
|
746
|
+
$include-after$
|
747
|
+
|
748
|
+
$endfor$
|
749
|
+
\end{document}
|