diff --git a/html/slides.html b/html/slides.html new file mode 100644 index 0000000..722538e --- /dev/null +++ b/html/slides.html @@ -0,0 +1,326 @@ + + + + + + + Another simple slideshow + + + + + + + + + +
+
+ +
+

Another simple slideshow

+

Jeremie SUZAN

+
+ +
+

Outline

+
    +
  1. Some examples
  2. +
  3. Some code
  4. +
+
+ +
+

Some example

+
    +
  • I have made
  • +
  • this simple
  • +
  • bullet point list
  • +
+
+ +
+

Some code

+
import this
+
+for i in range(10):
+    print("Hello world")
+
+
+
+ + + + + + + + + + + + diff --git a/scripts/slides_to_html.sh b/scripts/slides_to_html.sh new file mode 100755 index 0000000..8c189be --- /dev/null +++ b/scripts/slides_to_html.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env bash +HIGHLIGHT_STYLE=tango +SLIDE_LEVEL=2 + +my_header=$(<./templates/html_header.md) +headEscapedForSed=${my_header//$'\n'/\\$'\n'} + +sed -e "s|SLIDEHEAD|$headEscapedForSed|g" slides.md | pandoc -s --mathjax -t revealjs -o html/slides.html --slide-level=$SLIDE_LEVEL --highlight-style=$HIGHLIGHT_STYLE -V revealjs-url=https://unpkg.com/reveal.js@5.0.0 --template=./templates/template.revealjs diff --git a/scripts/slides_to_pdf.sh b/scripts/slides_to_pdf.sh new file mode 100755 index 0000000..6036ca8 --- /dev/null +++ b/scripts/slides_to_pdf.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env bash +HIGHLIGHT_STYLE=tango +SLIDE_LEVEL=2 + +my_header=$(<./templates/pdf_header.md) +headEscapedForSed=${my_header//$'\n'/\\$'\n'} + +sed -e "s|SLIDEHEAD|$headEscapedForSed|g" slides.md | pandoc -t beamer -o slides.pdf --slide-level=$SLIDE_LEVEL --highlight-style=$HIGHLIGHT_STYLE -H ./templates/code-style.tex diff --git a/slides.md b/slides.md new file mode 100644 index 0000000..639ccfb --- /dev/null +++ b/slides.md @@ -0,0 +1,35 @@ +--- +title: "Another simple slideshow" +author: Jeremie SUZAN +date: "" +lang: fr-FR +toc: false +toc-depth: 2 +toc-title: Outline +fontsize: 10pt +weight: 10 +linestretch: 1.0 +section-titles: true +SLIDEHEAD +--- + +# Outline + +1. Some examples +2. Some code + + +# Some example + +- I have made +- this simple +- bullet point list + +# Some code + +```python +import this + +for i in range(10): + print("Hello world") +``` diff --git a/templates/code-style.tex b/templates/code-style.tex new file mode 100644 index 0000000..0619782 --- /dev/null +++ b/templates/code-style.tex @@ -0,0 +1,2 @@ + %\renewenvironment{Shaded} {\begin{snugshade}\footnotesize} {\end{snugshade}} + \renewenvironment{Shaded} {\begin{snugshade}\scriptsize} {\end{snugshade}} diff --git a/templates/html_header.md b/templates/html_header.md new file mode 100644 index 0000000..1467723 --- /dev/null +++ b/templates/html_header.md @@ -0,0 +1,6 @@ +theme: sky +width: 1824 +height: 1026 +maxScale: 0.85 +margin: 0.02 +progress: true diff --git a/templates/pdf_header.md b/templates/pdf_header.md new file mode 100644 index 0000000..7b93405 --- /dev/null +++ b/templates/pdf_header.md @@ -0,0 +1,5 @@ +theme: Hannover +colortheme: rose +linkstyle: underlined +listings: true +fonttheme: professionalfonts diff --git a/templates/template.beamer b/templates/template.beamer new file mode 100644 index 0000000..cc0edea --- /dev/null +++ b/templates/template.beamer @@ -0,0 +1,268 @@ +\documentclass[$if(aspectratio)$aspectratio=$aspectratio$,$endif$$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} +\setbeamertemplate{caption}[numbered] +\setbeamertemplate{caption label separator}{: } +\setbeamertemplate{section in toc}[sections numbered] +\setbeamercolor{caption name}{fg=normal text.fg} +\setbeamercolor{section in toc}{fg=white} +\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$ +\newcommand{\colA}[1]{\begin{columns}[t]\begin{column}{#1}} +\newcommand{\colB}[1]{\end{column}\begin{column}{#1}} +\newcommand{\colEnd}{\end{column}\end{columns}} +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$else$ +\usepackage{lmodern} +$endif$ +\usepackage{tikz} +\usepackage{pgfplots} +\newcommand\commit[2]{\node[commit] (#1) {}; \node[clabel] at (#1) {\texttt{#1}: #2};} +\newcommand\ghost[1]{\coordinate (#1);} +\newcommand\connect[2]{\path (#1) to[out=90,in=-90] (#2);} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{fixltx2e} % provides \textsubscript +\setbeamertemplate{footline}{\hspace{125mm}\insertframenumber\vspace{1mm}\hspace{10mm}} +%\setbeamertemplate{frame footer}{\tiny{$for(author)$$author$$sep$ \and $endfor$}} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} + \usepackage[utf8]{inputenc} +$if(euro)$ + \usepackage{eurosym} +$endif$ +\else % if luatex or xelatex + \ifxetex + \usepackage{mathspec} + \else + \usepackage{fontspec} + \fi + \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} +$if(euro)$ + \newcommand{\euro}{€} +$endif$ +$if(mainfont)$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$} +$endif$ +$if(mathfont)$ + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ +$if(CJKmainfont)$ + \usepackage{xeCJK} + \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} +$endif$ +\fi +$if(theme)$ +\usetheme{$theme$} +$endif$ +\setbeamertemplate{enumerate items}[default] +$if(colortheme)$ +\usecolortheme{$colortheme$} +$endif$ +$if(fonttheme)$ +\usefonttheme{$fonttheme$} +$endif$ +$if(mainfont)$ +\usefonttheme{serif} % use mainfont rather than sansfont for slide text +$endif$ +$if(innertheme)$ +\useinnertheme{$innertheme$} +$endif$ +$if(outertheme)$ +\useoutertheme{$outertheme$} +$endif$ +% use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +% use microtype if available +\IfFileExists{microtype.sty}{% +\usepackage{microtype} +\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +$if(lang)$ +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +$if(babel-newcommands)$ + $babel-newcommands$ +$endif$ +\else + \usepackage{polyglossia} + \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$} +$for(polyglossia-otherlangs)$ + \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} +$endfor$ +\fi +$endif$ +\newif\ifbibliography +$if(natbib)$ +\usepackage{natbib} +\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} +$endif$ +$if(biblatex)$ +\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex} +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +$endif$ +$if(listings)$ +\usepackage{listings} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +\VerbatimFootnotes % allows verbatim text in footnotes +$endif$ +$if(tables)$ +\usepackage{longtable,booktabs} +\usepackage{caption} +% These lines are needed to make table captions work with longtable: +\makeatletter +\def\fnum@table{\tablename~\thetable} +\makeatother +$endif$ +$if(graphics)$ +\usepackage{graphicx,grffile} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight0.8\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} +$endif$ + +% Prevent slide breaks in the middle of a paragraph: +\widowpenalties 1 10000 +\raggedbottom + +$if(section-titles)$ +\AtBeginPart{ + \let\insertpartnumber\relax + \let\partname\relax + \frame{\partpage} +} +\AtBeginSection{ + \ifbibliography + \else + \let\insertsectionnumber\relax + \let\sectionname\relax + \frame{\sectionpage} + \fi +} +\AtBeginSubsection{ + \let\insertsubsectionnumber\relax + \let\subsectionname\relax + \frame{\subsectionpage} +} +$endif$ + +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% avoid problems with \sout in headers with hyperref: +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +$if(numbersections)$ +\setcounter{secnumdepth}{5} +$else$ +\setcounter{secnumdepth}{0} +$endif$ +$if(dir)$ +\ifxetex + % load bidi as late as possible as it modifies e.g. graphicx + $if(latex-dir-rtl)$ + \usepackage[RTLdocument]{bidi} + $else$ + \usepackage{bidi} + $endif$ +\fi +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ + +$if(title)$ +\title{$title$} +$endif$ +$if(subtitle)$ +\subtitle{$subtitle$} +$endif$ +$if(author)$ +\author{$for(author)$$author$$sep$ \and $endfor$} +$endif$ +$if(institute)$ +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +\date{$date$} + +\begin{document} +$if(title)$ +\frame{\titlepage} +$endif$ + +$for(include-before)$ +$include-before$ + +$endfor$ +$if(toc)$ +$if(toc-title)$ +\begin{frame}{$toc-title$} +$else$ +\begin{frame}{Outline} +$endif$ +\tableofcontents[hideallsubsections] +\end{frame} + +$endif$ +$body$ + +$if(natbib)$ +$if(bibliography)$ +$if(biblio-title)$ +$if(book-class)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +\begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue +\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +\end{frame} + +$endif$ +$endif$ +$if(biblatex)$ +\begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue +\printbibliography[heading=none] +\end{frame} + +$endif$ +$for(include-after)$ +$include-after$ + +$endfor$ +\end{document} diff --git a/templates/template.revealjs b/templates/template.revealjs new file mode 100644 index 0000000..e4fe9fd --- /dev/null +++ b/templates/template.revealjs @@ -0,0 +1,324 @@ + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + + + + + + +$if(theme)$ + +$else$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ +$for(header-includes)$ + $header-includes$ +$endfor$ + + +$for(include-before)$ +$include-before$ +$endfor$ +
+
+ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$for(institute)$ +

$institute$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +$if(logo)$ + +$endif$ +
+$endif$ +$if(toc)$ +
+ +
+$endif$ + +$body$ +
+
+ + + + + + + +$if(mathjax)$ + +$endif$ + + + $for(include-after)$ + $include-after$ + $endfor$ + + diff --git a/watch_compile.sh b/watch_compile.sh new file mode 100755 index 0000000..d17db0e --- /dev/null +++ b/watch_compile.sh @@ -0,0 +1,20 @@ +#! /usr/bin/env bash + +script=./scripts/slides_to_pdf.sh +case $1 in + pdf) + script=./scripts/slides_to_pdf.sh + ;; + html) + script=./scripts/slides_to_pdf.sh + ;; +esac + +echo using $script + +$script +while [ 1 -eq 1 ] +do + inotifywait ./slides.md + $script +done