├── Makefile ├── README.md ├── dollar.py ├── images └── black.png ├── my.beamer └── slides.md /Makefile: -------------------------------------------------------------------------------- 1 | slides.tex: slides.md my.beamer 2 | pandoc -t beamer slides.md -o slides.tex --standalone --template=my.beamer --variable fontsize=8pt 3 | python dollar.py slides.tex slides.tex 4 | 5 | pdf: slides.tex 6 | pdflatex slides.tex 7 | 8 | publish: pdf 9 | scp slides.pdf LOCATION 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Slides 2 | ====== 3 | 4 | All the files you need to produce slides using Pandoc and Beamer 5 | 6 | Dependencies 7 | ------------ 8 | 9 | * [Pandoc](http://johnmacfarlane.net/pandoc/) 10 | * [Beamer](http://en.wikipedia.org/wiki/Beamer_%28LaTeX%29) 11 | 12 | Usage 13 | ----- 14 | 15 | 1. Edit [slides.md](slides.md) 16 | 2. `make pdf` 17 | -------------------------------------------------------------------------------- /dollar.py: -------------------------------------------------------------------------------- 1 | from sys import argv 2 | 3 | if not len(argv) == 3: 4 | print "Usage: python %s infile outfile" % argv[0] 5 | exit(0) 6 | 7 | with open(argv[1]) as infile: 8 | s = infile.read() 9 | 10 | s = s.replace(r"\$", "$") 11 | 12 | with open(argv[2], 'w') as outfile: 13 | outfile.write(s) 14 | -------------------------------------------------------------------------------- /images/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrocklin/slides/5c7f324b643398c41d3d5fb4c19d4555d1e552ef/images/black.png -------------------------------------------------------------------------------- /my.beamer: -------------------------------------------------------------------------------- 1 | \documentclass[$if(fontsize)$$fontsize$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$]{$documentclass$} 2 | $if(theme)$ 3 | \usetheme{$theme$} 4 | $endif$ 5 | $if(colortheme)$ 6 | \usecolortheme{$colortheme$} 7 | $endif$ 8 | \usepackage{amssymb,amsmath} 9 | \usepackage{ifxetex,ifluatex} 10 | \usepackage{fixltx2e} % provides \textsubscript 11 | \ifxetex 12 | \usepackage{fontspec,xltxtra,xunicode} 13 | \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 14 | \else 15 | \ifluatex 16 | \usepackage{fontspec} 17 | \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 18 | \else 19 | \usepackage[utf8]{inputenc} 20 | \fi 21 | \fi 22 | $if(natbib)$ 23 | \usepackage{natbib} 24 | \bibliographystyle{plainnat} 25 | $endif$ 26 | $if(biblatex)$ 27 | \usepackage{biblatex} 28 | $if(biblio-files)$ 29 | \bibliography{$biblio-files$} 30 | $endif$ 31 | $endif$ 32 | $if(listings)$ 33 | \usepackage{listings} 34 | $endif$ 35 | $if(lhs)$ 36 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} 37 | $endif$ 38 | $if(highlighting-macros)$ 39 | $highlighting-macros$ 40 | $endif$ 41 | $if(verbatim-in-note)$ 42 | \usepackage{fancyvrb} 43 | $endif$ 44 | $if(fancy-enums)$ 45 | \usepackage{enumerate} 46 | $endif$ 47 | $if(tables)$ 48 | \usepackage{ctable} 49 | \usepackage{float} % provides the H option for float placement 50 | $endif$ 51 | $if(url)$ 52 | \usepackage{url} 53 | $endif$ 54 | $if(graphics)$ 55 | \usepackage{graphicx} 56 | \makeatletter 57 | \def\ScaleIfNeeded{% 58 | \ifdim\Gin@nat@width>\linewidth 59 | \linewidth 60 | \else 61 | \Gin@nat@width 62 | \fi 63 | } 64 | \makeatother 65 | \setkeys{Gin}{width=\ScaleIfNeeded} 66 | $endif$ 67 | % Comment these out if you don't want a slide with just the 68 | % part/section/subsection/subsubsection title: 69 | \AtBeginPart{\frame{\partpage}} 70 | \AtBeginSection{\frame{\sectionpage}} 71 | \AtBeginSubsection{\frame{\subsectionpage}} 72 | \AtBeginSubsubsection{\frame{\subsubsectionpage}} 73 | $if(strikeout)$ 74 | \usepackage[normalem]{ulem} 75 | % avoid problems with \sout in headers with hyperref: 76 | \pdfstringdefDisableCommands{\renewcommand{\sout}{}} 77 | $endif$ 78 | \setlength{\parindent}{0pt} 79 | \setlength{\parskip}{6pt plus 2pt minus 1pt} 80 | \setlength{\emergencystretch}{3em} % prevent overfull lines 81 | $if(numbersections)$ 82 | $else$ 83 | \setcounter{secnumdepth}{0} 84 | $endif$ 85 | $if(verbatim-in-note)$ 86 | \VerbatimFootnotes % allows verbatim text in footnotes 87 | $endif$ 88 | $if(lang)$ 89 | \usepackage[$lang$]{babel} 90 | $endif$ 91 | $for(header-includes)$ 92 | $header-includes$ 93 | $endfor$ 94 | 95 | $if(title)$ 96 | \title{$title$} 97 | $endif$ 98 | $if(author)$ 99 | \author{$for(author)$$author$$sep$ \and $endfor$} 100 | $endif$ 101 | $if(date)$ 102 | \date{$date$} 103 | $endif$ 104 | 105 | \begin{document} 106 | $if(title)$ 107 | \frame{\titlepage} 108 | $endif$ 109 | 110 | $for(include-before)$ 111 | $include-before$ 112 | 113 | $endfor$ 114 | $if(toc)$ 115 | \begin{frame} 116 | \tableofcontents[hideallsubsections] 117 | \end{frame} 118 | 119 | $endif$ 120 | $body$ 121 | 122 | $if(natbib)$ 123 | $if(biblio-files)$ 124 | $if(biblio-title)$ 125 | $if(book-class)$ 126 | \renewcommand\bibname{$biblio-title$} 127 | $else$ 128 | \renewcommand\refname{$biblio-title$} 129 | $endif$ 130 | $endif$ 131 | \bibliography{$biblio-files$} 132 | 133 | $endif$ 134 | $endif$ 135 | $if(biblatex)$ 136 | \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ 137 | 138 | $endif$ 139 | $for(include-after)$ 140 | $include-after$ 141 | 142 | $endfor$ 143 | \end{document} 144 | -------------------------------------------------------------------------------- /slides.md: -------------------------------------------------------------------------------- 1 | % TITLE 2 | % AUTHOR 3 | % DATE 4 | 5 | Slide Title 6 | ----------- 7 | 8 | Text 9 | 10 | Code 11 | ---- 12 | 13 | ~~~~~~~~~C 14 | int main() 15 | { 16 | printf("Hello, world!\n"); 17 | return 0; 18 | } 19 | ~~~~~~~~~ 20 | 21 | List 22 | ----- 23 | 24 | * Item 1 25 | * Item 2 26 | * Item 3 27 | 28 | Math 29 | ---- 30 | 31 | $$ \int_0^1 x^2 dx = \frac{x^3}{3} $$ 32 | 33 | Figure 34 | ------ 35 | 36 | \begin{figure}[htbp] 37 | \centering 38 | \includegraphics[width=.9\textwidth]{images/black.png} 39 | \end{figure} 40 | 41 | End 42 | --- 43 | 44 | Thanks! 45 | --------------------------------------------------------------------------------