# New section
## New slides
* Candy.
* Gum.
* Booze.
- Candy.
- Gum.
- Booze.
1. Red
2. Green
3. Blue
This link points to [Google](http://www.google.de).
This link points to Google.
- normal text
- *single asterisks*
- **double asterisks**
````
function addTwo(x)
return x+2
end
````
function addTwo(x)
return x+2
end
"If you need to convert files from one markup format into another, pandoc is your swiss-army knife."
What for?
On windows:
On Linux:
In project directory:
git clone https://github.com/hakimel/reveal.js.git
Starting small:
pandoc -t revealjs -f markdown \
-o output/content.slides.html src/content.md
Add -s
option for standalone html file:
pandoc -s -t revealjs -f markdown \
-o output/content.slides.html src/content.md
Inspect element
pandoc -s -V revealjs-url=../reveal.js -t revealjs \
-f markdown -o output/content.slides.html src/content.md
reveal.min.js
and reveal.min.css
cd reveal.js/js
ln -s reveal.js reveal.min.js
cd ../css
ln -s reveal.css reveal.min.css
Better solution for setting paths:
use customized pandoc template files
git clone https://github.com/cgroll/pandoc_custom.git
or as git subtree:
git subtree add --prefix pandoc_custom \
https://github.com/cgroll/pandoc_custom.git master --squash
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
-o output/content.slides.html src/content.md
$$
\gamma(n)=\sum_{i=1}^{n}x^{2}
$$
git clone https://github.com/mathjax/MathJax.git
⇒ configure MathJax
to correctly render formulas
<!-- include local MathJax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
scale: 80,
},
extensions: ["tex2jax.js"],
TeX: { equationNumbers: { autoNumber: "AMS" } },
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$$","$$"],["\\(","\\)"]]}});
</script>
<script type="text/javascript" src="../MathJax/MathJax.js"></script>
⇒ set MathJax path according to your needs!
$$\alpha^{2} = \beta^{2}$$
α2 = β2
html
and pdf
outputlabeled and numbered equation, html:
$$\begin{equation}
\alpha = \beta
\label{eq:sample}
\end{equation}$$
same formula for pdf output:
\begin{equation}
\alpha = \beta
\label{eq:sample}
\end{equation}
pandoc -t native src/content.md -o output/content_native.txt
,Para [Math DisplayMath "\\begin{equation}\n\\alpha = \\beta\n\\label{eq:sample}\n\\end{equation}"]
,RawBlock (Format "latex") "\\begin{equation}\n\\alpha = \\beta\n\\label{eq:sample}\n\\end{equation}"
⇒ convert RawBlock to Math DisplayMath for html output
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc_custom/filters/amsmath.hs \
-o output/content.slides.html src/content.md
⇒ writing equations without $$
\begin{equation}
\alpha = \beta
\label{eq:sample}
\end{equation}
\begin{equation}
\begin{split}
\gamma(n)&=\sum_{i=1}^{n}x^{2}\\
&=\sum_{i=1}^{n}x\cdot x
\end{split}
\label{eq:splitSample}
\end{equation}
\begin{align}
\gamma(n)&=\sum_{i=1}^{n}x^{2}\\
&=\sum_{i=1}^{n}x\cdot x
\label{eq:alignedSample}
\end{align}
Referring to equations $\eqref{eq:sample}$, $\eqref{eq:splitSample}$
and $\eqref{eq:alignedSample}$.
Referring to equations $\eqref{eq:sample}$, $\eqref{eq:splitSample}$ and $\eqref{eq:alignedSample}$.
tex
file
pandoc -t latex -f markdown -s -o output/content.tex
Theorem environments: AphoFilters
"a library for rendering bibliographic reference citations into a variety of styles using a macro language called Citation Style Language (CSL)"
sudo apt-get install pandoc-citeproc
@article{citeulike:1232469,
author = {Rubinstein, Mark},
citeulike-article-id = {1232469},
citeulike-linkout-0 = {http://www.jstor.org/stable/2697771},
journal = {The Journal of Finance},
number = {3},
pages = {1041--1045},
posted-at = {2007-04-17 17:49:48},
priority = {0},
title = {{Markowitz's \"Portfolio Selection\";: A Fifty-Year Retrospective}},
url = {http://www.jstor.org/stable/2697771},
volume = {57},
year = {2002}
}
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o output/content.slides.html src/content.md
... according to [@citeulike:1232469].
Output: ... according to (Rubinstein, 2002).
Still remember [the pandoc introduction](#pandoc)?
Output: Still remember the pandoc introduction?
You could also circumvent raw LaTeX with:
Starting small
bash script: create file export.sh
with content
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o output/content.slides.html src/content.md
call script with
sh export.sh
Wishful improvements:
⇒ use a Makefile
conditional execution: command is executed, if
syntax:
target: dependency1 dependency2
target rule
pandoc slide creation:
output/content.slides.html: src/content.md Makefile refs.bib
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o output/content.slides.html src/content.md
you can build individual targets by calling Make
on them:
make output/content.slides.html
Make
automatically builds the first target appearing in a Makefile
output/content.pdf: src/content.md Makefile refs.bib
pandoc -s -t beamer -f markdown \
--slide-level=2 \
-V theme=CambridgeUS -V colortheme=dolphin \
-V header-includes=\\hypersetup{colorlinks\=true} \
-V header-includes=\\hypersetup{urlcolor\=blue} \
-V header-includes=\\hypersetup{linkcolor\=blue} \
-V header-includes=\\usepackage{hyperref} \
-V urlcolor=blue \
-V linkcolor=blue \
--mathjax \
--filter pandoc_custom/filters/skip_pause.hs \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o output/content.pdf src/content.md
⇒ shortcuts: automatic variables
$@
represents target$<
represents first dependencyoutput/content.pdf: src/content.md Makefile refs.bib
pandoc -s -t beamer -f markdown \
--slide-level=2 \
-V theme=CambridgeUS -V colortheme=dolphin \
-V header-includes=\\hypersetup{colorlinks\=true} \
-V header-includes=\\hypersetup{urlcolor\=blue} \
-V header-includes=\\hypersetup{linkcolor\=blue} \
-V header-includes=\\usepackage{hyperref} \
-V urlcolor=blue \
-V linkcolor=blue \
--mathjax \
--filter pandoc_custom/filters/skip_pause.hs \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o $@ $<
all: output/content.pdf output/content.slides.html
⇒ use variables
OUTDIR = output
$(OUTDIR)/content.slides.html: src/content.md Makefile refs.bib
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o $@ $<
$(OUTDIR)/*.slides.html: src/*.md Makefile refs.bib
pandoc --template=pandoc_custom/templates/revealjs.template \
-s -V revealjs-url=../reveal.js -t revealjs -f markdown \
--filter pandoc-citeproc --csl=pandoc_custom/csl/elsevier-harvard.csl \
--bibliography=refs.bib \
-o $@ $<
Rubinstein, M., 2002. Markowitz’s “Portfolio Selection”: A Fifty-Year Retrospective. The Journal of Finance 57, 1041–1045.