summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2020-03-10 11:35:38 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2020-03-10 11:35:38 +0100
commitee634eae16f472c3ab1a69da0b8804d48dd9a793 (patch)
treefe8ca3528d7db62cc2bd54d874120638bb1ecc8a /templates
parentbdfd9da091438dec0a7765571aa981d5997b75d9 (diff)
Template basics
Diffstat (limited to 'templates')
-rw-r--r--templates/book.latex524
-rw-r--r--templates/ebook/book.epub66
-rw-r--r--templates/ebook/epub.css26
3 files changed, 616 insertions, 0 deletions
diff --git a/templates/book.latex b/templates/book.latex
new file mode 100644
index 0000000..6631942
--- /dev/null
+++ b/templates/book.latex
@@ -0,0 +1,524 @@
+% Copyright 2019 Ekaitz Zarraga <ekaitz@elenq.tech>
+%
+% Licensed under the Apache License, Version 2.0 (the "License");
+% you may not use this file except in compliance with the License.
+% You may obtain a copy of the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+% See the License for the specific language governing permissions and
+% limitations under the License.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% ElenQ book template
+% -----------------------------------------------------------------------------
+%
+% Expects some metadata to be set:
+%
+% title: The title of the document
+% subtitle: The subtitle of the article
+% author: Author's name
+% license: License of the document
+% lang: es-ES
+% polyglossia:
+% name: spanish
+%
+% It also accepts some optional metadata:
+%
+% toc: true | false # Activate table of contents (defaults to true)
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass[
+ b5paper,
+ 12pt,
+ $if(lang)$
+ $babel-lang$,
+ $endif$
+]{$documentclass$}
+
+\usepackage{tikz}
+\newcommand{\logo}[1]{
+ \begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-{#1}, xscale={#1}, inner sep=0pt, outer sep=0pt]
+ \begin{scope}[shift={(3.54331,-984.39026)}]
+ \begin{scope}[shift={(-161.98599,807.24042)}]
+ \begin{scope}[shift={(-13.57143,-11.78571)},fill=black,line join=miter,line cap=butt,line width=0.800pt]
+ \path[fill] (175.5574,234.4789) -- (203.0824,234.4789) -- (203.0824,231.7789) --
+ (178.7824,231.7789) -- (178.7824,214.5289) -- (199.3324,214.5289) --
+ (199.3324,211.8289) -- (178.7824,211.8289) -- (178.7824,195.9289) --
+ (203.0824,195.9289) -- (203.0824,193.2289) -- (175.5574,193.2289) --
+ (175.5574,234.4789) -- cycle;
+ \path[fill] (208.2234,234.4789) -- (211.4484,234.4789) -- (211.4484,193.2289) --
+ (208.2234,193.2289) -- (208.2234,234.4789) -- cycle;
+ \path[fill] (216.6375,219.7039) .. controls (216.6375,230.9539) and
+ (225.3375,235.3039) .. (233.1375,235.3039) .. controls (244.9875,235.3039) and
+ (248.4375,230.5789) .. (249.1875,226.0789) -- (245.5875,226.0789) .. controls
+ (244.8375,227.9539) and (243.4125,232.0789) .. (233.1375,232.0789) .. controls
+ (227.2125,232.0789) and (220.6875,228.4789) .. (220.1625,221.0539) --
+ (249.1875,221.0539) -- (249.1875,217.8289) .. controls (248.4375,207.4039) and
+ (242.7375,202.0789) .. (233.1375,202.0789) .. controls (223.5375,202.0789) and
+ (216.6375,209.2789) .. (216.6375,219.7039) -- cycle(220.3125,217.8289) ..
+ controls (221.3625,209.9539) and (225.4875,205.2289) .. (233.4375,205.2289) ..
+ controls (241.3875,205.2289) and (244.8375,210.3289) .. (245.5875,217.8289) --
+ (220.3125,217.8289) -- cycle;
+ \path[fill] (254.5875,234.4789) -- (257.8125,234.4789) -- (257.8125,208.6039) ..
+ controls (259.3875,206.5789) and (262.8375,205.3789) .. (268.0125,205.3789) ..
+ controls (271.6125,205.3789) and (276.1125,206.7289) .. (276.1125,213.0289) --
+ (276.1125,234.4789) -- (279.5625,234.4789) -- (279.5625,213.0289) .. controls
+ (279.5625,204.7789) and (273.4125,202.0789) .. (268.0125,202.0789) .. controls
+ (262.4625,202.0789) and (258.9375,203.4289) .. (257.8125,206.1289) --
+ (257.8125,202.9039) -- (254.5875,202.9039) -- (254.5875,234.4789) -- cycle;
+ \path[fill] (284.5312,213.8539) .. controls (284.5312,225.0289) and
+ (293.8313,235.3039) .. (305.1562,235.3039) .. controls (309.9563,235.3039) and
+ (314.3062,233.4289) .. (317.8313,230.5039) -- (322.6313,234.4789) --
+ (326.3813,234.4789) -- (319.7812,228.7039) .. controls (323.4563,224.7289) and
+ (325.7812,219.4039) .. (325.7812,213.8539) .. controls (325.7812,202.7539) and
+ (316.5562,192.4789) .. (305.1562,192.4789) .. controls (293.7563,192.4789) and
+ (284.5312,202.6789) .. (284.5312,213.8539) -- cycle(287.8313,213.8539) ..
+ controls (287.8313,204.7039) and (295.4062,195.5539) .. (305.1562,195.5539) ..
+ controls (314.9062,195.5539) and (322.4812,204.7039) .. (322.4812,213.8539) ..
+ controls (322.4812,223.0039) and (314.9062,232.2289) .. (305.1562,232.2289) ..
+ controls (295.4062,232.2289) and (287.8313,223.0039) .. (287.8313,213.8539) --
+ cycle;
+ \end{scope}
+ \begin{scope}[fill=black,line join=miter,line cap=butt,line width=0.800pt]
+ \path[fill] (176.4077,232.6768) -- (180.4452,232.6768) -- (180.4452,244.8605) --
+ (181.4665,244.8605) -- (181.4665,232.6768) -- (185.5277,232.6768) --
+ (185.5277,231.7980) -- (176.4077,231.7980) -- (176.4077,232.6768) -- cycle;
+ \path[fill] (187.0132,244.8605) -- (195.7295,244.8605) -- (195.7295,244.0055) --
+ (188.0345,244.0055) -- (188.0345,238.5430) -- (194.5420,238.5430) --
+ (194.5420,237.6880) -- (188.0345,237.6880) -- (188.0345,232.6530) --
+ (195.7295,232.6530) -- (195.7295,231.7980) -- (187.0132,231.7980) --
+ (187.0132,244.8605) -- cycle;
+ \path[fill] (197.2387,238.3293) .. controls (197.2387,242.6043) and
+ (199.2099,245.1218) .. (202.8674,245.1218) .. controls (205.6699,245.1218) and
+ (208.0212,243.6255) .. (208.0212,241.4880) -- (206.8812,241.4880) .. controls
+ (206.8812,242.7943) and (205.3137,244.1005) .. (202.8674,244.1005) .. controls
+ (199.7087,244.1005) and (198.3549,241.0368) .. (198.3549,238.3293) .. controls
+ (198.3549,235.2180) and (200.1837,232.5580) .. (202.9624,232.5580) .. controls
+ (205.3849,232.5580) and (206.8812,233.8168) .. (206.8812,235.2418) --
+ (208.0212,235.2418) .. controls (208.0212,232.8905) and (205.6699,231.5605) ..
+ (202.8674,231.5605) .. controls (198.9724,231.5605) and (197.2387,235.0280) ..
+ (197.2387,238.3293) -- cycle;
+ \path[fill] (209.6499,244.8605) -- (210.6712,244.8605) -- (210.6712,238.5430) --
+ (217.1787,238.5430) -- (217.1787,244.8605) -- (218.1999,244.8605) --
+ (218.1999,231.7980) -- (217.1787,231.7980) -- (217.1787,237.6880) --
+ (210.6712,237.6880) -- (210.6712,231.7980) -- (209.6499,231.7980) --
+ (209.6499,244.8605) -- cycle;
+ \path[fill] (219.9942,244.8605) -- (221.0392,244.8605) -- (221.0392,233.7455) --
+ (228.2354,244.8605) -- (229.2567,244.8605) -- (229.2567,231.7980) --
+ (228.2354,231.7980) -- (228.2354,243.0318) -- (221.0392,231.7980) --
+ (219.9942,231.7980) -- (219.9942,244.8605) -- cycle;
+ \path[fill] (230.8917,238.3293) .. controls (230.8917,241.8680) and
+ (233.8367,245.1218) .. (237.4229,245.1218) .. controls (241.0092,245.1218) and
+ (243.9542,241.8680) .. (243.9542,238.3293) .. controls (243.9542,234.8143) and
+ (241.0329,231.5605) .. (237.4229,231.5605) .. controls (233.8129,231.5605) and
+ (230.8917,234.7905) .. (230.8917,238.3293) -- cycle(231.9367,238.3293) ..
+ controls (231.9367,235.4318) and (234.3354,232.5343) .. (237.4229,232.5343) ..
+ controls (240.5104,232.5343) and (242.9092,235.4318) .. (242.9092,238.3293) ..
+ controls (242.9092,241.2268) and (240.5104,244.1480) .. (237.4229,244.1480) ..
+ controls (234.3354,244.1480) and (231.9367,241.2268) .. (231.9367,238.3293) --
+ cycle;
+ \path[fill] (245.5521,244.8605) -- (253.4609,244.8605) -- (253.4609,243.8393) --
+ (246.5734,243.8393) -- (246.5734,231.7980) -- (245.5521,231.7980) --
+ (245.5521,244.8605) -- cycle;
+ \path[fill] (254.9200,238.3293) .. controls (254.9200,241.8680) and
+ (257.8650,245.1218) .. (261.4513,245.1218) .. controls (265.0375,245.1218) and
+ (267.9825,241.8680) .. (267.9825,238.3293) .. controls (267.9825,234.8143) and
+ (265.0613,231.5605) .. (261.4513,231.5605) .. controls (257.8413,231.5605) and
+ (254.9200,234.7905) .. (254.9200,238.3293) -- cycle(255.9650,238.3293) ..
+ controls (255.9650,235.4318) and (258.3638,232.5343) .. (261.4513,232.5343) ..
+ controls (264.5388,232.5343) and (266.9375,235.4318) .. (266.9375,238.3293) ..
+ controls (266.9375,241.2268) and (264.5388,244.1480) .. (261.4513,244.1480) ..
+ controls (258.3638,244.1480) and (255.9650,241.2268) .. (255.9650,238.3293) --
+ cycle;
+ \path[fill] (269.5092,238.3293) .. controls (269.5092,242.6043) and
+ (271.4805,245.1218) .. (275.1380,245.1218) .. controls (276.7767,245.1218) and
+ (278.2255,244.5993) .. (279.1517,243.7443) -- (279.1517,244.8605) --
+ (280.1730,244.8605) -- (280.1730,238.4480) -- (274.9480,238.4480) --
+ (274.9480,239.4693) -- (279.1517,239.4693) -- (279.1517,241.4880) .. controls
+ (279.1517,242.7943) and (277.5842,244.1005) .. (275.1380,244.1005) .. controls
+ (271.9792,244.1005) and (270.6255,241.0368) .. (270.6255,238.3293) .. controls
+ (270.6255,235.2180) and (272.4542,232.5580) .. (275.2330,232.5580) .. controls
+ (277.6555,232.5580) and (279.1517,233.8168) .. (279.1517,235.2418) --
+ (280.1730,235.2418) .. controls (280.1730,232.8905) and (277.9405,231.5605) ..
+ (275.1380,231.5605) .. controls (271.2430,231.5605) and (269.5092,235.0280) ..
+ (269.5092,238.3293) -- cycle;
+ \path[fill] (281.6818,231.7980) -- (286.4318,239.4218) -- (286.4318,244.8605) --
+ (287.4531,244.8605) -- (287.4531,239.4218) -- (292.2268,231.7980) --
+ (291.0868,231.7980) -- (286.9543,238.4480) -- (282.8456,231.7980) --
+ (281.6818,231.7980) -- cycle;
+ \end{scope}
+ \end{scope}
+ \end{scope}
+ \end{tikzpicture}}
+
+
+% Language control from Metadata
+$if(lang)$
+% Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
+ \usepackage{polyglossia}
+ \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
+$for(polyglossia-otherlangs)$
+ \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
+$endfor$
+$endif$
+
+% No indent
+\usepackage{parskip}
+
+% Margins
+\usepackage[top=1.2cm,
+ bottom=1.2cm,
+ left=1.75cm,
+ right=2.1cm,
+ footskip=1.3cm,
+ includeheadfoot=true]{geometry}
+
+
+% Spacing
+\usepackage{setspace}
+
+% Font
+\usepackage{moresize}
+\usepackage{anyfontsize} % para seleccionar tamaño de fuente
+\usepackage{fontspec}
+\setmainfont[
+ BoldFont = Lato-Bold.ttf,
+ ItalicFont = Lato-Italic.ttf,
+ BoldItalicFont = Lato-BoldItalic.ttf
+]{Lato-Regular.ttf}
+\newcommand{\euro}{€}
+
+% Font footnote size
+\makeatletter
+\renewcommand\footnotesize{%
+ \@setfontsize\footnotesize\@ixpt{10}%
+ \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ \belowdisplayskip \abovedisplayskip
+}
+\makeatother
+
+
+
+% Pretty hyperlinks
+\usepackage{hyperref}
+$if(colorlinks)$
+\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
+$endif$
+\hypersetup{unicode=true,
+ $if(title-meta)$
+ pdftitle={$title-meta$},
+ $endif$
+ $if(lang)$
+ pdflang={$lang$},
+ $endif$
+ $if(author-meta)$
+ pdfauthor={$author-meta$},
+ $endif$
+ $if(keywords)$
+ pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
+ $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},
+ $endif$
+ breaklinks=true}
+
+% Hyperlinks as footnotes control from Metadata
+$if(links-as-notes)$
+\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
+$endif$
+
+% Verbatim in footnotes control from Metadata
+$if(verbatim-in-note)$
+\usepackage{fancyvrb}
+\VerbatimFootnotes
+$endif$
+
+% Syntax highlight
+\usepackage{color}
+\usepackage{fancyvrb}
+\newcommand{\VerbBar}{|}
+\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
+\DefineVerbatimEnvironment{Highlighting}{Verbatim}{
+ commandchars=\\\{\},
+ fontsize=\footnotesize}
+\newenvironment{Shaded}{}{}
+\newcommand{\AlertTok}[1]{\textbf{#1}}
+\newcommand{\AnnotationTok}[1]{\textit{#1}}
+\newcommand{\AttributeTok}[1]{#1}
+\newcommand{\BaseNTok}[1]{#1}
+\newcommand{\BuiltInTok}[1]{#1}
+\newcommand{\CharTok}[1]{#1}
+\newcommand{\CommentTok}[1]{\textit{#1}}
+\newcommand{\CommentVarTok}[1]{\textit{#1}}
+\newcommand{\ConstantTok}[1]{#1}
+\newcommand{\ControlFlowTok}[1]{\textbf{#1}}
+\newcommand{\DataTypeTok}[1]{\underline{#1}}
+\newcommand{\DecValTok}[1]{#1}
+\newcommand{\DocumentationTok}[1]{\textit{#1}}
+\newcommand{\ErrorTok}[1]{\textbf{#1}}
+\newcommand{\ExtensionTok}[1]{#1}
+\newcommand{\FloatTok}[1]{#1}
+\newcommand{\FunctionTok}[1]{#1}
+\newcommand{\ImportTok}[1]{#1}
+\newcommand{\InformationTok}[1]{\textit{#1}}
+\newcommand{\KeywordTok}[1]{\textbf{#1}}
+\newcommand{\NormalTok}[1]{#1}
+\newcommand{\OperatorTok}[1]{#1}
+\newcommand{\OtherTok}[1]{#1}
+\newcommand{\PreprocessorTok}[1]{\textbf{#1}}
+\newcommand{\RegionMarkerTok}[1]{#1}
+\newcommand{\SpecialCharTok}[1]{#1}
+\newcommand{\SpecialStringTok}[1]{#1}
+\newcommand{\StringTok}[1]{#1}
+\newcommand{\VariableTok}[1]{#1}
+\newcommand{\VerbatimStringTok}[1]{#1}
+\newcommand{\WarningTok}[1]{\textit{#1}}
+
+% Multiple page tables if needed
+$if(tables)$
+\usepackage{longtable,booktabs}
+$endif$
+
+% Strikeout text if needed
+$if(strikeout)$
+\usepackage[normalem]{ulem}
+% avoid problems with \sout in headers with hyperref:
+\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
+$endif$
+
+% Definitions related to chapters only if book is used
+% REMAKE CHAPTER FOR FANCYHEADER
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\makeatletter
+ \let\stdchapter\chapter
+ \renewcommand*\chapter{%
+ \@ifstar{\starchapter}{\@dblarg\nostarchapter}}
+ \newcommand*\starchapter[1]{
+ \stdchapter*{#1}
+ \thispagestyle{chapter} % This is the point
+ \markboth{\MakeUppercase{#1}}{}
+ }
+ \def\nostarchapter[#1]#2{
+ \stdchapter[{#1}]{#2}
+ \thispagestyle{chapter}
+ }
+\makeatother
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+% Chapter formating
+% https://www.sharelatex.com/learn/Sections_and_chapters#/Customize_chapters_and_sections
+\usepackage{titlesec}
+\newcommand{\hsp}{\hspace{20pt}}
+\titlespacing*{\chapter}{0pt}{0pt}{40pt}
+
+% Title font
+\usepackage{titling}
+\usepackage{fontspec}
+% Specify different font for section headings
+\newfontfamily\headingfont[]{Pathway Gothic One}
+\titleformat{\chapter}
+ [block]
+ {\HUGE\headingfont}
+ {}
+ {0pt}
+ {\MakeUppercase}
+%\titleformat*{\chapter}{\Huge\headingfont}
+\titleformat*{\section}{\Huge\headingfont}
+\titleformat*{\subsection}{\LARGE\headingfont}
+\titleformat*{\subsubsection}{\Large\headingfont}
+\renewcommand{\maketitlehooka}{\headingfont}
+
+% Custom header
+\usepackage{fancyhdr} % man http://osl.ugr.es/CTAN/macros/latex/contrib/fancyhdr/fancyhdr.pdf
+
+% No 'chapter' word
+%\addto\captionsenglish{\renewcommand\chaptername{}}
+
+% Scale images to avoid overflow by default
+\usepackage{textcomp}
+\usepackage{graphicx,grffile}
+\makeatletter
+\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
+\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
+\makeatother
+% Scale images if necessary, so that they will not overflow the page
+% margins by default, and it is still possible to overwrite the defaults
+% using explicit options in \includegraphics[width, height, ...]{}
+\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
+
+% Copyleft symbol
+\newcommand{\copyleft}{\reflectbox{\copyright}}
+
+% Prevent overfull lines
+\setlength{\emergencystretch}{3em}
+\providecommand{\tightlist}{
+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+% Redefine (sub)paragraphs to behave more like sections
+$if(subparagraph)$
+$else$
+\ifx\paragraph\undefined\else
+\let\oldparagraph\paragraph
+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
+\fi
+\ifx\subparagraph\undefined\else
+\let\oldsubparagraph\subparagraph
+\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
+\fi
+$endif$
+
+\pagestyle{fancy}
+% Header
+%% ADDED LATER
+\renewcommand{\headrulewidth}{0pt}
+\fancyhead{} % clear header
+
+% Footer
+\fancyfoot{} % clear footer
+%\renewcommand{\footrulewidth}{0.4pt}
+\fancyfoot[LE]{\thepage \hspace{20pt} \scriptsize{\leftmark}}
+\fancyfoot[RO]{\thepage}
+%\fancyfoot[LO, RE]{$if(license)$\textcopyleft $endif$ $author$}
+
+% Header on CHAPTER PAGE TODO
+\fancypagestyle{chapter}{%
+ %\fancyhead{}
+ %\fancyhead[L]{\logo{0.5}}
+ %\fancyhead[R]{\LARGE{$title$}}
+}
+
+% Footer on cover
+\fancypagestyle{titlepage}{%
+ \fancyhead{} % clear header
+ %\renewcommand{\headrulewidth}{0pt}
+ \fancyfoot[R]{$author$}
+ \fancyfoot[L]{$if(license)$ $license$ $endif$}
+}
+
+% Beautiful quotes
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage{framed}
+
+% Use custom leftbar
+\renewenvironment{leftbar}[1][\hsize]
+ {
+ \def\FrameCommand {}
+ \MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}%
+ }
+ {\endMakeFramed}
+% Put leftbar on quote
+\let\oldquote=\quote
+\let\oldendquote=\endquote
+\renewenvironment{quote}
+ {\vspace{10pt}\leftbar\vspace*{-6pt}\oldquote}
+ {\oldendquote\endleftbar\vspace{10pt}}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+$for(header-includes)$
+$header-includes$
+$endfor$
+
+% Metathings for title, author and date
+$if(title)$
+\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
+$endif$
+$if(subtitle)$
+\providecommand{\subtitle}[1]{}
+\subtitle{$subtitle$}
+$endif$
+$if(author)$
+\author{$for(author)$$author$$sep$ \and $endfor$}
+$endif$
+\date{$date$}
+
+
+\begin{document}
+
+
+% Define cover
+$if(title)$
+\begin{titlepage}
+\thispagestyle{titlepage}
+\vspace*{4cm}
+ {\fontsize{35}{45}\headingfont \MakeUppercase{$title$}}
+\hfill
+% TODO: Logo removed from here, maybe add it down in the middle?
+%\logo{1}
+%\textcolor[RGB]{220,220,220}{\rule{\textwidth}{0.4pt}}
+$if(subtitle)$
+\begin{doublespace}
+{\LARGE $subtitle$}
+\end{doublespace}
+$endif$
+\end{titlepage}
+$endif$
+
+% Changes registry
+% TODO
+
+$if(acknowledgement)$
+\cleardoublepage
+\vspace*{4cm}
+$acknowledgement$
+\vspace*{\fill}
+$endif$
+
+$for(include-before)$
+$include-before$
+$endfor$
+
+
+$if(toc)$
+\renewcommand{\contentsname}{$toc-title$}
+{
+$if(colorlinks)$
+ \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
+$endif$
+ \setcounter{tocdepth}{$toc-depth$}
+ \setcounter{secnumdepth}{$toc-secnumdepth$}
+ \tableofcontents
+}
+$endif$
+
+$if(lot)$
+\listoftables
+$endif$
+$if(lof)$
+\listoffigures
+$endif$
+$body$
+
+$for(include-after)$
+$include-after$
+$endfor$
+
+% Define back cover
+\newcommand*\cleartoleftpage{
+ \clearpage
+ \ifodd\value{page}\hbox{}\newpage\fi
+}
+% Add backcover
+\cleartoleftpage
+\thispagestyle{empty}
+\null\vfill
+\logo{0.8}
+\vspace{0cm}
+
+\end{document}
diff --git a/templates/ebook/book.epub b/templates/ebook/book.epub
new file mode 100644
index 0000000..336b608
--- /dev/null
+++ b/templates/ebook/book.epub
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"$if(lang)$ xml:lang="$lang$"$endif$>
+<head>
+ <meta charset="utf-8" />
+ <meta name="generator" content="pandoc" />
+ <title>$pagetitle$</title>
+$if(highlighting-css)$
+ <style>
+$highlighting-css$
+ </style>
+$endif$
+$for(css)$
+ <link rel="stylesheet" type="text/css" href="$css$" />
+$endfor$
+$for(header-includes)$
+ $header-includes$
+$endfor$
+</head>
+<body$if(coverpage)$ id="cover"$endif$$if(body-type)$ epub:type="$body-type$"$endif$>
+$if(titlepage)$
+<section epub:type="titlepage" class="titlepage">
+$for(title)$
+$if(title.type)$
+ <h1 class="$title.type$">$title.text$</h1>
+$else$
+ <h1 class="title">$title$</h1>
+$endif$
+$endfor$
+$if(subtitle)$
+ <p class="subtitle">$subtitle$</p>
+$endif$
+$for(author)$
+ <p class="author">$author$</p>
+$endfor$
+$for(creator)$
+ <p class="$creator.role$">$creator.text$</p>
+$endfor$
+$if(publisher)$
+ <p class="publisher">$publisher$</p>
+$endif$
+$if(date)$
+ <p class="date">$date$</p>
+$endif$
+$if(rights)$
+ <div class="rights">$rights$</div>
+$endif$
+
+</section>
+$if(acknowledgement)$
+<section ebook:type="acknowledgements" class="acknowledgements">
+$acknowledgement$
+</section>
+$endif$
+$else$
+$for(include-before)$
+$include-before$
+$endfor$
+$body$
+$for(include-after)$
+$include-after$
+$endfor$
+$endif$
+</body>
+</html>
+
diff --git a/templates/ebook/epub.css b/templates/ebook/epub.css
new file mode 100644
index 0000000..dc1dc7d
--- /dev/null
+++ b/templates/ebook/epub.css
@@ -0,0 +1,26 @@
+/* This defines styles and classes used in the book */
+body { margin: 5%; text-align: justify; font-size: medium; }
+code { font-family: monospace; }
+h1 { text-align: left; }
+h2 { text-align: left; }
+h3 { text-align: left; }
+h4 { text-align: left; }
+h5 { text-align: left; }
+h6 { text-align: left; }
+h1.title { }
+h2.author { }
+h3.date { }
+nav#toc ol,
+nav#landmarks ol { padding: 0; margin-left: 1em; }
+nav#toc ol li,
+nav#landmarks ol li { list-style-type: none; margin: 0; padding: 0; }
+a.footnote-ref { vertical-align: super; }
+em, em em em, em em em em em { font-style: italic;}
+em em, em em em em { font-style: normal; }
+code{ white-space: pre-wrap; }
+span.smallcaps{ font-variant: small-caps; }
+span.underline{ text-decoration: underline; }
+q { quotes: "“" "”" "‘" "’"; }
+div.column{ display: inline-block; vertical-align: top; width: 50%; }
+div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
+.acknowledgements{page-break-before: always; margin-top: 2em; font-size: small}