summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.txt202
-rw-r--r--README.md70
-rw-r--r--install.sh7
-rw-r--r--pandoc/templates/elenq-article.latex393
-rw-r--r--pandoc/templates/elenq-book.latex432
5 files changed, 1104 insertions, 0 deletions
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e896640
--- /dev/null
+++ b/README.md
@@ -0,0 +1,70 @@
+# ElenQ Documentation templates
+
+`pandoc` templates for ElenQ documents.
+
+## Installation
+
+Run `install.sh` script and it'll automagically link all the templates to your
+`~/.pandoc/templates/` folder.
+
+This method doesn't work on a non-Unix-like OS.
+
+
+## Usage
+
+Once installed `pandoc` will be aware of the place where the templates are so
+they can be used directly like:
+
+```
+pandoc input.md -o output.pdf --template=elenq-article
+```
+
+### Specific details
+
+These templates only work with `pandoc`'s `--latex-engine=xelatex` option.
+
+> NOTE: Recent `pandoc` versions changed the name of the option to `--pdf-engine`
+
+### Metadata
+
+Templates expect some metadata to be set, no field is mandatory but some can be
+important (judge yourself):
+
+``` yaml
+lang: english | spanish | basque | ...
+title: The title of the document
+subtitle: The subtitle of the article
+author: Author's name
+license: License of the document
+```
+
+> NOTE: Templates automatically put the copyleft symbol in the PDF, they are
+> only prepared for copyleft licenses.
+
+### Helpful help
+
+You'd probably want to create some aliases like these:
+
+``` bash
+# Pandoc for ElenQ
+alias pandoc-xelatex="pandoc $@ --latex-engine=xelatex --to latex -N"
+alias elenqdoc-article="pandoc-xelatex $@ --template elenq-article --metadata=documentclass:article"
+alias elenqdoc-book="pandoc-xelatex $@ --template elenq-book --metadata=documentclass:book"
+```
+
+## Editing
+
+Just edit the content of the templates as they were LaTeX files.
+
+### Logos
+
+The ElenQ Technology logo is embedded inside the templates as a `tikz` image.
+
+There's a way to convert from SVG to TikZ you'd probably want to use to change
+the logo from the templates.
+
+https://github.com/kjellmf/svg2tikz
+
+## License
+
+This repository is distributed under the terms of the Apache License 2.0.
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..4458ed1
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Create directory
+mkdir -p ~/.pandoc/templates
+
+# Link at ./pandoc
+stow -Rt ~/.pandoc/templates -d pandoc templates
diff --git a/pandoc/templates/elenq-article.latex b/pandoc/templates/elenq-article.latex
new file mode 100644
index 0000000..c103547
--- /dev/null
+++ b/pandoc/templates/elenq-article.latex
@@ -0,0 +1,393 @@
+% 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 Article template
+% -----------------------------------------------------------------------------
+%
+% Expects some metadata to be set:
+%
+% lang: english | spanish | basque | ...
+% title: The title of the document
+% subtitle: The subtitle of the article
+% author: Author's name
+% license: License of the document
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass[a4paper,11pt]{$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)$
+\usepackage{polyglossia}
+\setmainlanguage{$lang$}
+$endif$
+
+% No indent
+\usepackage{parskip}
+
+% Margins
+\usepackage[top=2.5cm,
+ bottom=2.5cm,
+ left=3.25cm,
+ right=2.5cm,
+ headheight=30pt,
+ includeheadfoot=true]{geometry}
+
+% Color
+\usepackage{xcolor}
+
+% Spacing
+\usepackage{setspace}
+
+% Font
+\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}{€}
+
+% 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(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
+$if(highlighting-macros)$
+$highlighting-macros$
+$endif$
+
+% 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$
+
+% 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
+\fancyhead{} % clear header
+\fancyhead[RO]{\slshape \rightmark}
+\fancyhead[LE]{\slshape \leftmark}
+
+% Footer
+\fancyfoot{} % clear footer
+\renewcommand{\footrulewidth}{0.4pt}
+\fancyfoot[RO, LE]{\thepage}
+\fancyfoot[LO, RE]{\textcopyleft $author$}
+
+% Header on CHAPTER PAGE TODO
+\fancypagestyle{chapter}{%
+ \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]{\textcopyleft $license$}
+}
+
+% Article titlepage, similar to book chapter
+\fancypagestyle{articletitle}{%
+ \fancyhead{} % clear header
+ \fancyhead[L]{\logo{0.5}}
+ \fancyhead[R]{\LARGE{$title$}}
+ \fancyfoot[R]{$author$}
+ \fancyfoot[L]{\textcopyleft $license$}
+}
+
+% Beautiful quotes
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage{framed}
+
+% Use custom leftbar
+\renewenvironment{leftbar}[1][\hsize]
+ { \color{gray}
+ \def\FrameCommand
+ {{\color{lightgray}\vrule width 3pt}}
+ \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
+% Make Title act similarly to book chapter
+\thispagestyle{articletitle}
+\begin{center}
+\vspace*{0.3cm}
+\begin{doublespace}
+$if(title)$
+{\Huge\bfseries $title$}\\
+$endif$
+$if(subtitle)$
+{\LARGE $subtitle$}
+$endif$
+\end{doublespace}
+\end{center}
+
+$if(abstract)$
+\begin{abstract}
+$abstract$
+\end{abstract}
+$endif$
+
+$for(include-before)$
+$include-before$
+$endfor$
+
+$if(toc)$
+{
+$if(colorlinks)$
+\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
+$endif$
+\setcounter{tocdepth}{$toc-depth$}
+\tableofcontents
+}
+$endif$
+
+$if(lot)$
+\listoftables
+$endif$
+$if(lof)$
+\listoffigures
+$endif$
+$body$
+
+$for(include-after)$
+$include-after$
+$endfor$
+
+\end{document}
diff --git a/pandoc/templates/elenq-book.latex b/pandoc/templates/elenq-book.latex
new file mode 100644
index 0000000..aafe32c
--- /dev/null
+++ b/pandoc/templates/elenq-book.latex
@@ -0,0 +1,432 @@
+% 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:
+%
+% lang: english | spanish | basque | ...
+% title: The title of the document
+% subtitle: The subtitle of the article
+% author: Author's name
+% license: License of the document
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\documentclass[a4paper,11pt]{$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)$
+\usepackage{polyglossia}
+\setmainlanguage{$lang$}
+$endif$
+
+% No indent
+\usepackage{parskip}
+
+% Margins
+\usepackage[top=2.5cm,
+ bottom=2.5cm,
+ left=3.25cm,
+ right=2.5cm,
+ headheight=30pt,
+ includeheadfoot=true]{geometry}
+
+% Color
+\usepackage{xcolor}
+
+% Spacing
+\usepackage{setspace}
+
+% Font
+\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}{€}
+
+% 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(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
+$if(highlighting-macros)$
+$highlighting-macros$
+$endif$
+
+% 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}}
+\titleformat{\chapter}
+ [hang]
+ {\Huge}
+ {\thechapter\hsp}
+ {0pt}
+ {\Huge}
+\titlespacing*{\chapter}{0pt}{0pt}{40pt}
+
+% 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
+\fancyhead{} % clear header
+\fancyhead[RO]{\slshape \rightmark}
+\fancyhead[LE]{\slshape \leftmark}
+
+% Footer
+\fancyfoot{} % clear footer
+\renewcommand{\footrulewidth}{0.4pt}
+\fancyfoot[RO, LE]{\thepage}
+\fancyfoot[LO, RE]{\textcopyleft $author$}
+
+% Header on CHAPTER PAGE TODO
+\fancypagestyle{chapter}{%
+ \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]{\textcopyleft $license$}
+}
+
+% Beautiful quotes
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage{framed}
+
+% Use custom leftbar
+\renewenvironment{leftbar}[1][\hsize]
+ { \color{gray}
+ \def\FrameCommand
+ {{\color{lightgray}\vrule width 3pt}}
+ \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{28}{34}\selectfont\bfseries $title$}
+\hfill
+\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(changes)$
+\chapter*{$changestitle$}
+\begin{tabular}{l l l}
+\input{changes.tex}
+\end{tabular}
+$endif$
+
+$for(include-before)$
+$include-before$
+$endfor$
+
+$if(toc)$
+{
+$if(colorlinks)$
+\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
+$endif$
+\setcounter{tocdepth}{$toc-depth$}
+\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}