diff --git a/art/Breadboard+switch+pot+leds.fzz b/art/Breadboard+switch+pot+leds.fzz new file mode 100644 index 0000000..05625c8 Binary files /dev/null and b/art/Breadboard+switch+pot+leds.fzz differ diff --git a/art/Breadboard+switch+pot.fzz b/art/Breadboard+switch+pot.fzz new file mode 100644 index 0000000..d47e8eb Binary files /dev/null and b/art/Breadboard+switch+pot.fzz differ diff --git a/art/Breadboard+switch.fzz b/art/Breadboard+switch.fzz new file mode 100644 index 0000000..89e3343 Binary files /dev/null and b/art/Breadboard+switch.fzz differ diff --git a/presentations/arduino-intro-2016/.gitignore b/presentations/arduino-intro-2016/.gitignore new file mode 100644 index 0000000..b588b50 --- /dev/null +++ b/presentations/arduino-intro-2016/.gitignore @@ -0,0 +1,7 @@ +main.aux +main.log +main.nav +main.out +main.snm +main.toc +talk.tex diff --git a/presentations/arduino-intro-2016/Makefile b/presentations/arduino-intro-2016/Makefile new file mode 100644 index 0000000..ab774e7 --- /dev/null +++ b/presentations/arduino-intro-2016/Makefile @@ -0,0 +1,27 @@ +SOURCES=$(wildcard *.md) +PDFS=$(SOURCES:.md=.pdf) + +all: $(PDFS) + +%.pdf: $(SOURCES) + pandoc --slide-level 2 -t beamer -V theme:metropolis --template template.tex $(@:.pdf=.md) -o $@ + gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH \ + -sOutputFile=$(@:.pdf=.ebook.pdf) $@ + +clean: + rm -f *.pdf + +live: $(PDFS) + evince $(PDFS) & + while /bin/true; do inotifywait $(SOURCES); make all; done + +present: setup-projector $(PDFS) + pdfpc $(PDFS) + make disable-projector + +setup-projector: + xrandr --output VGA1 --above LVDS1 --auto + +disable-projector: + xrandr --output VGA1 --off + diff --git a/presentations/arduino-intro-2016/beamercolorthememetropolis.sty b/presentations/arduino-intro-2016/beamercolorthememetropolis.sty new file mode 100644 index 0000000..6b23f8d --- /dev/null +++ b/presentations/arduino-intro-2016/beamercolorthememetropolis.sty @@ -0,0 +1,133 @@ +%% +%% This is file `beamercolorthememetropolis.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% beamercolorthememetropolis.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamercolorthememetropolis}[2016/03/14 Metropolis color theme] +\RequirePackage{pgfopts} +\pgfkeys{ + /metropolis/color/block/.cd, + .is choice, + transparent/.code=\metropolis@block@transparent, + fill/.code=\metropolis@block@fill, +} +\pgfkeys{ + /metropolis/color/background/.cd, + .is choice, + dark/.code=\metropolis@colors@dark, + light/.code=\metropolis@colors@light, +} +\newcommand{\metropolis@color@setdefaults}{ + \pgfkeys{/metropolis/color/.cd, + background=light, + block=transparent, + } +} +\definecolor{mDarkBrown}{HTML}{604c38} +\definecolor{mDarkTeal}{HTML}{23373b} +\definecolor{mLightBrown}{HTML}{EB811B} +\definecolor{mLightGreen}{HTML}{14B03D} +\newcommand{\metropolis@colors@dark}{ + \setbeamercolor{normal text}{% + fg=black!2, + bg=mDarkTeal + } +} +\newcommand{\metropolis@colors@light}{ + \setbeamercolor{normal text}{% + fg=mDarkTeal, + bg=black!2 + } +} +\setbeamercolor{alerted text}{% + fg=mLightBrown +} +\setbeamercolor{example text}{% + fg=mLightGreen +} +\setbeamercolor{titlelike}{use=normal text, parent=normal text} +\setbeamercolor{author}{use=normal text, parent=normal text} +\setbeamercolor{date}{use=normal text, parent=normal text} +\setbeamercolor{institute}{use=normal text, parent=normal text} +\setbeamercolor{structure}{use=normal text, fg=normal text.fg} +\setbeamercolor{palette primary}{% + use=normal text, + fg=normal text.bg, + bg=normal text.fg +} +\setbeamercolor{frametitle}{% + use=palette primary, + parent=palette primary +} +\setbeamercolor{progress bar}{% + use=alerted text, + fg=alerted text.fg, + bg=alerted text.fg!50!black!30 +} +\setbeamercolor{title separator}{ + use=progress bar, + parent=progress bar +} +\setbeamercolor{progress bar in head/foot}{% + use=progress bar, + parent=progress bar +} +\setbeamercolor{progress bar in section page}{ + use=progress bar, + parent=progress bar +} +\newcommand{\metropolis@block@transparent}{ + \setbeamercolor{block title}{% + use=normal text, + fg=normal text.fg, + bg= + } + \setbeamercolor{block body}{ + bg= + } +} +\newcommand{\metropolis@block@fill}{ + \setbeamercolor{block title}{% + use=normal text, + fg=normal text.fg, + bg=normal text.bg!80!fg + } + \setbeamercolor{block body}{ + use={block title, normal text}, + bg=block title.bg!50!normal text.bg + } +} +\setbeamercolor{block title alerted}{% + use={block title, alerted text}, + bg=block title.bg, + fg=alerted text.fg +} +\setbeamercolor{block title example}{% + use={block title, example text}, + bg=block title.bg, + fg=example text.fg +} +\setbeamercolor{block body alerted}{use=block body, parent=block body} +\setbeamercolor{block body example}{use=block body, parent=block body} +\setbeamercolor{footnote}{fg=normal text.fg!90} +\setbeamercolor{footnote mark}{fg=.} +\metropolis@color@setdefaults +\ProcessPgfPackageOptions{/metropolis/color} +\mode +\endinput +%% +%% End of file `beamercolorthememetropolis.sty'. diff --git a/presentations/arduino-intro-2016/beamerfontthememetropolis.sty b/presentations/arduino-intro-2016/beamerfontthememetropolis.sty new file mode 100644 index 0000000..8ecd167 --- /dev/null +++ b/presentations/arduino-intro-2016/beamerfontthememetropolis.sty @@ -0,0 +1,283 @@ +%% +%% This is file `beamerfontthememetropolis.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% beamerfontthememetropolis.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamerfontthememetropolis}[2016/03/14 Metropolis font theme] +\RequirePackage{etoolbox} +\RequirePackage{ifxetex} +\RequirePackage{ifluatex} +\RequirePackage{pgfopts} +\ifboolexpr{bool {xetex} or bool {luatex}}{ + \RequirePackage[no-math]{fontspec} + \newcounter{fontsnotfound} + \newcommand{\checkfont}[1]{% + \suppressfontnotfounderror=1% + \font\x = "#1" at 10pt + \selectfont + \ifx\x\nullfont% + \stepcounter{fontsnotfound}% + \fi% + \suppressfontnotfounderror=0% + } + + \newcommand{\iffontsavailable}[3]{% + \setcounter{fontsnotfound}{0}% + \expandafter\forcsvlist\expandafter% + \checkfont\expandafter{#1}% + \ifnum\value{fontsnotfound}=0% + #2% + \else% + #3% + \fi% + } + \iffontsavailable{Fira Sans Light,% + Fira Sans Light Italic,% + Fira Sans,% + Fira Sans Italic}% + {% + \setsansfont[ItalicFont={Fira Sans Light Italic},% + BoldFont={Fira Sans},% + BoldItalicFont={Fira Sans Italic}]% + {Fira Sans Light}% + }{% + \iffontsavailable{Fira Sans Light OT,% + Fira Sans Light Italic OT,% + Fira Sans OT,% + Fira Sans Italic OT}% + {% + \setsansfont[ItalicFont={Fira Sans Light Italic OT},% + BoldFont={Fira Sans OT},% + BoldItalicFont={Fira Sans Italic OT}]% + {Fira Sans Light OT}% + }{% + \PackageWarning{beamerthememetropolis}{% + Could not find Fira Sans fonts% + } + } + } + \iffontsavailable{Fira Mono, Fira Mono Bold}{% + \setmonofont[BoldFont={Fira Mono Medium}]{Fira Mono}% + }{% + \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{% + \setmonofont[BoldFont={Fira Mono Medium OT}]{Fira Mono OT}% + }{% + \PackageWarning{beamerthememetropolis}{% + Could not find Fira Mono fonts% + } + } + } + \AtBeginEnvironment{tabular}{% + \addfontfeature{Numbers={Monospaced}}% + } +}{% + \PackageWarning{beamerthememetropolis}{% + You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts% + } +} +\setbeamerfont{title}{size=\Large,% + series=\bfseries} +\setbeamerfont{author}{size=\small} +\setbeamerfont{date}{size=\small} +\setbeamerfont{section title}{size=\Large,% + series=\bfseries} +\setbeamerfont{block title}{size=\normalsize,% + series=\bfseries} +\setbeamerfont{block title alerted}{size=\normalsize,% + series=\bfseries} +\setbeamerfont*{subtitle}{size=\large} +\setbeamerfont{frametitle}{size=\large,% + series=\bfseries} +\setbeamerfont{caption}{size=\small} +\setbeamerfont{caption name}{series=\bfseries} +\setbeamerfont{description item}{series=\bfseries} +\setbeamerfont{page number in head/foot}{size=\scriptsize} +\setbeamerfont{bibliography entry author}{size=\normalsize,% + series=\normalfont} +\setbeamerfont{bibliography entry title}{size=\normalsize,% + series=\bfseries} +\setbeamerfont{bibliography entry location}{size=\normalsize,% + series=\normalfont} +\setbeamerfont{bibliography entry note}{size=\small,% + series=\normalfont} +\setbeamerfont{standout}{size=\Large,% + series=\bfseries} +\pgfkeys{ + /metropolis/font/titleformat title/.cd, + .is choice, + regular/.code={% + \let\metropolis@titleformat\@empty% + \setbeamerfont{title}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@titleformat\@empty% + \setbeamerfont{title}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@titleformat\lowercase% + \setbeamerfont{title}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat title=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@titleformat\uppercase% + \setbeamerfont{title}{shape=\normalfont} + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat title=allcaps can lead to problems% + } + }, +} +\pgfkeys{ + /metropolis/font/titleformat subtitle/.cd, + .is choice, + regular/.code={% + \let\metropolis@subtitleformat\@empty% + \setbeamerfont{subtitle}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@subtitleformat\@empty% + \setbeamerfont{subtitle}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@subtitleformat\lowercase% + \setbeamerfont{subtitle}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat subtitle=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@subtitleformat\uppercase% + \setbeamerfont{subtitle}{shape=\normalfont}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat subtitle=allcaps can lead to problems% + } + }, +} +\pgfkeys{ + /metropolis/font/titleformat section/.cd, + .is choice, + regular/.code={% + \let\metropolis@sectiontitleformat\@empty% + \setbeamerfont{section title}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@sectiontitleformat\@empty% + \setbeamerfont{section title}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@sectiontitleformat\MakeLowercase% + \setbeamerfont{section title}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat section=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@sectiontitleformat\MakeUppercase% + \setbeamerfont{section title}{shape=\normalfont}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat section=allcaps can lead to problems% + } + }, +} +\pgfkeys{ + /metropolis/font/titleformat frame/.cd, + .is choice, + regular/.code={% + \let\metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@frametitleformat\MakeLowercase% + \setbeamerfont{frametitle}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@frametitleformat\MakeUppercase% + \setbeamerfont{frametitle}{shape=\normalfont} + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allcaps can lead to problems% + } + }, +} +\pgfkeys{ + /metropolis/font/.cd, + titleformattitle/.code=\pgfkeysalso{titleformat title=#1}, + titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1}, + titleformatsection/.code=\pgfkeysalso{titleformat section=#1}, + titleformatframe/.code=\pgfkeysalso{titleformat frame=#1}, +} +\newcommand{\metropolis@font@setdefaults}{ + \pgfkeys{/metropolis/font/.cd, + titleformat title=regular, + titleformat subtitle=regular, + titleformat section=regular, + titleformat frame=regular, + } +} +\def\metropolis@titleformat#1{#1} +\def\metropolis@subtitleformat#1{#1} +\def\metropolis@sectiontitleformat#1{#1} +\def\metropolis@frametitleformat#1{#1} +\patchcmd{\beamer@title}% + {\def\inserttitle{#2}}% + {\def\inserttitle{\metropolis@titleformat{#2}}}% + {}% + {\PackageError{beamerfontthememetropolis}{Patching title failed}} +\patchcmd{\beamer@subtitle}% + {\def\insertsubtitle{#2}}% + {\def\insertsubtitle{\metropolis@subtitleformat{#2}}}% + {}% + {\PackageError{beamerfontthememetropolis}{Patching subtitle failed}} +\patchcmd{\sectionentry} + {\def\insertsectionhead{#2}} + {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}} + {} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}} +\patchcmd{\beamer@section} + {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} + {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{% + \metropolis@sectiontitleformat{#1}}}} + {} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}} +\patchcmd{\beamer@@frametitle} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum% + \beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {} + {\PackageError{beamerfontthememetropolis}{Patching frame title failed}} +\metropolis@font@setdefaults +\ProcessPgfPackageOptions{/metropolis/font} +\endinput +%% +%% End of file `beamerfontthememetropolis.sty'. diff --git a/presentations/arduino-intro-2016/beamerinnerthememetropolis.sty b/presentations/arduino-intro-2016/beamerinnerthememetropolis.sty new file mode 100644 index 0000000..8adb1fb --- /dev/null +++ b/presentations/arduino-intro-2016/beamerinnerthememetropolis.sty @@ -0,0 +1,281 @@ +%% +%% This is file `beamerinnerthememetropolis.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% beamerinnerthememetropolis.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamerinnerthememetropolis}[2016/03/14 Metropolis inner theme] +\RequirePackage{etoolbox} +\RequirePackage{keyval} +\RequirePackage{calc} +\RequirePackage{pgfopts} +\RequirePackage{tikz} +\pgfkeys{ + /metropolis/inner/sectionpage/.cd, + .is choice, + none/.code=\metropolis@disablesectionpage, + simple/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[progressbar]}, +} +\pgfkeys{ + /metropolis/inner/subsectionpage/.cd, + .is choice, + none/.code=\metropolis@disablesubsectionpage, + simple/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[progressbar]}, +} +\newcommand{\metropolis@inner@setdefaults}{ + \pgfkeys{/metropolis/inner/.cd, + sectionpage=progressbar, + subsectionpage=none + } +} +\setbeamertemplate{title page}{ + \begin{minipage}[b][\paperheight]{\textwidth} + \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi + \vfill% + \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi + \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi + \usebeamertemplate*{title separator} + \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi + \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi + \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi + \vfill + \vspace*{1mm} + \end{minipage} +} +\def\maketitle{% + \ifbeamer@inframe + \titlepage + \else + \frame[plain,noframenumbering]{\titlepage} + \fi +} +\def\titlepage{% + \usebeamertemplate{title page} +} +\setbeamertemplate{title graphic}{ + \vbox to 0pt { + \vspace*{2em} + \inserttitlegraphic% + }% + \nointerlineskip% +} +\setbeamertemplate{title}{ + \raggedright% + \linespread{1.0}% + \inserttitle% + \par% + \vspace*{0.5em} +} +\setbeamertemplate{subtitle}{ + \insertsubtitle% + \par% + \vspace*{0.5em} +} +\setbeamertemplate{title separator}{ + \begin{tikzpicture} + \fill[fg] (0,0) rectangle (\textwidth, 0.4pt); + \end{tikzpicture}% + \par% +} +\setbeamertemplate{author}{ + \vspace*{2em} + \insertauthor% + \par% + \vspace*{0.25em} +} +\setbeamertemplate{date}{ + \insertdate% + \par% +} +\setbeamertemplate{institute}{ + \vspace*{3mm} + \insertinstitute% + \par% +} +\defbeamertemplate{section page}{simple}{ + \begin{center} + \usebeamercolor[fg]{section title} + \usebeamerfont{section title} + \insertsectionhead\par + \ifx\insertsubsection\@empty\else + \usebeamercolor[fg]{subsection title} + \usebeamerfont{subsection title} + \insertsubsection + \fi + \end{center} +} +\defbeamertemplate{section page}{progressbar}{ + \centering + \begin{minipage}{22em} + \raggedright + \usebeamercolor[fg]{section title} + \usebeamerfont{section title} + \insertsectionhead\\[-1ex] + \usebeamertemplate*{progress bar in section page} + \par + \ifx\insertsubsection\@empty\else% + \usebeamercolor[fg]{subsection title}% + \usebeamerfont{subsection title}% + \insertsubsection + \fi + \end{minipage} + \par + \vspace{\baselineskip} +} +\newcommand{\metropolis@disablesectionpage}{ + \AtBeginSection{ + % intentionally empty + } +} +\newcommand{\metropolis@enablesectionpage}{ + \AtBeginSection{ + \ifbeamer@inframe + \sectionpage + \else + \frame[plain,c,noframenumbering]{\sectionpage} + \fi + } +} +\setbeamertemplate{subsection page}{% + \usebeamertemplate*{section page} +} +\newcommand{\metropolis@disablesubsectionpage}{ + \AtBeginSubsection{ + % intentionally empty + } +} +\newcommand{\metropolis@enablesubsectionpage}{ + \AtBeginSubsection{ + \ifbeamer@inframe + \subsectionpage + \else + \frame[plain,c,noframenumbering]{\subsectionpage} + \fi + } +} +\newlength{\metropolis@progressonsectionpage} +\setbeamertemplate{progress bar in section page}{ + \setlength{\metropolis@progressonsectionpage}{% + \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}% + }% + \begin{tikzpicture} + \fill[bg] (0,0) rectangle (\textwidth, 0.4pt); + \fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, 0.4pt); + \end{tikzpicture}% +} +\def\inserttotalframenumber{100} +\newlength{\metropolis@blocksep} +\newlength{\metropolis@blockadjust} +\setlength{\metropolis@blocksep}{0.75ex} +\setlength{\metropolis@blockadjust}{0.25ex} +\providecommand{\metropolis@strut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}% +} +\newcommand{\metropolis@block}[1]{ + \par\vskip\medskipamount% + \setlength{\parskip}{0pt} + \ifbeamercolorempty[bg]{block title#1}{% + \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{% + \ifbeamercolorempty[bg]{block title}{% + \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}% + }% + {% + \begin{beamercolorbox}[ + sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax, + leftskip=\metropolis@blockadjust, + rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax + ]{block title#1}% + }}% + \usebeamerfont*{block title#1}% + \metropolis@strut% + \insertblocktitle% + \metropolis@strut% + \end{beamercolorbox}% + \nointerlineskip% + \ifbeamercolorempty[bg]{block body#1}{% + \begin{beamercolorbox}[vmode]{block body#1}}{ + \ifbeamercolorempty[bg]{block body}{% + \begin{beamercolorbox}[vmode]{block body#1}% + }{% + \begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}% + \vspace{-\metropolis@parskip} + }}% + \usebeamerfont{block body#1}% + \setlength{\parskip}{\metropolis@parskip}% +} +\setbeamertemplate{block begin}{\metropolis@block{}} +\setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}} +\setbeamertemplate{block example begin}{\metropolis@block{ example}} +\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}} +\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}} +\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}} +\setbeamertemplate{itemize items}{\textbullet} +\setbeamertemplate{caption label separator}{: } +\setbeamertemplate{caption}[numbered] +\setbeamertemplate{footnote}{% + \parindent 0em\noindent% + \raggedright + \usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par% +} +\newlength{\metropolis@parskip} +\setlength{\metropolis@parskip}{0.5em} +\setlength{\parskip}{\metropolis@parskip} +\linespread{1.15} +\define@key{beamerframe}{c}[true]{% centered + \beamer@frametopskip=0pt plus 1fill\relax% + \beamer@framebottomskip=0pt plus 1fill\relax% + \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax% + \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax% + \def\beamer@initfirstlineunskip{}% +} +\providebool{metropolis@standout} +\define@key{beamerframe}{standout}[true]{% + \booltrue{metropolis@standout} + \begingroup + \setkeys{beamerframe}{c} + \setkeys{beamerframe}{noframenumbering} + \ifbeamercolorempty[bg]{palette primary}{ + \setbeamercolor{background canvas}{ + use=palette primary, + bg=-palette primary.fg + } + }{ + \setbeamercolor{background canvas}{ + use=palette primary, + bg=palette primary.bg + } + } + \centering + \usebeamercolor[fg]{palette primary} + \usebeamerfont{standout} +} + \apptocmd{\beamer@reseteecodes}{% + \ifbool{metropolis@standout}{ + \endgroup + \boolfalse{metropolis@standout} + }{} + }{}{} +\metropolis@inner@setdefaults +\ProcessPgfPackageOptions{/metropolis/inner} +\endinput +%% +%% End of file `beamerinnerthememetropolis.sty'. diff --git a/presentations/arduino-intro-2016/beamerouterthememetropolis.sty b/presentations/arduino-intro-2016/beamerouterthememetropolis.sty new file mode 100644 index 0000000..c49893a --- /dev/null +++ b/presentations/arduino-intro-2016/beamerouterthememetropolis.sty @@ -0,0 +1,126 @@ +%% +%% This is file `beamerouterthememetropolis.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% beamerouterthememetropolis.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamerouterthememetropolis}[2016/03/14 Metropolis outer theme] +\RequirePackage{etoolbox} +\RequirePackage{calc} +\RequirePackage{pgfopts} +\pgfkeys{ + /metropolis/outer/numbering/.cd, + .is choice, + none/.code=\setbeamertemplate{frame numbering}[none], + counter/.code=\setbeamertemplate{frame numbering}[counter], + fraction/.code=\setbeamertemplate{frame numbering}[fraction], +} +\pgfkeys{ + /metropolis/outer/progressbar/.cd, + .is choice, + none/.code={% + \setbeamertemplate{headline}[plain] + \setbeamertemplate{frametitle}[plain] + \setbeamertemplate{footline}[plain] + }, + head/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{headline}{}{% + \usebeamertemplate*{progress bar in head/foot} + } + }, + frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{frametitle}{}{% + \usebeamertemplate*{progress bar in head/foot} + } + }, + foot/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{footline}{}{% + \usebeamertemplate*{progress bar in head/foot}% + } + }, +} +\newcommand{\metropolis@outer@setdefaults}{ + \pgfkeys{/metropolis/outer/.cd, + numbering=counter, + progressbar=none, + } +} +\setbeamertemplate{navigation symbols}{} +\defbeamertemplate{frame footer}{none}{} +\defbeamertemplate{frame footer}{custom}[1]{ #1 } +\defbeamertemplate{frame numbering}{none}{} +\defbeamertemplate{frame numbering}{counter}{\insertframenumber} +\defbeamertemplate{frame numbering}{fraction}{ + \insertframenumber/\inserttotalframenumber +} +\defbeamertemplate{headline}{plain}{} +\defbeamertemplate{footline}{plain}{% + \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}% + \usebeamerfont{page number in head/foot}% + \usebeamertemplate*{frame footer} + \hfill% + \usebeamertemplate*{frame numbering} + \end{beamercolorbox}% +} +\newlength{\metropolis@frametitle@padding} +\setlength{\metropolis@frametitle@padding}{2.2ex} +\newcommand{\metropolis@frametitlestrut@start}{ + \rule{0pt}{\metropolis@frametitle@padding +% + \totalheightof{% + \ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}% + }% + }% +} +\newcommand{\metropolis@frametitlestrut@end}{ + \rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding} +} +\defbeamertemplate{frametitle}{plain}{% + \nointerlineskip% + \begin{beamercolorbox}[% + wd=\paperwidth,% + sep=0pt,% + leftskip=\metropolis@frametitle@padding,% + rightskip=\metropolis@frametitle@padding,% + ]{frametitle}% + \metropolis@frametitlestrut@start\insertframetitle\metropolis@frametitlestrut@end% + \end{beamercolorbox}% +} +\newlength{\metropolis@progressinheadfoot} +\setbeamertemplate{progress bar in head/foot}{ + \nointerlineskip + \setlength{\metropolis@progressinheadfoot}{% + \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}% + }% + \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot} + \begin{tikzpicture} + \fill[bg] (0,0) rectangle (\paperwidth, 0.4pt); + \fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt); + \end{tikzpicture}% + \end{beamercolorbox} +} +\AtBeginDocument{% + \apptocmd{\appendix}{% + \pgfkeys{% + /metropolis/outer/.cd, + numbering=none, + progressbar=none} + }{}{} +} +\metropolis@outer@setdefaults +\ProcessPgfPackageOptions{/metropolis/outer} +\endinput +%% +%% End of file `beamerouterthememetropolis.sty'. diff --git a/presentations/arduino-intro-2016/beamerthememetropolis.sty b/presentations/arduino-intro-2016/beamerthememetropolis.sty new file mode 100644 index 0000000..740cb88 --- /dev/null +++ b/presentations/arduino-intro-2016/beamerthememetropolis.sty @@ -0,0 +1,105 @@ +%% +%% This is file `beamerthememetropolis.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% beamerthememetropolis.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamerthememetropolis} + [2016/03/14 v1.1 Metropolis Beamer theme] +\RequirePackage{etoolbox} +\RequirePackage{pgfopts} +\pgfkeys{/metropolis/.cd, + .search also={ + /metropolis/inner, + /metropolis/outer, + /metropolis/color, + /metropolis/font, + } +} +\pgfkeys{ + /metropolis/titleformat plain/.cd, + .is choice, + regular/.code={% + \let\metropolis@plaintitleformat\@empty% + \setbeamerfont{standout}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@plaintitleformat\@empty% + \setbeamerfont{standout}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@plaintitleformat\MakeLowercase% + \setbeamerfont{standout}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat plain=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@plaintitleformat\MakeUppercase% + \setbeamerfont{standout}{shape=\normalfont}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat plain=allcaps can lead to problems% + } + }, +} +\pgfkeys{ + /metropolis/titleformat/.code=\pgfkeysalso{ + font/titleformat title=#1, + font/titleformat subtitle=#1, + font/titleformat section=#1, + font/titleformat frame=#1, + titleformat plain=#1, + } +} +\pgfkeys{/metropolis/.cd, + usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=frametitle}, + noslidenumbers/.code=\pgfkeysalso{outer/numbering=none}, + usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction}, + nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none}, + darkcolors/.code=\pgfkeysalso{color/background=dark}, + blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill}, +} +\newcommand{\metropolis@setdefaults}{ + \pgfkeys{/metropolis/.cd, + titleformat plain=regular, + } +} +\useinnertheme{metropolis} +\useoutertheme{metropolis} +\usecolortheme{metropolis} +\usefonttheme{metropolis} +\AtEndPreamble{% + \@ifpackageloaded{pgfplots}{% + \RequirePackage{pgfplotsthemetol} + }{} +} +\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}} +\def\metropolis@plaintitleformat#1{#1} +\newcommand{\plain}[2][]{% + \PackageWarning{beamerthememetropolis}{% + The syntax `\plain' may be deprecated in a future version of Metropolis. + Please use a frame with [standout] instead. + } + \begin{frame}[standout]{#1} + \metropolis@plaintitleformat{#2} + \end{frame} +} +\newcommand{\mreducelistspacing}{\vspace{-\topsep}} +\metropolis@setdefaults +\ProcessPgfOptions{/metropolis} +\endinput +%% +%% End of file `beamerthememetropolis.sty'. diff --git a/presentations/arduino-intro-2016/images/7seg.png b/presentations/arduino-intro-2016/images/7seg.png new file mode 100644 index 0000000..063bcf0 Binary files /dev/null and b/presentations/arduino-intro-2016/images/7seg.png differ diff --git a/presentations/arduino-intro-2016/images/arduino-board.png b/presentations/arduino-intro-2016/images/arduino-board.png new file mode 100644 index 0000000..cb295fd Binary files /dev/null and b/presentations/arduino-intro-2016/images/arduino-board.png differ diff --git a/presentations/arduino-intro-2016/images/arduino-toolbar.png b/presentations/arduino-intro-2016/images/arduino-toolbar.png new file mode 100644 index 0000000..8827ac6 Binary files /dev/null and b/presentations/arduino-intro-2016/images/arduino-toolbar.png differ diff --git a/presentations/arduino-intro-2016/images/bb+switch+pot+leds.png b/presentations/arduino-intro-2016/images/bb+switch+pot+leds.png new file mode 100644 index 0000000..5fc91e0 Binary files /dev/null and b/presentations/arduino-intro-2016/images/bb+switch+pot+leds.png differ diff --git a/presentations/arduino-intro-2016/images/bb+switch+pot.png b/presentations/arduino-intro-2016/images/bb+switch+pot.png new file mode 100644 index 0000000..55f1946 Binary files /dev/null and b/presentations/arduino-intro-2016/images/bb+switch+pot.png differ diff --git a/presentations/arduino-intro-2016/images/bb+switch+zoom.png b/presentations/arduino-intro-2016/images/bb+switch+zoom.png new file mode 100644 index 0000000..ef3694d Binary files /dev/null and b/presentations/arduino-intro-2016/images/bb+switch+zoom.png differ diff --git a/presentations/arduino-intro-2016/images/bb+switch.png b/presentations/arduino-intro-2016/images/bb+switch.png new file mode 100644 index 0000000..eba0880 Binary files /dev/null and b/presentations/arduino-intro-2016/images/bb+switch.png differ diff --git a/presentations/arduino-intro-2016/images/bb+uno.png b/presentations/arduino-intro-2016/images/bb+uno.png new file mode 100644 index 0000000..021d106 Binary files /dev/null and b/presentations/arduino-intro-2016/images/bb+uno.png differ diff --git a/presentations/arduino-intro-2016/images/breadboard-internal-connections.png b/presentations/arduino-intro-2016/images/breadboard-internal-connections.png new file mode 100644 index 0000000..778b5c2 Binary files /dev/null and b/presentations/arduino-intro-2016/images/breadboard-internal-connections.png differ diff --git a/presentations/arduino-intro-2016/images/breadboard.png b/presentations/arduino-intro-2016/images/breadboard.png new file mode 100644 index 0000000..bcedb77 Binary files /dev/null and b/presentations/arduino-intro-2016/images/breadboard.png differ diff --git a/presentations/arduino-intro-2016/images/buzzer-breadboard.png b/presentations/arduino-intro-2016/images/buzzer-breadboard.png new file mode 100644 index 0000000..86bfde4 Binary files /dev/null and b/presentations/arduino-intro-2016/images/buzzer-breadboard.png differ diff --git a/presentations/arduino-intro-2016/images/buzzer-button-breadboard.png b/presentations/arduino-intro-2016/images/buzzer-button-breadboard.png new file mode 100644 index 0000000..8e9f985 Binary files /dev/null and b/presentations/arduino-intro-2016/images/buzzer-button-breadboard.png differ diff --git a/presentations/arduino-intro-2016/images/circadia.jpg b/presentations/arduino-intro-2016/images/circadia.jpg new file mode 100644 index 0000000..5c574d6 Binary files /dev/null and b/presentations/arduino-intro-2016/images/circadia.jpg differ diff --git a/presentations/arduino-intro-2016/images/diode.png b/presentations/arduino-intro-2016/images/diode.png new file mode 100644 index 0000000..354b711 Binary files /dev/null and b/presentations/arduino-intro-2016/images/diode.png differ diff --git a/presentations/arduino-intro-2016/images/game.jpg b/presentations/arduino-intro-2016/images/game.jpg new file mode 100644 index 0000000..5f5ae39 Binary files /dev/null and b/presentations/arduino-intro-2016/images/game.jpg differ diff --git a/presentations/arduino-intro-2016/images/led.jpg b/presentations/arduino-intro-2016/images/led.jpg new file mode 100644 index 0000000..843c440 Binary files /dev/null and b/presentations/arduino-intro-2016/images/led.jpg differ diff --git a/presentations/arduino-intro-2016/images/pwm.gif b/presentations/arduino-intro-2016/images/pwm.gif new file mode 100644 index 0000000..dd38b2c Binary files /dev/null and b/presentations/arduino-intro-2016/images/pwm.gif differ diff --git a/presentations/arduino-intro-2016/images/pwm.png b/presentations/arduino-intro-2016/images/pwm.png new file mode 100644 index 0000000..c08463f Binary files /dev/null and b/presentations/arduino-intro-2016/images/pwm.png differ diff --git a/presentations/arduino-intro-2016/images/resistor.png b/presentations/arduino-intro-2016/images/resistor.png new file mode 100644 index 0000000..50cb4e1 Binary files /dev/null and b/presentations/arduino-intro-2016/images/resistor.png differ diff --git a/presentations/arduino-intro-2016/images/timbo.jpg b/presentations/arduino-intro-2016/images/timbo.jpg new file mode 100644 index 0000000..b75c12e Binary files /dev/null and b/presentations/arduino-intro-2016/images/timbo.jpg differ diff --git a/presentations/arduino-intro-2016/pdfpc-commands.sty b/presentations/arduino-intro-2016/pdfpc-commands.sty new file mode 100644 index 0000000..2dfe918 --- /dev/null +++ b/presentations/arduino-intro-2016/pdfpc-commands.sty @@ -0,0 +1,167 @@ +% Package: textpos is required for textblock* +\usepackage[absolute,overlay]{textpos} + + +% fullFrameMovie +% +% Arguments: +% +% [optional]: movie-options, seperated by & +% Supported options: loop, start=N, end=N, autostart +% Default: autostart&loop +% +% 1. Movie file +% 2. Poster image +% 3. Any text on the slide, or nothing (e.g. {}) +% +% Example: +% \fullFrameMovie[loop&autostart]{apollo17.avi}{apollo17.jpg}{\copyrightText{Apollo 17, NASA}} +% +\newcommand{\fullFrameMovie}[4][autostart&loop] +{ + { + \setbeamercolor{background canvas}{bg=black} + + + % to make this work for both horizontally filled and vertically filled images, we create an absolutely + % positioned textblock* that we force to be the width of the slide. + % we then place it at (0,0), and then create a box inside of it to ensure that it's always 95% of the vertical + % height of the frame. Once we have created an absolutely positioned and sized box, it doesn't matter what + % goes inside -- it will always be vertically and horizontally centered + \frame[plain] + { + \begin{textblock*}{\paperwidth}(0\paperwidth,0\paperheight) + \centering + \vbox to 0.95\paperheight { + \vfil{ + \href{run:#2?autostart}{\includegraphics[width=\paperwidth,height=0.95\paperheight,keepaspectratio]{#3}} + } + \vfil + } + \end{textblock*} + #4 + } + } +} + +% inlineMovie +% +% Arguments: +% +% [optional]: movie-options, seperated by & +% Supported options: loop, start=N, end=N, autostart +% Default: autostart&loop +% +% 1. Movie file +% 2. Poster image +% 3. size command, such as width=\textwidth +% +% Example: +% \inlineMovie[loop&autostart&start=5&stop=12]{apollo17.avi}{apollo17.jpg}{height=0.7\textheight} +% +\newcommand{\inlineMovie}[4][autostart&loop] +{ + \href{run:#2?#1}{\includegraphics[#4]{#3}} +} + + +% copyrightText +% +% Produces small text on the right side of the screen, useful for +% stating copyright or other small notes in movies or images +% +% Arguments: +% +% [optional]: text color +% Default: white +% +% 1. Text to be displayed +% +% Example: +% \copyrightText{Full frame image of: Apollo 17, NASA} +% +\newcommand\copyrightText[2][white]{% + \begin{textblock*}{\paperwidth}(0\paperwidth,.97\paperheight)% + \hfill\textcolor{#1}{\tiny#2}\hspace{20pt} + \end{textblock*} +} + +% fullFrameImageZoomed +% +% Produces a slide that contains a full frame image. Scales down the image +% to fit if the aspect ratio of the slide does not match the image. +% +% Arguments: +% +% [optional]: color of text on page +% Default: white +% +% 1. Path to image file +% 2. Any additional content on the frame +% +% Example: +% \fullFrameImageZoomed{apollo17.jpg}{\copyrightText{Full frame image of: Apollo 17, NASA}} +% +\newcommand{\fullFrameImage}[3][white] +{ + { + \setbeamercolor{normal text}{bg=black,fg=#1} + + + % to make this work for both horizontally filled and vertically filled images, we create an absolutely + % positioned textblock* that we force to be the width of the slide. + % we then place it at (0,0), and then create a box inside of it to ensure that it's always 95% of the vertical + % height of the frame. Once we have created an absolutely positioned and sized box, it doesn't matter what + % goes inside -- it will always be vertically and horizontally centered + \frame + { + \begin{textblock*}{\paperwidth}(0\paperwidth,0\paperheight) + \centering + \vbox to 0.95\paperheight { + \vfil{ + \includegraphics[width=\paperwidth,height=0.95\paperheight,keepaspectratio]{#2} + } + \vfil + } + \end{textblock*} + #3 + } + } +} + +% fullFrameImageZoomed +% +% Produces a slide that contains a full frame image. If the aspect ratio +% of the image does not match the slide, it crops the image. +% +% Arguments: +% +% [optional]: color of text on page +% Default: black +% +% 1. Path to image file +% 2. Any additional content on the frame +% +% Example: +% \fullFrameImageZoomed{apollo17.jpg}{\copyrightText{Full frame image of: Apollo 17, NASA}} +% +\newcommand{\fullFrameImageZoomed}[3][black] +{ + { + \usebackgroundtemplate{\includegraphics[height=\paperheight]{#2}} + \setbeamercolor{normal text}{bg=black,fg=#1} + \frame + { + #3 + } + } +} + +\newcommand{\fullImage}[3][white] +{ + { + \begin{textblock*}{\paperwidth}(0pt,-10pt) + \includegraphics[width=\paperwidth,height=\paperheight]{#2} + \end{textblock*} + } +} diff --git a/presentations/arduino-intro-2016/pgfplotsthemetol.sty b/presentations/arduino-intro-2016/pgfplotsthemetol.sty new file mode 100644 index 0000000..9405e10 --- /dev/null +++ b/presentations/arduino-intro-2016/pgfplotsthemetol.sty @@ -0,0 +1,123 @@ +%% +%% This is file `pgfplotsthemetol.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pgfplotsthemetol.dtx (with options: `package') +%% --------------------------------------------------------------------------- +%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +%% contributors can be found at +%% +%% https://github.com/matze/mtheme/graphs/contributors +%% +%% and the original template was based on the HSRM theme by Benjamin Weiss. +%% +%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +%% International License (https://creativecommons.org/licenses/by-sa/4.0/). +%% --------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pgfplotsthemetol} + [2016/03/14 PGFplots colors based on Paul Tol's SRON technical note] +\definecolor{TolDarkPurple}{HTML}{332288} +\definecolor{TolDarkBlue}{HTML}{6699CC} +\definecolor{TolLightBlue}{HTML}{88CCEE} +\definecolor{TolLightGreen}{HTML}{44AA99} +\definecolor{TolDarkGreen}{HTML}{117733} +\definecolor{TolDarkBrown}{HTML}{999933} +\definecolor{TolLightBrown}{HTML}{DDCC77} +\definecolor{TolDarkRed}{HTML}{661100} +\definecolor{TolLightRed}{HTML}{CC6677} +\definecolor{TolLightPink}{HTML}{AA4466} +\definecolor{TolDarkPink}{HTML}{882255} +\definecolor{TolLightPurple}{HTML}{AA4499} +\pgfplotscreateplotcyclelist{mbarplot cycle}{% + {draw=TolDarkBlue, fill=TolDarkBlue!70}, + {draw=TolLightBrown, fill=TolLightBrown!70}, + {draw=TolLightGreen, fill=TolLightGreen!70}, + {draw=TolDarkPink, fill=TolDarkPink!70}, + {draw=TolDarkPurple, fill=TolDarkPurple!70}, + {draw=TolDarkRed, fill=TolDarkRed!70}, + {draw=TolDarkBrown, fill=TolDarkBrown!70}, + {draw=TolLightRed, fill=TolLightRed!70}, + {draw=TolLightPink, fill=TolLightPink!70}, + {draw=TolLightPurple, fill=TolLightPurple!70}, + {draw=TolLightBlue, fill=TolLightBlue!70}, + {draw=TolDarkGreen, fill=TolDarkGreen!70}, +} +\pgfplotscreateplotcyclelist{mlineplot cycle}{% + {TolDarkBlue, mark=*, mark size=1.5pt}, + {TolLightBrown, mark=square*, mark size=1.3pt}, + {TolLightGreen, mark=triangle*, mark size=1.5pt}, + {TolDarkBrown, mark=diamond*, mark size=1.5pt}, +} +\pgfplotsset{ + compat=1.9, + mlineplot/.style={ + mbaseplot, + xmajorgrids=true, + ymajorgrids=true, + major grid style={dotted}, + axis x line=bottom, + axis y line=left, + legend style={ + cells={anchor=west}, + draw=none + }, + cycle list name=mlineplot cycle, + }, + mbarplot base/.style={ + mbaseplot, + bar width=6pt, + axis y line*=none, + }, + mbarplot/.style={ + mbarplot base, + ybar, + xmajorgrids=false, + ymajorgrids=true, + area legend, + legend image code/.code={% + \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm); + }, + cycle list name=mbarplot cycle, + }, + horizontal mbarplot/.style={ + mbarplot base, + xmajorgrids=true, + ymajorgrids=false, + xbar stacked, + area legend, + legend image code/.code={% + \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm); + }, + cycle list name=mbarplot cycle, + }, + mbaseplot/.style={ + legend style={ + draw=none, + fill=none, + cells={anchor=west}, + }, + x tick label style={ + font=\footnotesize + }, + y tick label style={ + font=\footnotesize + }, + legend style={ + font=\footnotesize + }, + major grid style={ + dotted, + }, + axis x line*=bottom, + }, + disable thousands separator/.style={ + /pgf/number format/.cd, + 1000 sep={} + }, +} +\endinput +%% +%% End of file `pgfplotsthemetol.sty'. diff --git a/presentations/arduino-intro-2016/talk.ebook.pdf b/presentations/arduino-intro-2016/talk.ebook.pdf new file mode 100644 index 0000000..077e2b4 Binary files /dev/null and b/presentations/arduino-intro-2016/talk.ebook.pdf differ diff --git a/presentations/arduino-intro-2016/talk.ebook.pdfpc b/presentations/arduino-intro-2016/talk.ebook.pdfpc new file mode 100644 index 0000000..a08fd1f --- /dev/null +++ b/presentations/arduino-intro-2016/talk.ebook.pdfpc @@ -0,0 +1,9 @@ +[file] +talk.ebook.pdf +[notes] +### 2 +29### 4 +Nuit Blanche - Take over the city w/ interactive art +Work in Practice @ Explode (Illustrators explaining their artistic practice and portfolio feedback)### 22 +Devices that are 'on' have current flowing through them. Most of what we'll do today is getting current to flow through devices in various ways.### 23 +Potential is the push that moves current. \ No newline at end of file diff --git a/presentations/arduino-intro-2016/talk.md b/presentations/arduino-intro-2016/talk.md new file mode 100644 index 0000000..203d7d6 --- /dev/null +++ b/presentations/arduino-intro-2016/talk.md @@ -0,0 +1,645 @@ +--- +author: Raphael Kopala, Shawn Nock +institute: Unlondon Digital Media Assoc. +title: Introduction to Arduino +subtitle: Maker Workshop +lang: en-CA +colorlinks: true +... + +# Goals + +## Unlondon + +\begin{center} +{\huge Enabling Exploration, Creativity, and Excellence In Art+Make+Tech} +\end{center} + +Challenging and embracing ideas related to new technologies and social +platforms through the education, entertainment and engagement of our +membership and the community-at-large. + +- 121Studios: Coworking for Creatives +- Unlab: Hackerspace +- Events: STEAM Outreach & Edu., ExplodeConf, Nuit Blanche + +## Shawn: Day Job + +Freelance Embedded Systems Engineer + +- Indoor location tracking w/ Bluetooth +- Keychain / Fitness Band Widgets +- Joystick for VR +- Remote Controls +- Internet of S*#t + +## Shawn: The Fun Stuff + +Hacker, Church of the Weird Machine, Odd Duck + +\begin{columns}[c] +\column{0.50\textwidth} + +\begin{itemize} +\item Arduino compatible implant +\item EEG Games / Toy Hacking +\item Brain Stimulation +\item Be Weird, Make Weird, Have Fun! +\end{itemize} + +\column{0.50\textwidth} +\begin{center} +\includegraphics[width=0.95\textwidth]{images/timbo.jpg} +\vspace{5mm} +\includegraphics[width=0.95\textwidth]{images/circadia.jpg} +\end{center} +\end{columns} + +## Raphael: The Vital Info + +- Manufacturing Engineer +- Instructor at Fanshawe +- Maker + +# What's in your kit? + +## Kit Contents + +- Arduino Uno R3 Clone +- Solderless Breadboard +- Connecting wires +- LEDs +- Resistors, Potentiometer +- Buzzer + +## What is Arduino? + +\begin{center} +$\mu$C + reset button + led + USB +\end{center} + +It's a kit (on a board) with the bare minimum components to easily use the $\mu$C +hardware. They do the basic, boring design needed for any board, so users only +need to add the neat stuff. + + + + + + + + + +## Arduino Software + +The Arduino folks also adapted an *Integrated Development Environment* +(IDE) to their boards. This IDE allows us to easily write programs for +their boards and then write the programs to the $\mu$C. + +\Large Get the Arduino IDE: +[https://www.arduino.cc/en/Main/Software](https://www.arduino.cc/en/Main/Software) + +## Installation + +\Large Get installing + +# Circuit Basics + +## Current + +Current is the flow of charge through a circuit. Conventionally we +think of this as happening from HIGH ($+$) to LOW ($-$) + +## Voltage / Potential / Resistance + +Voltage is how fast the current can move in the circuit. River +metaphor: + + - current = flow rate: ($\si{\liter\per\second}$) + - voltage = change in height: ($\si{\meter}$) + +Other devices in a circuit can impede / effect current flow. We'll +call them resistance(s). + +## Diode + +\begin{columns}[c] +\column{0.50\textwidth} + +\begin{itemize} +\item One way value for current\footnotemark[1] +\item LED $\equiv$ Light Emitting Diode +\item Band marks (-)\footnotemark[2] +\item Longer leg marks (+) +\end{itemize} + +\column{0.50\textwidth} +\begin{center} +\includegraphics[width=0.75\textwidth]{images/diode.png} +\vspace{5mm} +\includegraphics[width=0.50\textwidth]{images/led.jpg} +\end{center} +\end{columns} + +\footnotetext[1]{\tiny \url{https://learn.sparkfun.com/tutorials/diodes}} +\footnotetext[2]{\tiny \url{https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity}} + +## Diode Problems + +* Diodes don't limit current +* Diodes aren't perfect (some current turned to heat) +* Too much current $\rightarrow$ Too much heat $\rightarrow$ \ + \ + \center{ \huge{\emph{What's that smell?} } } + +## Resistor + +\begin{columns}[c] +\column{0.50\textwidth} + +\begin{itemize} +\item \emph{Resists}/limits the flow of current +\item Needed for LEDs: $\approx\SI{400}{\ohm}$\\ +(safe for $\le\SI{6}{\volt}$) +\item Button Pull-up/down: $\ge\SI{10}{\kilo\ohm}$ +\item Color coded, Google it +\end{itemize} +\column{0.50\textwidth} + +\includegraphics[width=0.98\textwidth]{images/resistor.png} + +\end{columns} + +## Ohm's Law + +Ohm's Law relates current to potential and resistance. + +$$ V = IR $$ +$$ I=\frac{V}{R} $$ +$$ R = \frac{V}{I} $$ + +* V = Potential in Volts (\si{\volt}) +* I = Current in Amperes (\si{\ampere}) +* R = Resistance in Ohms (\si{\ohm}) + +## Ohm's Law: Example + +The datasheet for an LED says that the maximum continuous current is +\SI{15}{\milli\ampere}. Your circuit operates at \SI{5}{\volt}\footnotemark[1]. How +big should your resistor be? + +$$ \si{\ohm} = \frac{\SI{5}{\volt}}{\SI{0.015}{\ampere}} = 333.\overline{3}\si{\ohm} $$ + +How much current for our *cheet sheet* value? + +$$ \si{\ampere} = \frac{\SI{5}{\volt}}{\SI{400}{\ohm}} = \SI{12.5}{\milli\ampere} $$ + +\footnotetext[1]{\tiny Actually, this calculation is inaccurate. LEDs will have a *forward voltage drop* of between \SI{300}{\milli\volt} and \SI{700}{\milli\volt} this should be subtracted from \si{\volt} above... but it's not critical.} + +## Buttons + +- Buttons connect _or_ disconnect two wires/parts +- Momentary Switch: Normally Closed (NC), Normally Open (NO) +- Toggle Switch + +## Circuits + +A circuit is a completed loop from HIGH potential (voltage) to LOW, +which causes current to flow through some other components along the +way. + +## Transducers {.fragile} + +Often these *other* components are *transducers*, which convert +electrical energy into another sort of energy: + +| | +-------|--------: +Speaker|Electrical $\rightarrow$ Sound +Microphone|Sound $\rightarrow$ Electrical +LED|Electrical $\rightarrow$ Light +LED|Light $\rightarrow$ Electrical +Piezoelectric|Electrical $\rightarrow$ Motion + + + + + + + + + +## Power + +The power supply provides the energy to drive the system. + +Can be a: + +* Voltage Regulator (converts one potential to another) +* Batteries +* Solar Panel + +In our circuits, your laptop is converting it's power source to $\SI{5}{\volt}$ and +delivering power to our circuit via USB. + +## $\mu$Controller + +Microcontroller ($\mu$C) is a *processor*, *memory* and a few *peripherals* on a standalone +chip. + +Processor +: is a group of transistors that understands a dozen or so +commands (ADD, SUB, JUMP..) + +Memory +: a circuit that can hold values. + +Peripherals +: Vary chip to chip, but often include timers, communications and +ADC, DAC. + +Seems complicated, but really simple. They read a command from the +start of memory, then execute the command. At the end of the command, +read the next command from the next memory cell and +repeat^[some commands change the address of the next fetched command] + +## Digital Signals + +- Vcc: The power supply of the circuit elements +- GND: The reference voltage (usually \SI{0}{\volt}) +- Connecting a part to Vcc = Logical 1 or High +- Connecting to GND = Logical 0 or Low +- Connecting various pins to Vcc or Ground is all the $\mu$C can do to + talk to the world [^4] + +[^4]: w/o fancy peripherals or dirty tricks + +## $\mu$Controller INPUT and OUTPUT + +Most of the pins on the Arduino can be set for INPUT or OUTPUT mode. + +- INPUT mode pins listen for a signal ($0$ or $1$) from another device +- OUTPUT mode pins drive the pin High or Low + +## Floating Pins + +What's happens if an INPUT mode pin tries to read the value of a pin +that is connected to nothing? Is that a $1$ or $0$? + +\center{\huge {No one knows!}} + +It's dependant of transient charges, static, nearby electric fields, +the phase of the moon, \ldots Whenever you want to check a digital +signal, make sure that something is *driving* it (ensuring Vcc or GND). + +## $\mu$C + Digital Signals as Switches + +If one end of an LED is connected to ground, and the other end is +connected to an OUTPUT pin on a $\mu$Controller, then: + +- If the $\mu$C sets the pin High (Vcc, $\SI{5}{\volt}$) then current +will flow from the pin through the LED and turn it on. +- If $\mu$C sets the pin Low (GND, $\SI{0}{\volt}$) then the current +will not flow and the LED is off. + +# Let's start programming + +## Configure Arduino + +\begin{center} +\includegraphics[width=0.98\textwidth]{images/arduino-board.png} +\end{center} + +* Board: Arduino/Genuino UNO +* Port: \ldots + + + + + + + + + + +## The Code Environment + +\begin{center} +\includegraphics[width=0.95\textwidth]{images/arduino-toolbar.png} +\end{center} + +## Your first Program + +~~~ C +/* the setup function runs once on reset / power */ +void setup() { + /* set pin 13 as an output */ + pinMode(13, OUTPUT); +} + +/* the loop function repeats forever */ +void loop() { + digitalWrite(13, HIGH); // turn on LED + delay(1000); // wait for a second + digitalWrite(13, LOW); // turn the off LED + delay(1000); // wait for a second +} +~~~ + +# Add Some Parts + +## Breadboard + +![Breadboard](images/breadboard.png)\ + +- Connectors gently pinch component leads, wires. +- Have internal connections + +## Power Up the Rails + +We use the long rows to distribute power. The Arduino outputs +$\SI{5}{\volt}$ on the pin marked `5V`, the reference (GND) is marked +`GND`. + +![Arduino + Breadboard](images/bb+uno.png) + + + + + + + + + + + + + + + + + + + + + + + + +## Push Button: Hardware + +\begin{center} +\includegraphics[width=0.98\textwidth]{images/bb+switch.png} +\end{center} + +## Push Button: Hardware, Pt. 2 + +\begin{center} +\includegraphics[width=0.98\textwidth]{images/bb+switch+zoom.png} +\end{center} + +## Pullup / Pulldown Resistors + +Reading a floating pin is **bad**. A switch only connects +and disconnects a wire. When the wire is disconnected... the INPUT pin +is floating! + +\vfill + +**Solution:** + +Connect the pin to Vcc so that it reads High; use a +resistor to prevent short circuit (limit current). + +## Push Button: Software (Part 1) + +~~~ C +#define BUTTON 2 +#define LED 13 + +int button_state = 0; + +void setup() { + pinMode(BUTTON, INPUT); + pinMode(LED, OUTPUT); + digitalWrite(LED, LOW); /* Start w/ LED off */ +} +~~~ +## Programming Note: Variables + +Declare a variable: + +~~~ C +int delay_ms = 1000; +~~~ + +` [= ];` (value optional) + +It's a name, like a preprocessor `#define`, but the value can change +at *runtime* + + + + + + + + + + +## Programming Note: *If* Statement + +~~~ C +if (condition) { + // body: Runs if condition true ( != 0) +} else { + // Runs if condition false ( == 0 ) +} +~~~ + + - body code inside curly braces: `{` `}` + - **condition** evaluates to 0 $\rightarrow$ body code skipped + - else section is optional, runs if **condition** evaluates to 0 + - **condition** evaluates to *not* 0 $\rightarrow$ body code runs + +## Programming Note: `==` + +In C-like languages, the `==` operator checks if two things +(statements, variables, \ldots) are equal to each other. + + - It returns `1` if the items are equal, *or* + - It returns `0` if the items are not equal + +## Push Button: Software (Part 2) + +~~~ C +void loop() { + button_state = digitalRead(BUTTON); + if (button_state == HIGH) { + digitalWrite(LED, LOW); + } else { + digitalWrite(LED, HIGH); + } +} +~~~ + +# More Parts + +## Potentiometer + +*Puh - ten - she - ometer* + +- *Pot* for short +- A Voltage Divider +- Voltage at *Wiper* is somewhere between potential at the two + terminals. +- The exact wiper potential depends on the position of the knob/lever. + +## ADC: Analog to Digital Converter + +- A peripheral of the $\mu$Controller +- Measures Potential, outputs a number +- In our case, $\SI{0}{\volt}\rightarrow0$ and + $\SI{5}{\volt}\rightarrow1023$ +- A0-A5 pins on Arduino can be used +- Fun uses: Reading pot position, sampling audio, reading from sensors + +## The Pot Hookup + +\begin{center} +\includegraphics[width=0.98\textwidth]{images/bb+switch+pot.png} +\end{center} + +Connect center pin to `A0`, outer pins to ($+$) and ($-$) rails + +## Pot Code + +`analogRead(`*pin*`)` returns the current state of the pin (0--1023), +it can be assigned to a variable. + +~~~ C +void loop() { + delay_ms = analogRead(A0); + digitalWrite(LED, HIGH); + delay(delay_ms); + digitalWrite(LED, LOW); +} +~~~ + +Each time through the loop, a new `delay_ms` value is read. Since the +subsequent delay calls use `delay_ms`, the blink rate changes with +knob position. + +# Shall we play a game? + +## Hooking up a bunch of LEDs + +\begin{center} +\includegraphics[width=0.65\textwidth]{images/bb+switch+pot+leds.png} +\end{center} + +Looks complicated, but for each LED: The short leg goes to ground, the +long leg goes to one end of a resistor, and the other end of the +resistor goes to the arduino pin. + +## Programming Note: `for` Loop + +~~~ C +for ( initializer ; condition; increment ) { + // This body will repeat until condition != 0 +} +~~~ + +initializer +: Executed once at beginning of loop. Often used to declare a local +variable. + +condition +: Loop will repeat until condition $\neq0$ + +increment +: Runs *after* each loop. Often used to increment variables. + +\center{*All fields are optional*} + +## Game Code: Part. 1; Cylon Attack + +~~~ C +loop () { + for (int i = 4; i <= 7; i++) { + delay_ms = analogRead(A0); + analogWrite(i - 1, LOW); + analogWrite(i, HIGH); + delay(delay_ms); + } + for (int i = 6; i >= 3; i--) { + delay_ms = analogRead(A0); + analogWrite(i + 1, LOW); + analogWrite(i, HIGH); + delay(delay_ms); + } +} +~~~ + +## Programming Note: Functions + +~~~ C +void my_function(int arg1, ...) { + // Do fun things +} +~~~ + +void: +: Return type. Void means nothing returned. Can be any type. + +my_function: +: A name for your function + +arguments: +: A type and name for any parameters you want to use in your function +from the outside. + +Define a function once, you can use it again and again. Beats +copy/pasting. + +## Winner, Winner, Chicken Dinner + +~~~ C +void check_delay(int cur_led, int delay_ms) { + if (cur_led != 5) { // No chance of winner + delay(delay_ms); // Do a normal delay + return; + } + int start = millis(); + while (millis() < start+delay_ms) { + if (digitalRead(BUTTON) == LOW) { + for (int i = 3; i <= 7; i++) { + digitalWrite(i, HIGH); + }; for (;;); // Loop until reset + } + } +} +~~~ + +## Putting it Together + +~~~ C +loop () { + for (int i = 4; i <= 7; i++) { + delay_ms = analogRead(A0); + analogWrite(i - 1, LOW); + analogWrite(i, HIGH); + check_delay(i, delay_ms); + } + for (int i = 6; i >= 3; i--) { + ... + check_delay(i, delay_ms); + } +} +~~~ + +## The End? + +\begin{center} +\LARGE{Let's build some cool stuff!} +\end{center} diff --git a/presentations/arduino-intro-2016/talk.pdf b/presentations/arduino-intro-2016/talk.pdf new file mode 100644 index 0000000..21b603c Binary files /dev/null and b/presentations/arduino-intro-2016/talk.pdf differ diff --git a/presentations/arduino-intro-2016/talk.pdfpc b/presentations/arduino-intro-2016/talk.pdfpc new file mode 100644 index 0000000..7aaea59 --- /dev/null +++ b/presentations/arduino-intro-2016/talk.pdfpc @@ -0,0 +1,13 @@ +[file] +talk.pdf +[notes] +### 1 +Testing 1,2,3### 4 +Nuit Blache - Took over Dundas interactive art.### 10 +Nuit Blanche, projected head pictures +Makerbus Laser Show +Giant Trackball Katamari Damacy +Sphero Mini-Golf +Mind Controlled Robot Painting +### 13 +Yarn Grid + Projector = Three Dimentional moving lights. diff --git a/presentations/arduino-intro-2016/template.tex b/presentations/arduino-intro-2016/template.tex new file mode 100644 index 0000000..2967728 --- /dev/null +++ b/presentations/arduino-intro-2016/template.tex @@ -0,0 +1,260 @@ +\documentclass[$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}{: } +\setbeamercolor{caption name}{fg=normal text.fg} +\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$ +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$else$ +\usepackage{lmodern} +$endif$ +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\usepackage{wrapfig} +\usepackage{siunitx} +\usepackage{pdfpc-commands} +\hypersetup{ + colorlinks=true, + linkcolor=black, + urlcolor=green!50!black +} +\usepackage{fixltx2e} % provides \textsubscript +\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$ +$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${biblatex} +$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$ +$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)$ +\begin{frame} +\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}