diff --git a/lectures/lecture-n-1/.gitignore b/lectures/lecture-n-1/.gitignore new file mode 100644 index 0000000..4494f4b --- /dev/null +++ b/lectures/lecture-n-1/.gitignore @@ -0,0 +1,94 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc + +## Intermediate documents: +*.dvi +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: + +# algorithms +*.alg +*.loa + +# amsthm +*.thm + +# beamer +*.nav +*.snm +*.vrb + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls + +# hyperref +*.brf + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mtc +*.mtc0 + +# minted +*.pyg + +# nomencl +*.nlo + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# todonotes +*.tdo + +# xindy +*.xdy + +# useless files +color_scheme.png +identicon.png +._wordcount_selection.tex \ No newline at end of file diff --git a/lectures/lecture-n-1/LICENSE b/lectures/lecture-n-1/LICENSE new file mode 100644 index 0000000..3b89dcd --- /dev/null +++ b/lectures/lecture-n-1/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Kenton Hamaluik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/lectures/lecture-n-1/README.md b/lectures/lecture-n-1/README.md new file mode 100644 index 0000000..eb33d1b --- /dev/null +++ b/lectures/lecture-n-1/README.md @@ -0,0 +1,45 @@ +# lucid +A modern Beamer theme you can use without installing dozens of CTAN packages. + +I really, really hate all PowerPoint-like programs but also dislike most Beamer templates, so back in my third year of university I invested one night in making my own. +I didn't understand anything about CTAN packages, `.sty` files and `tikz` (and to a large extent I still don't), but [Beamer-Theme-Execushares](https://github.com/hamaluik/Beamer-Theme-Execushares) provided an excellent starting point and the resulting theme served me well throughout the last 5 years - I only recently switched to my current institution's (Språkbanken Text, University of Gothenburg) colors and logo and fixed a few things that kept annoying me. +There are still a few [issues](https://github.com/harisont/Beamer-mhthm/issues) I'd like to address, but because I find writing style files to be a nightmare PRs are more than ever welcome. + +## Usage +You can of course use lucid to write your presentations in LaTeX and compile them with `pdflatex`. +A fairly standard `texlive` installation should provide everything you need, as the only package required is `tikz`. + +### If you hate writing presentations in LaTeX +However, __I warmly recommend that you write your presentations in Markdown and generate beamer slides with [pandoc](https://github.com/jgm/pandoc)__. +This is a much easier way to obtain perfectly fine slides in 99% of the cases, and allows for LaTeX injections that fix the remaining 1% of things that you can't express in Markdown. +For instance, you can add a `\pause` wherever you want. + +I usually just write regular Markdown using `#` for each new section and `##` for each new slide, add a metadata section in the beginning of the file, for instance + +```yaml +--- +title: "The title" +subtitle: "a possibly very long subtitle" # OPTIONAL +author: "My Name" # OPTIONAL +theme: "lucid" +logo: "gu.png" # OPTIONAL - if present, it should as of now be the path to a 300x300 image +date: "the date" # OPTIONAL - will appear on the title page on the bottom right +institute: "Språkbanken Text, University of Gothenburg" # OPTIONAL +--- +``` + +and then run + +``` +pandoc slides.md -t beamer --slide-level 2 -o slides.pdf +``` + +to generate the PDF. + +See [`slides.pdf`](slides.pdf) for some example pandoc-generated slides and [`slides.md`](slides.md) to take a look at the very simple source code. + +For further information about the pandoc + beamer combo, I think [alexeygumirov](https://github.com/alexeygumirov/pandoc-beamer-how-to) is the most exhaustive source. A more compact tutorial is available [here](https://ashwinschronicles.github.io/beamer-slides-using-markdown-and-pandoc?utm_source=pocket_reader). + +## Namesake +In Italian, _lucidi_ is the word that indicates slides meant for old-fashioned overhead projectors. +Not to mention that having a quick and simple way to generate acceptable-looking slides greatly helps me _mantenere la luciditá_ (stay sane). diff --git a/lectures/lecture-n-1/beamerthemelucid.sty b/lectures/lecture-n-1/beamerthemelucid.sty new file mode 100644 index 0000000..3c53260 --- /dev/null +++ b/lectures/lecture-n-1/beamerthemelucid.sty @@ -0,0 +1,187 @@ +\usepackage{tikz} +\usetikzlibrary{calc} + +% -------- COLOR SCHEME -------- +\definecolor{PrimaryColor}{RGB}{7,79,140} % primary color (blue) +\definecolor{SecondaryColor}{RGB}{242,88,26} % bulleted lists +\definecolor{BackgroundColor}{RGB}{255,255,255} % background & titles (white) +\definecolor{TextColor}{RGB}{0,0,0} % text (black) +\definecolor{ProgBarBGColor}{RGB}{175,175,175} % progress bar background (grey) + + +% set colours +\setbeamercolor{normal text}{fg=TextColor}\usebeamercolor*{normal text} +\setbeamercolor{alerted text}{fg=PrimaryColor} +\setbeamercolor{section in toc}{fg=PrimaryColor} +\setbeamercolor{structure}{fg=SecondaryColor} +\hypersetup{colorlinks,linkcolor=,urlcolor=SecondaryColor} + +% set fonts +\setbeamerfont{itemize/enumerate body}{size=\large} +\setbeamerfont{itemize/enumerate subbody}{size=\normalsize} +\setbeamerfont{itemize/enumerate subsubbody}{size=\small} + +% make pixelated bullets +\setbeamertemplate{itemize item}{ + \tikz{ + \draw[fill=SecondaryColor,draw=none] (0, 0) rectangle(0.1, 0.1); + \draw[fill=SecondaryColor,draw=none] (0.1, 0.1) rectangle(0.2, 0.2); + \draw[fill=SecondaryColor,draw=none] (0, 0.2) rectangle(0.1, 0.3); + } +} +\setbeamertemplate{itemize subitem}{ + \tikz{ + \draw[fill=SecondaryColor,draw=none] (0, 0) rectangle(0.075, 0.075); + \draw[fill=SecondaryColor,draw=none] (0.075, 0.075) rectangle(0.15, 0.15); + \draw[fill=SecondaryColor,draw=none] (0, 0.15) rectangle(0.075, 0.225); + } +} +\setbeamertemplate{itemize subsubitem}{ + \tikz{ + \draw[fill=SecondaryColor,draw=none] (0.050, 0.050) rectangle(0.15, 0.15); + } +} + +% disable navigation +\setbeamertemplate{navigation symbols}{} + +% disable the damn default logo! +\setbeamertemplate{sidebar right}{} + +% custom draw the title page above +\setbeamertemplate{title page}{} + +% again, manually draw the frame title above +\setbeamertemplate{frametitle}{} + +% disable "Figure:" in the captions +% TODO: somehow this doesn't work for md-generated slides +%\setbeamertemplate{caption}{\tiny\insertcaption} +%\setbeamertemplate{caption label separator}{} + +% add some space below the footnotes so they don't end up on the progress bar +\setbeamertemplate{footnote}{ + \parindent 0em + \noindent + \raggedright + \hbox to 0.8em{\hfil\insertfootnotemark} + \insertfootnotetext + \par + \vspace{2em} +} + +% add the same vspace both before and after quotes +\setbeamertemplate{quote begin}{\vspace{0.5em}} +\setbeamertemplate{quote end}{\vspace{0.5em}} + +% progress bar counters +\newcounter{showProgressBar} +\setcounter{showProgressBar}{1} +\newcounter{showSlideNumbers} +\setcounter{showSlideNumbers}{1} +\newcounter{showSlideTotal} +\setcounter{showSlideTotal}{1} + +% use \makeatletter for our progress bar definitions +% progress bar idea from http://tex.stackexchange.com/a/59749/44221 +% slightly adapted for visual purposes here +\makeatletter +\newcount\progressbar@tmpcounta% auxiliary counter +\newcount\progressbar@tmpcountb% auxiliary counter +\newdimen\progressbar@pbwidth %progressbar width +\newdimen\progressbar@tmpdim % auxiliary dimension + +\newdimen\slidewidth % auxiliary dimension +\newdimen\slideheight % auxiliary dimension + +% make the progress bar go across the screen +\progressbar@pbwidth=\the\paperwidth +\slidewidth=\the\paperwidth +\slideheight=\the\paperheight + +% draw everything with tikz +\setbeamertemplate{background}{ % all slides + % progress bar stuff + \progressbar@tmpcounta=\insertframenumber + \progressbar@tmpcountb=\inserttotalframenumber + \progressbar@tmpdim=\progressbar@pbwidth + \divide\progressbar@tmpdim by 100 + \multiply\progressbar@tmpdim by \progressbar@tmpcounta + \divide\progressbar@tmpdim by \progressbar@tmpcountb + \multiply\progressbar@tmpdim by 100 + + \begin{tikzpicture} + % set up the entire slide as the canvas + \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight); + + % background + \fill[color=BackgroundColor] (0,0) rectangle(\the\paperwidth,\the\paperheight); + + \ifnum\thepage=1\relax % only title slides + % primary color rectangle + \fill[color=PrimaryColor] (0, 4cm) rectangle(\slidewidth,\slideheight); + + % text (title, subtitle, author, date) + \node[anchor=south,text width=\slidewidth-1cm,inner xsep=0.5cm] at (0.5\slidewidth,4cm) {\color{BackgroundColor}\Huge\textbf{\inserttitle}}; + \node[anchor=north east,text width=\slidewidth-1cm,align=right] at (\slidewidth-0.4cm,4cm) {\color{PrimaryColor}\large\textbf{\insertsubtitle}}; + \node at (0.5\slidewidth,2cm) {\color{PrimaryColor}\LARGE\insertauthor}; + \node at (0.5\slidewidth,1.25cm) {\color{PrimaryColor}\Large\insertinstitute}; + \node[anchor=south east] at(\slidewidth,0cm) {\color{PrimaryColor}\tiny\insertdate}; + \else % other slides + % title bar + \fill[color=PrimaryColor] (0, \slideheight-1cm) rectangle(\slidewidth,\slideheight); + + % slide title + \node[anchor=north,text width=\slidewidth-0.75cm,inner xsep=0.5cm,inner ysep=0.25cm] at (0.5\slidewidth,\slideheight) {\color{BackgroundColor}\huge\textbf{\insertframetitle}}; + + % logo (TODO: autoscale; now it expects 350x350 + \node[anchor=north east] at (\slidewidth-0.25cm,\slideheight+0.06cm){\insertlogo}; + + % show progress bar + \ifnum \value{showProgressBar}>0\relax% + % progress bar icon in the middle of the screen + \draw[fill=ProgBarBGColor,draw=none] (0cm,0cm) rectangle(\slidewidth,0.25cm); + \draw[fill=PrimaryColor,draw=none] (0cm,0cm) rectangle(\progressbar@tmpdim,0.25cm); + + % bottom info + \node[anchor=south west] at(0cm,0.25cm) {\color{PrimaryColor}\tiny\vphantom{lp}\insertsection}; + % if slide numbers are active + \ifnum \value{showSlideNumbers}>0\relax% + % if slide totals are active + \ifnum \value{showSlideTotal}>0\relax% + % draw both slide number and slide total + \node[anchor=south east] at(\slidewidth,0.25cm) {\color{PrimaryColor}\tiny\insertframenumber/\inserttotalframenumber}; + \else + \node[anchor=south east] at(\slidewidth,0.25cm) {\color{PrimaryColor}\tiny\insertframenumber}; + \fi + \fi + \else + % section title in the bottom left + \node[anchor=south west] at(0cm,0cm) {\color{PrimaryColor}\tiny\vphantom{lp}\insertsection}; + % if we're showing slide numbers + \ifnum \value{showSlideNumbers}>0\relax% + % if slide totals are active + \ifnum \value{showSlideTotal}>0\relax% + % slide number and slide total + \node[anchor=south east] at(\slidewidth,0cm) {\color{PrimaryColor}\tiny\insertframenumber/\inserttotalframenumber}; + \else + \node[anchor=south east] at(\slidewidth,0cm) {\color{PrimaryColor}\tiny\insertframenumber}; + \fi + \fi + \fi + \fi + \end{tikzpicture} +} +\makeatother + +\AtBeginSection{\frame{\sectionpage}} % section pages +\setbeamertemplate{section page} +{ + \begin{tikzpicture} + % set up the entire slide as the canvas + \useasboundingbox (0,0) rectangle(\slidewidth,\slideheight); + \fill[color=BackgroundColor] (-1cm, 2cm) rectangle (\slidewidth, \slideheight+0.1cm); + \fill[color=PrimaryColor] (-1cm, 0.5\slideheight-1cm) rectangle(\slidewidth, 0.5\slideheight+1cm); + \node[text width=\the\paperwidth-1cm,align=center] at (0.4\slidewidth, 0.5\slideheight) {\color{BackgroundColor}\Huge\textbf{\insertsection}}; + \end{tikzpicture} +} diff --git a/lectures/lecture-n-1/gu.png b/lectures/lecture-n-1/gu.png new file mode 100644 index 0000000..ea2f1e5 Binary files /dev/null and b/lectures/lecture-n-1/gu.png differ diff --git a/lectures/lecture-n-1/sbx.png b/lectures/lecture-n-1/sbx.png new file mode 100644 index 0000000..6fa85bf Binary files /dev/null and b/lectures/lecture-n-1/sbx.png differ diff --git a/lectures/lecture-n-1/slides.md b/lectures/lecture-n-1/slides.md new file mode 100644 index 0000000..beb84f1 --- /dev/null +++ b/lectures/lecture-n-1/slides.md @@ -0,0 +1,92 @@ +--- +title: "The title" +subtitle: "and a possibly very long subtitle" +author: "The Author" +theme: "lucid" +logo: "gu.png" +date: "the date" +institute: "The Institution" +--- + +# The first section + +## The first slide +It just contains some __text__ in _various_ styles ~~in it~~. + +## The second slide +A first, multiline paragraph with some random words and even a correctly placed footnote![^1] + +And a second, shorter paragraph here. + +[^1]: This is the footnote. + +## Some nested bullet points +- one +- two + - one + - one + - two + - three + - two + - three +- three + +## And a nested numbered list +1. one +2. two + 1. one + 1. one + 2. two + 3. three + 2. two + 3. three +3. three + +## Another text slide + +Where the text + +### Is followed by a colorful subheading + +And some more text that doesn't say anything particularly interesting. + +## A quote +Introduced by some text, here are + +> Some words of wisdom + +And a closing comment. + +# The fancy section + +## An image +![With a caption](sbx.png) + +## Some code + +A syntax-highlighted code example: + +```haskell +haskellExample :: From -> To +haskellExample from = to +``` + +Plus some `inline monospaced text` just because we can. + +## A little bit of math mode +Here is a pretty random formula: + +$\int_{a}^{b} f(x)dx = F(b) - F(a)$ + +With equal spacing above and below, _obviously_. + +## And finally, a table + +As always, a very realistic example: + +| __col a__ | __col b__ | __col c__ | +| --- | --- | --- | +| a1 | b1 | c1 | +| a2 | b2 | c2 | + +# That's all! \ No newline at end of file diff --git a/lectures/lecture-n-1/slides.pdf b/lectures/lecture-n-1/slides.pdf new file mode 100644 index 0000000..ff18785 Binary files /dev/null and b/lectures/lecture-n-1/slides.pdf differ diff --git a/lectures/lecture-n-1/unipg.png b/lectures/lecture-n-1/unipg.png new file mode 100644 index 0000000..5b5dd60 Binary files /dev/null and b/lectures/lecture-n-1/unipg.png differ