├── .gitignore
├── letter
├── graphics
│ └── bids-logo.png
├── Makefile
├── letterhead.tex
├── letter.md
├── template.tex
└── README.md
├── report
├── static
│ ├── header.tex
│ ├── default.yml
│ ├── tufte-template.tex
│ └── ieee-with-url.csl
├── bibliography.bib
├── Makefile
├── report.md
├── diagram.svg
└── bin
│ └── pandocCommentFilter.py
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 |
--------------------------------------------------------------------------------
/letter/graphics/bids-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BIDS/pandoc-templates/HEAD/letter/graphics/bids-logo.png
--------------------------------------------------------------------------------
/report/static/header.tex:
--------------------------------------------------------------------------------
1 | \usepackage{titlesec}
2 | \titleformat*{\subsection}{\large\itshape}
3 | % \bfseries to make bold
4 | % \normalsize is, well, normal size; then there's \large \Large \LARGE \small
5 | % families: \rmfamily \sffamily \ttfamily
6 |
7 | \usepackage{tabularx}
8 | \usepackage{booktabs}
9 |
--------------------------------------------------------------------------------
/report/static/default.yml:
--------------------------------------------------------------------------------
1 | ---
2 | #fontfamily: utopia
3 | # See also http://pandoc.org/MANUAL.html#templates (search for fontfamily)
4 | # utopia, bookman, mathpazo (Palatino), arev (Arev Sans), fouriernc, times, libertine, lmodern
5 | documentclass: tufte-handout
6 | fontfamily: mathpazo
7 | mainfont: Palatino
8 | monofont: Menlo
9 | fontsize: 10pt
10 | newtxmathoptions:
11 | - cmintegrals
12 | - cmbraces
13 | linkcolor: RoyalBlue
14 | urlcolor: RoyalBlue
15 | toccolor: RoyalBlue
16 | ---
17 |
--------------------------------------------------------------------------------
/report/bibliography.bib:
--------------------------------------------------------------------------------
1 | @article{scikit-image,
2 | title = {scikit-image: image processing in {P}ython},
3 | author = {van der Walt, {S}t\'efan and {S}ch\"onberger, {J}ohannes {L}. and
4 | {Nunez-Iglesias}, {J}uan and {B}oulogne, {F}ran\c{c}ois and {W}arner,
5 | {J}oshua {D}. and {Y}ager, {N}eil and {G}ouillart, {E}mmanuelle and
6 | {Y}u, {T}ony and the scikit-image contributors},
7 | year = {2014},
8 | month = {6},
9 | keywords = {Image processing, Reproducible research, Education,
10 | Visualization, Open source, Python, Scientific programming},
11 | volume = {2},
12 | pages = {e453},
13 | journal = {PeerJ},
14 | issn = {2167-8359},
15 | url = {http://dx.doi.org/10.7717/peerj.453},
16 | doi = {10.7717/peerj.453}
17 | }
18 |
--------------------------------------------------------------------------------
/letter/Makefile:
--------------------------------------------------------------------------------
1 | build_dir := build
2 | excluded := README.md
3 |
4 | sources := $(filter-out $(excluded),$(wildcard *.md))
5 | letters = $(addprefix $(build_dir)/,$(sources:.md=.pdf))
6 |
7 | .PHONY: default
8 | default: $(letters)
9 |
10 | $(build_dir)/:
11 | mkdir -p $@
12 |
13 | $(build_dir)/letterhead.pdf: letterhead.tex | $(build_dir)/
14 | cp letterhead.tex $(build_dir)
15 | cd $(build_dir) && xelatex $<
16 |
17 | $(letters): $(build_dir)/%.pdf : %.md | $(build_dir)/letterhead.pdf template.tex
18 | # See https://pandoc.org/MANUAL.html#extensions for a list of extensions
19 | pandoc --pdf-engine=xelatex \
20 | --template template.tex \
21 | -s -o $@ $<
22 |
23 | # Add the build directory as an order only prerequisite
24 | $(foreach letter,$(letters),$(eval $(letter): | $(dir $(report))))
25 |
26 | clean: $(build_dir)
27 | rm -rf $(build_dir)
28 |
--------------------------------------------------------------------------------
/letter/letterhead.tex:
--------------------------------------------------------------------------------
1 | \documentclass[letterpaper]{minimal}
2 | \usepackage[paperwidth=14in,paperheight=5in,top=15mm,left=35mm,right=50mm]{geometry}
3 | \usepackage{graphicx}
4 | \usepackage{fontspec}
5 | \setmainfont[
6 | Mapping=tex-text,
7 | ]{TeX Gyre Adventor}
8 | \defaultfontfeatures{Scale=MatchLowercase}
9 | \usepackage{xcolor}
10 | \definecolor{bidsblue}{RGB}{0, 50, 98}
11 | \renewcommand\normalsize{\fontsize{15pt}{20pt}\selectfont}
12 |
13 | \begin{document}
14 | \begin{minipage}{\textwidth}
15 | \begin{minipage}{0.4\textwidth}
16 | \includegraphics[width=76mm]{../graphics/bids-logo.png}
17 | \end{minipage}
18 | \hfill
19 | \begin{minipage}{0.6\textwidth}\raggedleft
20 | \vspace{0.5in}
21 | \textcolor{bidsblue}{
22 | \noindent Berkeley Institute for Data Science\\
23 | \textsc{UNIVERSITY OF CALIFORNIA, BERKELEY}\\
24 | 190 Doe Library\\
25 | Berkeley, CA 94720\\
26 | http://bids.berkeley.edu}%
27 | \end{minipage}
28 | \begin{minipage}{\textwidth}
29 | \vspace{7.5mm}
30 | \hspace{2mm}\rule{\textwidth}{0.4pt}
31 | \end{minipage}
32 | \end{minipage}
33 | \end{document}
34 |
--------------------------------------------------------------------------------
/letter/letter.md:
--------------------------------------------------------------------------------
1 | ---
2 | subject: Once in a galaxy far far away
3 | author: Ada Twist
4 | endnote: |
5 | \vspace{5mm}
6 | Co-signed:
7 |
8 | Prof. A
9 |
10 | Mr. B
11 |
12 | Director. C
13 | #city: Naumburg
14 | #from:
15 | #- Artillerieregiment, 8. Batt.
16 | #- Nordstraße 15, Naumburg
17 | to:
18 | - Carl Freiherr von Gersdorff
19 | - Stresow-Kaserne I
20 | - Grenadierstraße 13–16
21 | - 13597 Spandau
22 |
23 | # Settings
24 |
25 | # These fonts require texlive-fonts-extra
26 | mainfont: Caladea
27 | altfont: Carlito
28 |
29 | # Alternative fonts:
30 |
31 | #mainfont: TeX Gyre Pagella
32 | #altfont: TeX Gyre Heros
33 |
34 | monofont: Courier
35 | lang: en-US
36 | fontsize: 12pt
37 | geometry: letterpaper, left=25mm, right=25mm, top=50mm, bottom=25mm
38 | letterhead: true
39 | customdate: 2018-11-30
40 | ---
41 |
42 | To whom it may concern,
43 |
44 | This is a letter, and in it I have what I want to say. But I surely
45 | cannot say it before it has been written, and it is thus that I now
46 | find myself with pen in hand, approaching this paper.
47 |
48 | That said, time is no-one's friend, and therefore I must unfortunately
49 | depart before having shared that which I came to say; which, although
50 | undoubtedly of utmost importance, will have to wait for another day.
51 |
52 | Best regards,
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BIDS Pandoc Templates
2 |
3 | You need [Pandoc](https://pandoc.org/installing.html) and LaTeX
4 | installed. If you want to compile SVG diagrams, you'll also need
5 | Inkscape.
6 |
7 | ## Report
8 |
9 | Change into `report` and type `make`. The result is in
10 | `build/report.pdf`.
11 |
12 | Here is [an example build](https://github.com/BIDS/pandoc-report/blob/build/build/report.pdf).
13 |
14 | The report is derived
15 | from [this template](https://github.com/jez/pandoc-starter) which is
16 | [MIT licensed](https://jez.io/MIT-LICENSE.txt).
17 |
18 | ### Adding your own report
19 |
20 | Copy `report.md` to `my_report.md` (or whatever you want to call it).
21 | The `make` command will now also produce your report in
22 | `build/my_report.pdf`.
23 |
24 | ### Vector graphics
25 |
26 | All `.svg` images (Inkscape graphics) gets converted to PNG files in
27 | the `build/` folder. Those images can then be used in the document,
28 | e.g.
29 |
30 | ```
31 | 
32 | ```
33 |
34 | ## Letter
35 |
36 | The letter template works very much like the report. Any custom
37 | adjustments can be made to `static/tufte_template.tex`. It is derived
38 | from [this template](https://github.com/mrzool/letter-boilerplate)
39 | which is [MIT licensed](https://opensource.org/licenses/MIT).
40 |
--------------------------------------------------------------------------------
/report/Makefile:
--------------------------------------------------------------------------------
1 | build_dir := build
2 | excluded := README.md
3 | sources := $(filter-out $(excluded),$(wildcard *.md))
4 | reports = $(addprefix $(build_dir)/,$(sources:.md=.pdf))
5 | vector_images = $(wildcard *.svg)
6 | images := $(addprefix $(build_dir)/,$(vector_images:.svg=.png))
7 | static := static
8 | bin := bin
9 | metadata := $(static)/default.yml
10 |
11 | # Look up your bibliography style at https://www.zotero.org/styles
12 | # Download the CSL file to the static directory and modify `bibstyle`
13 | # below
14 | bibstyle := ieee-with-url.csl
15 |
16 | .PHONY: default
17 | default: $(reports)
18 |
19 | $(build_dir)/:
20 | mkdir -p $@
21 |
22 | $(reports): $(build_dir)/%.pdf : %.md | $(images)
23 | # See https://pandoc.org/MANUAL.html#extensions for a list of extensions
24 | # To disable TOC comment out --toc
25 | # To disable Bibliography comment the line containing pandoc-citeproc
26 | pandoc $(metadata) \
27 | --from markdown+implicit_figures \
28 | --template $(static)/tufte-template.tex \
29 | --filter $(bin)/pandocCommentFilter.py \
30 | --include-in-header $(static)/header.tex \
31 | --toc \
32 | --filter pandoc-citeproc --csl $(static)/$(bibstyle) \
33 | -s -o $@ $<
34 |
35 | $(images): $(build_dir)/%.png : %.svg
36 | -inkscape --export-png=$@ --export-dpi=300 $<
37 |
38 | # Add the build directory as an order only prerequisite
39 | $(foreach report,$(reports),$(eval $(report): | $(dir $(report))))
40 | $(foreach image,$(images),$(eval $(image): | $(dir $(image))))
41 |
42 | clean: $(build_dir)
43 | rm -rf $(build_dir)
44 |
--------------------------------------------------------------------------------
/report/report.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: The Title of My Report
3 | author: "Author One, Author Two, Author Three"
4 | date: Berkeley Institute for Data Science (BIDS) \newline \vspace{-.15cm} University of California, Berkeley \newline October 2018
5 | draft: true
6 | bibliography: bibliography.bib
7 | abstract: |
8 | Any LaTeX can go here; this is the summary of the document.
9 |
10 | ---
11 |
12 | # Some section
13 |
14 | The content of some section. And you can use raw LaTeX too if you
15 | need. You can add **margin notes**.\marginnote{This is a margin note.}
16 |
17 | You can also make footnotes, that appear in the margin[^my_footnote].
18 |
19 | Sometimes there's something to fix, so [add a fixme note for
20 | that]{.fixme}. Otherwise, a [comment might do]{.comment}.
21 |
22 | From your bibliography, you can cite papers [@scikit-image]. You can
23 | change the citation style
24 | by [downloading another style](https://www.zotero.org/styles?q=ieee)
25 | and then modifying the Makefile to use that style file.
26 |
27 | [^my_footnote]: And this is the text of my footnote. It can have
28 | [links to important pages](https://github.com/bids/fellows/wiki).
29 |
30 | ## And then a subsection {#with-an-anchor-if-you-need-to-refer-to-it}
31 |
32 | In the [subsection](#with-an-anchor-if-you-need-to-refer-to-it) it is
33 | written that...
34 |
35 | Pandoc Markdown supports various forms of tables. Like this one:
36 |
37 | | Table | Header |
38 | |-------|--------|
39 | | 4.00 | 5.00 |
40 |
41 | You should also take a look at the manual
42 | for [Tufte LaTeX](https://ctan.org/pkg/tufte-latex?lang=en), because
43 | you can use raw LaTeX with any of the instructions described within.
44 |
45 | Finally, you can also switch the document format to any class of your
46 | choice, but you will also have to modify the `Makefile` to remove the
47 | Tufte style there.
48 |
49 | # A beautiful diagram
50 |
51 | Here is a beautiful diagram.
52 |
53 | { width=30% }
54 |
55 | Which can also be rendered as a captioned figure:
56 |
57 | { width=30% }
58 |
59 | # Some source code
60 |
61 | ```python
62 | def foo(bar):
63 | return bar + 1
64 | ```
65 |
66 | # Bibliography
67 |
68 |
--------------------------------------------------------------------------------
/report/diagram.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
92 |
--------------------------------------------------------------------------------
/letter/template.tex:
--------------------------------------------------------------------------------
1 | %!TEX TS-program = xelatex
2 | %!TEX encoding = UTF-8 Unicode
3 |
4 | \documentclass[$fontsize$,letterpaper]{article}
5 | \usepackage{fontspec}
6 |
7 | % LAYOUT
8 | %--------------------------------
9 | \usepackage{geometry}
10 | \geometry{$geometry$}
11 |
12 | % No page numbers
13 | \pagenumbering{gobble}
14 |
15 | % Left align
16 | \usepackage[document]{ragged2e}
17 |
18 | % Trim excessive whitespace before lists
19 | \usepackage{enumitem}
20 | \setlist{nolistsep}
21 |
22 | $if(letterhead)$
23 | \usepackage{wallpaper}
24 | % \ThisULCornerWallPaper{1}{letterhead-front.pdf} % Uncomment to include a different letterhead on the first page
25 | \ThisULCornerWallPaper{1}{build/letterhead.pdf}
26 | $endif$
27 |
28 | % LANGUAGE
29 | %--------------------------------
30 | $if(lang)$
31 | \usepackage{polyglossia}
32 | \setmainlanguage{$lang$}
33 | $endif$
34 |
35 | % TYPOGRAPHY
36 | %--------------------------------
37 | \usepackage{xunicode}
38 | \usepackage{xltxtra}
39 | \usepackage[protrusion=true,final]{microtype}
40 |
41 | % converts LaTeX specials (quotes, dashes etc.) to Unicode
42 | \defaultfontfeatures{
43 | Mapping=tex-text,
44 | Scale=MatchLowercase
45 | }
46 | \setromanfont [Ligatures={Common}, Numbers={OldStyle}, Scale=1.05]{$mainfont$}
47 | \setsansfont[Scale=0.9]{$altfont$}
48 | \setmonofont[Scale=0.8]{$monofont$}
49 |
50 | % Set paragraph break
51 | \setlength{\parskip}{1em}
52 |
53 | % Custom ampersand
54 | \newcommand{\amper}{{\fontspec[Scale=.95]{$mainfont$}\selectfont\itshape\&}}
55 |
56 | $if(mainfont)$
57 | \setmainfont{$mainfont$}
58 | $endif$
59 | $if(altfont)$
60 | \setsansfont{$altfont$}
61 | $endif$
62 |
63 | % Command required by how Pandoc handles the list conversion
64 | \providecommand{\tightlist}{%
65 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
66 |
67 | % PDF SETUP
68 | %--------------------------------
69 | \usepackage[xetex, bookmarks, colorlinks, breaklinks]{hyperref}
70 | \hypersetup
71 | {
72 | pdfauthor={$author$},
73 | pdfsubject={$subject$},
74 | pdftitle={$subject$},
75 | colorlinks,breaklinks,
76 | filecolor=black,
77 | urlcolor=[rgb]{0.117,0.682,0.858},
78 | linkcolor=[rgb]{0.117,0.682,0.858},
79 | linkcolor=[rgb]{0.117,0.682,0.858},
80 | citecolor=[rgb]{0.117,0.682,0.858}
81 | }
82 |
83 | % To display custom date in the example
84 | $if(customdate)$
85 | \usepackage[$lang$]{datetime2}
86 | \DTMsavedate{customdate}{$customdate$}
87 | $endif$
88 |
89 | % DOCUMENT
90 | %--------------------------------
91 | \begin{document}
92 |
93 | \begin{minipage}{\textwidth}
94 | \normalsize \sffamily%
95 | \vspace{10mm}%
96 | $for(to)$
97 | $to$\\
98 | $endfor$
99 | \end{minipage}
100 |
101 | \rmfamily
102 | \begin{flushright}
103 | $if(city)$city, $endif$$if(customdate)$\DTMusedate{customdate}$else$\today$endif$
104 | \end{flushright}
105 |
106 | \vspace{1em}
107 |
108 | $if(subject)$
109 | \textbf{$subject$}
110 | $endif$
111 |
112 | \vspace{1em}
113 |
114 | $body$
115 |
116 | \IfFileExists{graphics/signature.pdf}
117 | {
118 | \includegraphics[height=5.5\baselineskip]{graphics/signature.pdf} \par
119 | }
120 | {
121 | \vspace{2.5\baselineskip}
122 | }
123 | $author$
124 |
125 | $endnote$
126 |
127 | \end{document}
128 |
--------------------------------------------------------------------------------
/letter/README.md:
--------------------------------------------------------------------------------
1 | Originally from https://github.com/mrzool/letter-boilerplate
2 |
3 | Heavily modified by @stefanv to reproduce the BIDS letterhead.
4 |
5 | # Letter Boilerplate
6 |
7 | A boilerplate to quickly and painlessly generate high-quality letters through LaTeX.
8 |
9 | Why settle for MS Word when you can get the job done using your text editor?
10 |
11 | 
12 |
13 | ## Dependencies
14 |
15 | 1. LaTeX with the following extra packages: `fontspec` `geometry` `ragged2e` `enumitem` `xunicode` `xltxtra` `hyperref` `polyglossia` `footmisc` (also, `datetime2` plus its language modules if you want to use a custom date, see below in the settings section)
16 | 2. [Pandoc](http://pandoc.org/), the universal document converter.
17 |
18 | To install LaTeX on Mac OS X, I recommend getting the smaller version BasicTeX from [here](https://tug.org/mactex/morepackages.html) and installing the additional packages with `tlmgr` afterwards. Same goes for Linux: install `texlive-base` with your package manager and add the needed additional packages later.
19 |
20 | To install pandoc on Mac OS X, run `brew install pandoc`. To install it on Linux, refer to the [official docs](http://pandoc.org/installing.html).
21 |
22 | ## Getting started
23 |
24 | 1. Open `letter.md` and fill the YAML frontmatter with your details, your recipient's details, optional subject line, and the desired settings.
25 | 2. Write your letter in markdown below.
26 | 3. Run `make` to compile the PDF.
27 |
28 | If a file named `signature.pdf` is present in the directory, the boilerplate will automatically print it after the letter's body as a final touch. Follow [this method](http://tex.stackexchange.com/a/32940/82423) to import your own signature.
29 |
30 | **Note**: this template needs to be compiled with XeTeX.
31 |
32 | ### Note for Windows users
33 |
34 | Although I didn't test it, you can probably use this on Windows, too. Both [Pandoc](http://pandoc.org/installing.html) and LaTeX can be installed on Windows (I recommend [MiKTeX](http://miktex.org/) for that) and you should be able to run makefiles on Windows through [Cygwin](https://www.cygwin.com/). If that's too much hassle, this command should do the trick in Powershell:
35 |
36 | pandoc letter.md -o output.pdf --template=template.tex --pdf-engine=xelatex
37 |
38 | ## Available settings
39 |
40 | - **`subject`**: The letter's subject (optional)
41 | - **`mainfont`**: Hoefler Text is the default, but every font installed on your system should work out of the box (thanks, XeTeX!)
42 | - **`altfont`**: Used to render the recipient address so that it stands out from the rest of the letter.
43 | - **`fontsize`**: Possible values here are 10pt, 11pt and 12pt.
44 | - **`lang`**: Sets the main language through the `polyglossia` package. This is important for proper hyphenation and date format.
45 | - **`geometry`**: A string that sets the margins through `geometry`. Read [this](https://www.sharelatex.com/learn/Page_size_and_margins) to learn how this package works.
46 | - **`letterhead`**: include custom letterhead in the PDF (see below).
47 | - **`customdate`**: Allows you to specify a custom date in the format YYYY-MM-DD in case you need to pre/postdate your letter. *Caveat*: Requires `datetime2` along with its language module (ex: if `lang` is set to `german` do `tlmgr install datetime2 datetime2-german`)
48 |
49 | ## Custom letterhead
50 |
51 | If you have already designed your own letterhead and want to use it with this template, including it should be easy enough. Set the `letterhead` option to `true` to activate the `wallpaper` package in the template. `wallpaper` will look for a file named `letterhead.pdf` in the project root folder and print it on the PDF before compiling the document. Change the fonts to match the ones in your letterhead, adjust the margins with `geometry` and you should be all set.
52 |
53 | ## Recommended readings
54 |
55 | - [Typesetting Automation](http://mrzool.cc/writing/typesetting-automation/), my article about this project with in-depth instructions and some suggestions for an ideal workflow.
56 | - [The Beauty of LaTeX](http://nitens.org/taraborelli/latex) by Dario Taraborelli
57 | - [Letterhead advices](http://practicaltypography.com/letterhead.html) from Butterick's Practical Typography
58 | - [Multichannel Text Processing](https://ia.net/topics/multichannel-text-processing/) by iA
59 | - [Why Microsoft Word must Die](http://www.antipope.org/charlie/blog-static/2013/10/why-microsoft-word-must-die.html) by Charlie Stross
60 | - [Word Processors: Stupid and Inefficient](http://ricardo.ecn.wfu.edu/~cottrell/wp.html) by Allin Cottrell
61 | - [Proprietary Binary Data Formats: Just Say No!](http://www.podval.org/~sds/data.html) by Sam Steingold
62 | - [Sustainable Authorship in Plain Text using Pandoc and Markdown](http://programminghistorian.org/lessons/sustainable-authorship-in-plain-text-using-pandoc-and-markdown) by Dennis Tenen and Grant Wythoff
63 |
64 | ## Resources
65 |
66 | - Refer to [pandoc's documentation](http://pandoc.org/MANUAL.html#templates) to learn more about how templates work.
67 | - If you're not familiar with the YAML syntax, [here](http://learnxinyminutes.com/docs/yaml/)'s a good overview.
68 | - If you want to edit the template but LaTeX scares you, these [docs](https://www.sharelatex.com/learn/Main_Page) put together by ShareLaTeX cover most of the basics and are surprisingly kind to the beginner.
69 | - Odds are your question already has an answer on [TeX Stack Exchange](https://www.sharelatex.com/learn/Main_Page). Also, pretty friendly crowd in there.
70 | - Need to fax that letter? Check out [Phaxio](https://www.phaxio.com/) and learn how to send your faxes from the command line with a simple API call.
71 |
72 | ## See also
73 |
74 | - [invoice-boilerplate](https://github.com/mrzool/invoice-boilerplate) — Simple automated LaTeX invoicing system
75 | - [cv-boilerplate](https://github.com/mrzool/cv-boilerplate) — Easing the process of building and maintaining a CV using LaTeX
76 |
77 | ## License
78 |
79 | [MIT](https://opensource.org/licenses/MIT)
80 |
--------------------------------------------------------------------------------
/report/static/tufte-template.tex:
--------------------------------------------------------------------------------
1 | \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2 | $if(beamerarticle)$
3 | \usepackage{beamerarticle} % needs to be loaded first
4 | $endif$
5 | $if(fontfamily)$
6 | \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
7 | $else$
8 | \usepackage{lmodern}
9 | $endif$
10 | $if(linestretch)$
11 | \usepackage{setspace}
12 | \setstretch{$linestretch$}
13 | $endif$
14 | \usepackage{amssymb,amsmath}
15 | \usepackage{ifxetex,ifluatex}
16 | \usepackage{fixltx2e} % provides \textsubscript
17 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
18 | \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
19 | \usepackage[utf8]{inputenc}
20 | $if(euro)$
21 | \usepackage{eurosym}
22 | $endif$
23 | \else % if luatex or xelatex
24 | \ifxetex
25 | \else
26 | \usepackage{fontspec}
27 | \fi
28 | \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
29 | $for(fontfamilies)$
30 | \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
31 | $endfor$
32 | $if(euro)$
33 | \newcommand{\euro}{€}
34 | $endif$
35 | $if(mainfont)$
36 | \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
37 | $endif$
38 | $if(sansfont)$
39 | \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
40 | $endif$
41 | $if(monofont)$
42 | \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
43 | $endif$
44 | $if(mathfont)$
45 | \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
46 | $endif$
47 | $if(CJKmainfont)$
48 | \usepackage{xeCJK}
49 | \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
50 | $endif$
51 | \fi
52 | % use upquote if available, for straight quotes in verbatim environments
53 | \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
54 | % use microtype if available
55 | \IfFileExists{microtype.sty}{%
56 | \usepackage{microtype}
57 | \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
58 | }{}
59 | $if(geometry)$
60 | \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
61 | $endif$
62 | $if(colorlinks)$
63 | \PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
64 | $endif$
65 | \hypersetup{
66 | $if(title-meta)$
67 | pdftitle={$title-meta$},
68 | $endif$
69 | $if(author-meta)$
70 | pdfauthor={$author-meta$},
71 | $endif$
72 | $if(keywords)$
73 | pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
74 | $endif$
75 | $if(colorlinks)$
76 | colorlinks=true,
77 | linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
78 | citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
79 | urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
80 | $else$
81 | pdfborder={0 0 0},
82 | $endif$
83 | breaklinks=true}
84 | \urlstyle{same} % don't use monospace font for urls
85 | $if(lang)$
86 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
87 | \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
88 | $if(babel-newcommands)$
89 | $babel-newcommands$
90 | $endif$
91 | \else
92 | \usepackage{polyglossia}
93 | \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
94 | $for(polyglossia-otherlangs)$
95 | \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
96 | $endfor$
97 | \fi
98 | $endif$
99 | $if(natbib)$
100 | \usepackage{natbib}
101 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
102 | $endif$
103 | $if(biblatex)$
104 | \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
105 | $for(bibliography)$
106 | \addbibresource{$bibliography$}
107 | $endfor$
108 | $endif$
109 | $if(listings)$
110 | \usepackage{listings}
111 | $endif$
112 | $if(lhs)$
113 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
114 | $endif$
115 | $if(highlighting-macros)$
116 | $highlighting-macros$
117 | $endif$
118 | $if(verbatim-in-note)$
119 | \usepackage{fancyvrb}
120 | \VerbatimFootnotes % allows verbatim text in footnotes
121 | $endif$
122 | $if(tables)$
123 | \usepackage{longtable,booktabs}
124 | % Fix footnotes in tables (requires footnote package)
125 | \IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
126 | $endif$
127 | $if(graphics)$
128 | \usepackage{graphicx,grffile}
129 | \makeatletter
130 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
131 | \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
132 | \makeatother
133 | % Scale images if necessary, so that they will not overflow the page
134 | % margins by default, and it is still possible to overwrite the defaults
135 | % using explicit options in \includegraphics[width, height, ...]{}
136 | \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
137 | $endif$
138 | $if(links-as-notes)$
139 | % Make links footnotes instead of hotlinks:
140 | \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
141 | $endif$
142 | $if(strikeout)$
143 | \usepackage[normalem]{ulem}
144 | % avoid problems with \sout in headers with hyperref:
145 | \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
146 | $endif$
147 | $if(indent)$
148 | $else$
149 | \IfFileExists{parskip.sty}{%
150 | \usepackage{parskip}
151 | }{% else
152 | \setlength{\parindent}{0pt}
153 | \setlength{\parskip}{6pt plus 2pt minus 1pt}
154 | }
155 | $endif$
156 | \setlength{\emergencystretch}{3em} % prevent overfull lines
157 | \providecommand{\tightlist}{%
158 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
159 | $if(numbersections)$
160 | \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
161 | $else$
162 | \setcounter{secnumdepth}{0}
163 | $endif$
164 | $if(subparagraph)$
165 | $else$
166 | % Redefines (sub)paragraphs to behave more like sections
167 | \ifx\paragraph\undefined\else
168 | \let\oldparagraph\paragraph
169 | \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
170 | \fi
171 | \ifx\subparagraph\undefined\else
172 | \let\oldsubparagraph\subparagraph
173 | \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
174 | \fi
175 | $endif$
176 | $if(dir)$
177 | \ifxetex
178 | % load bidi as late as possible as it modifies e.g. graphicx
179 | $if(latex-dir-rtl)$
180 | \usepackage[RTLdocument]{bidi}
181 | $else$
182 | \usepackage{bidi}
183 | $endif$
184 | \fi
185 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
186 | \TeXXeTstate=1
187 | \newcommand{\RL}[1]{\beginR #1\endR}
188 | \newcommand{\LR}[1]{\beginL #1\endL}
189 | \newenvironment{RTL}{\beginR}{\endR}
190 | \newenvironment{LTR}{\beginL}{\endL}
191 | \fi
192 | $endif$
193 |
194 | % set default figure placement to htbp
195 | \makeatletter
196 | \def\fps@figure{htbp}
197 | \makeatother
198 |
199 | $for(header-includes)$
200 | $header-includes$
201 | $endfor$
202 |
203 | $if(title)$
204 | \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
205 | $endif$
206 | $if(subtitle)$
207 | \providecommand{\subtitle}[1]{}
208 | \subtitle{$subtitle$}
209 | $endif$
210 | $if(author)$
211 | \author{$for(author)$$author$$sep$ \and $endfor$}
212 | $endif$
213 | $if(institute)$
214 | \providecommand{\institute}[1]{}
215 | \institute{$for(institute)$$institute$$sep$ \and $endfor$}
216 | $endif$
217 | \date{$date$}
218 |
219 | \begin{document}
220 | $if(title)$
221 | \maketitle
222 | $endif$
223 | $if(abstract)$
224 | \begin{abstract}
225 | $abstract$
226 | \end{abstract}
227 | $endif$
228 |
229 | $for(include-before)$
230 | $include-before$
231 |
232 | $endfor$
233 | $if(toc)$
234 | {
235 | $if(colorlinks)$
236 | \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
237 | $endif$
238 | \setcounter{tocdepth}{$toc-depth$}
239 | \tableofcontents
240 | }
241 | $endif$
242 | $if(lot)$
243 | \listoftables
244 | $endif$
245 | $if(lof)$
246 | \listoffigures
247 | $endif$
248 | $body$
249 |
250 | $if(natbib)$
251 | $if(bibliography)$
252 | $if(biblio-title)$
253 | $if(book-class)$
254 | \renewcommand\bibname{$biblio-title$}
255 | $else$
256 | \renewcommand\refname{$biblio-title$}
257 | $endif$
258 | $endif$
259 | \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
260 |
261 | $endif$
262 | $endif$
263 | $if(biblatex)$
264 | \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
265 |
266 | $endif$
267 | $for(include-after)$
268 | $include-after$
269 |
270 | $endfor$
271 | \end{document}
272 |
--------------------------------------------------------------------------------
/report/static/ieee-with-url.csl:
--------------------------------------------------------------------------------
1 |
2 |
341 |
--------------------------------------------------------------------------------
/report/bin/pandocCommentFilter.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """
4 | From https://github.com/bwhelm/Pandoc-Comment-Filter
5 | """
6 |
7 | """
8 | Pandoc filter to extend pandoc's markdown to incorporate comment features and
9 | other things I find useful. With `draft: true` in the YAML header, comments and
10 | margin notes are displayed in red, and text that is highlighted or flagged with
11 | `fixme` is marked up in the output. With `draft: false` in the YAML header,
12 | comments and margin notes are not displayed at all, and highlightings and
13 | `fixme` mark ups are suppressed (though the text is displayed). Also provided
14 | are markup conventions for cross-references, index entries, and TikZ figures.
15 |
16 | Copyright (C) 2017 Bennett Helm
17 |
18 | This program is free software: you can redistribute it and/or modify
19 | it under the terms of the GNU General Public License as published by
20 | the Free Software Foundation, either version 3 of the License, or
21 | (at your option) any later version.
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
26 | You should have received a copy of the GNU General Public License
27 | along with this program. If not, see