├── man
├── .Rapp.history
├── youngmetro-package.Rd
└── metro_beamer.Rd
├── LICENSE
├── .gitignore
├── .DS_Store
├── inst
└── rmarkdown
│ ├── .DS_Store
│ └── templates
│ └── metro_beamer
│ ├── skeleton
│ ├── figs
│ │ ├── title_graphic.pdf
│ │ └── RStudio-Logo-Blue-Gray-250.png
│ └── skeleton.Rmd
│ ├── template.yaml
│ └── resources
│ └── template.tex
├── .Rbuildignore
├── R
├── youngmetro.R
├── utils.R
└── metro_beamer.R
├── NAMESPACE
├── .travis.yml
├── youngmetro.Rproj
├── DESCRIPTION
└── README.md
/man/.Rapp.history:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | YEAR: 2018
2 | COPYRIGHT HOLDER: Aaron Baggett
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .Rproj.user
2 | .Rhistory
3 | .RData
4 | .DS_Store
5 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronbaggett/youngmetro/HEAD/.DS_Store
--------------------------------------------------------------------------------
/inst/rmarkdown/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronbaggett/youngmetro/HEAD/inst/rmarkdown/.DS_Store
--------------------------------------------------------------------------------
/.Rbuildignore:
--------------------------------------------------------------------------------
1 | ^.*\.Rproj$
2 | ^\.Rproj\.user$
3 | ^\.travis\.yml$
4 | ^LICENSE\.md$
5 | ^README\.Rmd$
6 | ^scratch\.R$
7 |
--------------------------------------------------------------------------------
/R/youngmetro.R:
--------------------------------------------------------------------------------
1 | #' @details Trial run on RMarkdown templates
2 | #' @importFrom rmarkdown beamer_presentation
3 | "_PACKAGE"
4 |
--------------------------------------------------------------------------------
/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(metro_beamer)
4 | importFrom(rmarkdown,beamer_presentation)
5 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
2 |
3 | language: R
4 | sudo: false
5 | cache: packages
6 |
--------------------------------------------------------------------------------
/inst/rmarkdown/templates/metro_beamer/skeleton/figs/title_graphic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronbaggett/youngmetro/HEAD/inst/rmarkdown/templates/metro_beamer/skeleton/figs/title_graphic.pdf
--------------------------------------------------------------------------------
/inst/rmarkdown/templates/metro_beamer/template.yaml:
--------------------------------------------------------------------------------
1 | name: >
2 | youngmetro
3 | description: >
4 | A custom R Markdown Beamer presentation theme based on sthlm, HSRM, and Metropolis themes.
5 | create_dir: true
6 |
--------------------------------------------------------------------------------
/inst/rmarkdown/templates/metro_beamer/skeleton/figs/RStudio-Logo-Blue-Gray-250.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronbaggett/youngmetro/HEAD/inst/rmarkdown/templates/metro_beamer/skeleton/figs/RStudio-Logo-Blue-Gray-250.png
--------------------------------------------------------------------------------
/youngmetro.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: No
4 | SaveWorkspace: No
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: knitr
13 | LaTeX: pdfLaTeX
14 |
15 | AutoAppendNewline: Yes
16 | StripTrailingWhitespace: Yes
17 |
18 | BuildType: Package
19 | PackageUseDevtools: Yes
20 | PackageInstallArgs: --no-multiarch --with-keep.source
21 | PackageRoxygenize: rd,collate,namespace
22 |
--------------------------------------------------------------------------------
/R/utils.R:
--------------------------------------------------------------------------------
1 | # Borrowed from rticles to avoid having to deal w/ name space issues
2 | # Not exported
3 |
4 |
5 | find_file <- function(template, file) {
6 | template <- system.file("rmarkdown", "templates", template, file,
7 | package = "youngmetro")
8 | if (template == "") {
9 | stop("Couldn't find template file ", template, "/", file, call. = FALSE)
10 | }
11 |
12 | template
13 | }
14 |
15 | find_resource <- function(template, file) {
16 | find_file(template, file.path("resources", file))
17 | }
18 |
--------------------------------------------------------------------------------
/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: youngmetro
2 | Title: A Custom Beamer Theme in R Markdown
3 | Version: 0.0.0.9001
4 | Authors@R: person("Aaron", "Baggett", email = "abaggett@umhb.edu", role = c("aut", "cre"))
5 | Description: This package provides a custom R Markdown Beamer theme based on the sthlm, HSRM, and Metropolis themes.
6 | URL: https://github.com/aaronbagget/youngmetro
7 | BugReports: https://github.com/aaronbaggett/youngmetro/issues
8 | Depends: R (>= 3.4.0)
9 | License: MIT + file LICENSE
10 | Imports:
11 | rmarkdown (>= 1.1.0)
12 | RoxygenNote: 6.0.1
13 | Encoding: UTF-8
14 | LazyData: true
15 |
--------------------------------------------------------------------------------
/man/youngmetro-package.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/youngmetro.R
3 | \docType{package}
4 | \name{youngmetro-package}
5 | \alias{youngmetro}
6 | \alias{youngmetro-package}
7 | \title{youngmetro: A Custom Beamer Theme in R Markdown}
8 | \description{
9 | This package provides a custom R Markdown Beamer theme based on the sthlm, HSRM, and Metropolis themes.
10 | }
11 | \details{
12 | Trial run on RMarkdown templates
13 | }
14 | \seealso{
15 | Useful links:
16 | \itemize{
17 | \item \url{https://github.com/aaronbagget/youngmetro}
18 | \item Report bugs at \url{https://github.com/aaronbaggett/youngmetro/issues}
19 | }
20 |
21 | }
22 | \author{
23 | \strong{Maintainer}: Aaron Baggett \email{abaggett@umhb.edu}
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/R/metro_beamer.R:
--------------------------------------------------------------------------------
1 | #' A Custom Beamer Theme in R Markdown
2 | #'
3 | #' A custom R Markdown Beamer presentation theme based on sthlm, HSRM, and
4 | #' Metropolis themes.
5 | #' @inheritParams rmarkdown::beamer_presentation
6 | #' @return A modified \code{beamer_presentation} based on sthlm, HSRM, and
7 | #' Metropolis themes.
8 | #' @export
9 | #' @examples
10 | #' \dontrun{
11 | #' # Generate slide deck from beamer template
12 | #' rmarkdown::draft("slide_deck.Rmd", template = "metro_beamer", package = "youngmetro")
13 | #'
14 | #' # Compile the document
15 | #' rmarkdown::render("slide_deck.Rmd")
16 | #' }
17 | metro_beamer <- function(toc = FALSE,
18 | slide_level = 2,
19 | incremental = FALSE,
20 | fig_width = 10,
21 | fig_height = 7,
22 | fig_crop = TRUE,
23 | fig_caption = TRUE,
24 | dev = 'pdf',
25 | df_print = "default",
26 | fonttheme = "default",
27 | highlight = "tango",
28 | keep_tex = TRUE,
29 | latex_engine = "xelatex",
30 | citation_package = c("none", "natbib", "biblatex"),
31 | includes = NULL,
32 | md_extensions = NULL,
33 | pandoc_args = NULL){
34 |
35 | template <- find_resource("metro_beamer", "template.tex")
36 |
37 | rmarkdown::beamer_presentation(template = template,
38 | toc = toc,
39 | slide_level = slide_level,
40 | incremental = incremental,
41 | fig_width = fig_width,
42 | fig_height = fig_height,
43 | fig_crop = fig_crop,
44 | fig_caption = fig_caption,
45 | dev = dev,
46 | df_print = df_print,
47 | fonttheme = fonttheme,
48 | highlight = highlight,
49 | keep_tex = keep_tex,
50 | latex_engine = latex_engine,
51 | citation_package = citation_package,
52 | includes = includes,
53 | md_extensions = md_extensions,
54 | pandoc_args = pandoc_args)
55 |
56 | }
--------------------------------------------------------------------------------
/inst/rmarkdown/templates/metro_beamer/skeleton/skeleton.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Presentation Title"
3 | shorttitle: "Short Title"
4 | subtitle: "Presentation Subtitle"
5 | author: "Aaron R. Baggett, Ph.D."
6 | short-author: "Baggett"
7 | date: '`r format(Sys.Date(), "%B %d, %Y")`'
8 | short-date: '`r format(Sys.Date(), "%m/%d/%y")`'
9 | institute: |
10 | | University of Mary Hardin-Baylor
11 | | PSYC XXXX: COURSE TITLE
12 | short-institute: "PSYC XXXX"
13 | department: "Department of Psychology" # Institute must be defined
14 | mainfont: Roboto
15 | monofont: Lucida Console
16 | fontsize: 14pt
17 | classoption: aspectratio = 1610
18 | output:
19 | youngmetro::metro_beamer
20 | ---
21 |
22 | ```{r setup, include=FALSE}
23 | knitr::opts_chunk$set(echo = TRUE)
24 | if (!require("tidyverse")) {
25 | install.packages("tidyverse", dependencies = TRUE)
26 | }
27 | library(tidyverse)
28 | ```
29 |
30 | # Block Quote
31 |
32 | ## Block Quote
33 |
34 | > Way too many questions you must think I trust you
35 | > You searching for answers I do not know nothing
36 |
37 | # Ordered List
38 |
39 | ## Ordered List
40 | - My favorite **R** packages:
41 | 1. **`ggplot2`**
42 | 2. **`dplyr`**
43 | 3. **`fivethirtyeight`**
44 |
45 | # Unordered List
46 |
47 | ## Unordered List
48 | - Item 1
49 | - Item 2
50 | - Item 2.1
51 | - Item 2.2
52 | - Item 3
53 |
54 | # R Code
55 |
56 | ## R Code
57 | Here is some **R** code
58 |
59 | \scriptsize
60 | ```{r, eval = FALSE}
61 | # Load data
62 | data(ggplot2::txhousing)
63 |
64 | # Compare monthly home sales in Austin, TX (2006, 2009)
65 | tx_bubble <- txhousing %>%
66 | group_by(month, year) %>%
67 | filter(city == "Austin") %>%
68 | filter(year == "2006" | year == "2009") %>%
69 | summarize(sales = sum(sales))
70 | ```
71 |
72 | # Equations
73 |
74 | ## Equations
75 | - Calculate sample variance ($s^2$)
76 |
77 | \begin{equation}
78 | {s}^{2}=\frac{1}{n-1}\sum{{({X}_{i}-\bar{X})}^{2}}
79 | \label{eq:variance}
80 | \end{equation}
81 |
82 | # Images
83 |
84 | ## Images
85 |
86 | \begin{figure}
87 | \begin{center}
88 | \includegraphics[width = 2.5in]{RStudio-Logo-Blue-Gray-250.png}
89 | \caption{RStudio Logo}
90 | \label{rslogo}
91 | \end{center}
92 | \end{figure}
93 |
94 | # R Figures
95 |
96 | ## R Figures
97 | ```{r, eval = TRUE, echo=FALSE}
98 | # Compare monthly home sales in Austin, TX (2006, 2009)
99 | tx_bubble <- txhousing %>%
100 | group_by(month, year) %>%
101 | filter(city == "Austin") %>%
102 | filter(year == "2006" | year == "2009") %>%
103 | summarize(sales = sum(sales))
104 |
105 | # Line plot of monthly home sales in Austin, TX, 2006 and 2009
106 | ggplot(data = tx_bubble, aes(x = month, y = sales, color = factor(year))) +
107 | geom_point(size = 2.5) + geom_line() +
108 | scale_x_continuous(breaks = seq(1, 12, 1), name = "\nMonth") +
109 | scale_y_continuous(limits = c(500, 3500),
110 | breaks = seq(500, 3500, 500), name = "Number of Sales\n") +
111 | scale_color_manual(values = c("dodgerblue", "tomato"),
112 | name = "Year") + theme_classic() +
113 | theme(axis.title = element_text(size = 13,
114 | face = "bold"), axis.text = element_text(size = 11)) +
115 | theme(legend.text = element_text(size = 11),
116 | legend.title = element_text(size = 13, face = "bold")) +
117 | theme(legend.position = "right")
118 | ```
119 |
120 | # Links
121 |
122 | ## Links
123 | - \url{http://aaronbaggett.com}
124 | - See also the image in Figure \ref{rslogo}
125 |
126 | # Blocks
127 |
128 | ## Blocks
129 | \begin{block}{Block Title Here}
130 | \begin{itemize}
131 | \item point 1
132 | \item point 2
133 | \end{itemize}
134 | \end{block}
135 |
136 | ## Blocks
137 | \begin{alertblock}{Alert Block}
138 | Highlight important information.
139 | \end{alertblock}
140 |
141 | ## Blocks
142 | \begin{exampleblock}{Example Block}
143 | Examples can be good.
144 | \end{exampleblock}
145 |
146 | # Closing Slide
147 |
--------------------------------------------------------------------------------
/man/metro_beamer.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/metro_beamer.R
3 | \name{metro_beamer}
4 | \alias{metro_beamer}
5 | \title{A Custom Beamer Theme in R Markdown}
6 | \usage{
7 | metro_beamer(toc = FALSE, slide_level = 2, incremental = FALSE,
8 | fig_width = 10, fig_height = 7, fig_crop = TRUE, fig_caption = TRUE,
9 | dev = "pdf", df_print = "default", fonttheme = "default",
10 | highlight = "tango", keep_tex = TRUE, latex_engine = "xelatex",
11 | citation_package = c("none", "natbib", "biblatex"), includes = NULL,
12 | md_extensions = NULL, pandoc_args = NULL)
13 | }
14 | \arguments{
15 | \item{toc}{\code{TRUE} to include a table of contents in the output (only
16 | level 1 headers will be included in the table of contents).}
17 |
18 | \item{slide_level}{The heading level which defines individual slides. By
19 | default this is the highest header level in the hierarchy that is followed
20 | immediately by content, and not another header, somewhere in the document.
21 | This default can be overridden by specifying an explicit
22 | \code{slide_level}.}
23 |
24 | \item{incremental}{\code{TRUE} to render slide bullets incrementally. Note
25 | that if you want to reverse the default incremental behavior for an
26 | individual bullet you can precede it with \code{>}. For example:
27 | \emph{\code{> - Bullet Text}}}
28 |
29 | \item{fig_width}{Default width (in inches) for figures}
30 |
31 | \item{fig_height}{Default width (in inches) for figures}
32 |
33 | \item{fig_crop}{\code{TRUE} to automatically apply the \code{pdfcrop} utility
34 | (if available) to pdf figures}
35 |
36 | \item{fig_caption}{\code{TRUE} to render figures with captions}
37 |
38 | \item{dev}{Graphics device to use for figure output (defaults to pdf)}
39 |
40 | \item{df_print}{Method to be used for printing data frames. Valid values
41 | include "default", "kable", "tibble", and "paged". The "default" method uses
42 | \code{print.data.frame}. The "kable" method uses the
43 | \code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses
44 | the \pkg{tibble} package to print a summary of the data frame. The "paged"
45 | method creates a paginated HTML table (note that this method is only valid
46 | for formats that produce HTML). In addition
47 | to the named methods you can also pass an arbitrary function to be used
48 | for printing data frames. You can disable the df_print behavior entirely
49 | by setting the option \code{rmarkdown.df_print} to \code{FALSE}.}
50 |
51 | \item{fonttheme}{Beamer font theme (e.g. "structurebold").}
52 |
53 | \item{highlight}{Syntax highlighting style. Supported styles include
54 | "default", "tango", "pygments", "kate", "monochrome", "espresso",
55 | "zenburn", and "haddock". Pass \code{NULL} to prevent syntax highlighting.}
56 |
57 | \item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF}
58 |
59 | \item{latex_engine}{LaTeX engine for producing PDF output. Options are
60 | "pdflatex", "lualatex", and "xelatex".}
61 |
62 | \item{citation_package}{The LaTeX package to process citations, \code{natbib}
63 | or \code{biblatex}. Use \code{none} if neither package is to be used.}
64 |
65 | \item{includes}{Named list of additional content to include within the
66 | document (typically created using the \code{\link{includes}} function).}
67 |
68 | \item{md_extensions}{Markdown extensions to be added or removed from the
69 | default definition or R Markdown. See the \code{\link{rmarkdown_format}} for
70 | additional details.}
71 |
72 | \item{pandoc_args}{Additional command line options to pass to pandoc}
73 | }
74 | \value{
75 | A modified \code{beamer_presentation} based on sthlm, HSRM, and
76 | Metropolis themes.
77 | }
78 | \description{
79 | A custom R Markdown Beamer presentation theme based on sthlm, HSRM, and
80 | Metropolis themes.
81 | }
82 | \examples{
83 | \dontrun{
84 | # Generate slide deck from beamer template
85 | rmarkdown::draft("slide_deck.Rmd", template = "metro_beamer", package = "youngmetro")
86 |
87 | # Compile the document
88 | rmarkdown::render("slide_deck.Rmd")
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # youngmetro
3 |
4 | [](https://travis-ci.org/aaronbaggett/youngmetro)
6 |
7 |
8 |
9 | > Way too many questions you must think I trust you
10 | > You searching for answers I do not know nothing
11 |
12 | -----
13 |
14 | ## Overview 🏙️
15 |
16 | The **youngmetro** package is a semi-custom beamer theme for use in
17 | RStudio via R Markdown. This theme borrows heavily from the
18 | [HSRM](https://github.com/benjamin-weiss/hsrmbeamertheme),
19 | [sthlm](https://github.com/markolsonse/sthlmBeamerTheme), and
20 | [Metropolis](https://github.com/matze/mtheme) Beamer themes.
21 |
22 | ## Installation 🔌
23 |
24 | ``` r
25 | if (!require("devtools")) {
26 | install.packages("devtools", dependencies = TRUE)
27 | }
28 | devtools::install_github("aaronbaggett/youngmetro")
29 | ```
30 |
31 | ## Usage 💻
32 |
33 | ### RStudio
34 |
35 | The `youngmetro` theme is designed to be used primarily within RStudio.
36 | Once installed, select *File* \> *New File* \> *R Markdown* \> *From
37 | Template* \> `youngmetro`. After naming and selecting a location for
38 | your prestnation, a new R Markdown document will open in the Source
39 | pane. This document contains some basic information that you will want
40 | to update (see **Front Matter**
41 | below).
42 |
43 |
44 |
45 | ### R
46 |
47 | The following should work if you would like to use `youngmetro` outside
48 | of
49 | RStudio:
50 |
51 | ``` r
52 | rmarkdown::draft("slide_deck.Rmd", template = "metro_beamer", package = "youngmetro")
53 |
54 | rmarkdown::render("slide_deck.Rmd")
55 | ```
56 |
57 | ### Front Matter
58 |
59 | The Pandoc YAML is pre-populated with the following:
60 |
61 | ``` yaml
62 | ---
63 | title: "Presentation Title"
64 | shorttitle: "Short Title"
65 | subtitle: "Presentation Subtitle"
66 | author: "Aaron R. Baggett, Ph.D."
67 | short-author: "Baggett"
68 | date: '`r format(Sys.Date(), "%B %d, %Y")`'
69 | short-date: '`r format(Sys.Date(), "%m/%d/%y")`'
70 | institute: |
71 | | University of Mary Hardin-Baylor
72 | | PSYC XXXX: COURSE TITLE
73 | short-institute: "PSYC XXXX"
74 | department: "Department of Psychology" # Institute must be defined
75 | mainfont: Roboto
76 | monofont: Lucida Console
77 | monofont: Lucida Console
78 | fontsize: 14pt
79 | classoption: aspectratio = 1610
80 | output:
81 | youngmetro::metro_beamer
82 | ---
83 | ```
84 |
85 | ### Title Graphic
86 |
87 | I designed this slide deck to pretty much serve myself. I wanted an easy
88 | way to generate custom .Rmd Beamer slides for my classes. That said, you
89 | probably want to swap out the example image for your own university’s
90 | logo. Until I come up with a better solution, you will need to do the
91 | following:
92 |
93 | 1. Rename your title graphic to `title_graphic`
94 | 2. Place *your* `title_graphic` in the `figs` folder
95 | 3. Accept replacement warning
96 |
97 | That should do the trick.
98 |
99 | ### Figures
100 |
101 | Place all figures in the `figs` folder and refer directly to the
102 | filename with no directory mapping required. For example:
103 |
104 | ``` r
105 | \includegraphics{file_name.EXT}
106 | ```
107 |
108 | ### XeLaTeX
109 |
110 | `youngmetro` uses XeLaTeX as the default TeX typesetting engine. Just
111 | comment out the `mainfont:` and `monofont` options in the front matter.
112 | This should revert back to Pandoc’s defaults.
113 |
114 | ``` yaml
115 | ---
116 | # mainfont: Roboto
117 | # monofont: Lucida Console
118 | ---
119 | ```
120 |
121 | Note: Roboto can be downloaded free from Google Fonts
122 | [here](https://fonts.google.com/specimen/Roboto).
123 |
124 | ### Emoji
125 |
126 | There’s not really an easy way to add emoji to pdf LaTeX documents 😡.
127 | Most packages require including emoji as essentially .png or .pdf files
128 | 🤕. Unfortunately, at the moment, the
129 | [`emo`](https://github.com/hadley/emo) package does not provide
130 | functionality for pdf documents. One alternative would be to use one of
131 | several [emoji
132 | extractors](https://github.com/rinatkhanov/emoji-extractor). Even still,
133 | you are forced to include emoji as an image. One problem with this
134 | method is that, althogh the emoji images are fairly high-resolution,
135 | they are named in sequential order. In other words, the Unicode
136 | characters are lost in the file names, which makes it difficult to
137 | search for the emoji you want.
138 |
--------------------------------------------------------------------------------
/inst/rmarkdown/templates/metro_beamer/resources/template.tex:
--------------------------------------------------------------------------------
1 | \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(handout)$handout,$endif$$if(colorlinks)$dvipsnames,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2 | \setbeamertemplate{caption}[numbered]
3 | \setbeamertemplate{caption label separator}{: }
4 | \setbeamercolor{caption name}{fg=normal text.fg}
5 | \beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
6 | $if(fontfamily)$
7 | \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
8 | $else$
9 | \usepackage{lmodern}
10 | $endif$
11 | \usepackage{amssymb,amsmath}
12 | \usepackage{ifxetex,ifluatex}
13 | \usepackage{fixltx2e} % provides \textsubscript
14 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
15 | \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
16 | \usepackage[utf8]{inputenc}
17 | $if(euro)$
18 | \usepackage{eurosym}
19 | $endif$
20 | \else % if luatex or xelatex
21 | \ifxetex
22 | \usepackage{mathspec}
23 | \else
24 | \usepackage{fontspec}
25 | \fi
26 | \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
27 | $for(fontfamilies)$
28 | \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
29 | $endfor$
30 | $if(euro)$
31 | \newcommand{\euro}{€}
32 | $endif$
33 | $if(mainfont)$
34 | \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
35 | $endif$
36 | $if(sansfont)$
37 | \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
38 | $endif$
39 | $if(monofont)$
40 | \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
41 | $endif$
42 | $if(mathfont)$
43 | \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
44 | $endif$
45 | $if(CJKmainfont)$
46 | \usepackage{xeCJK}
47 | \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
48 | $endif$
49 | \fi
50 | $if(theme)$
51 | \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
52 | $endif$
53 | $if(colortheme)$
54 | \usecolortheme{$colortheme$}
55 | $endif$
56 | $if(fonttheme)$
57 | \usefonttheme{$fonttheme$}
58 | $endif$
59 | $if(mainfont)$
60 | \usefonttheme{serif} % use mainfont rather than sansfont for slide text
61 | $endif$
62 | $if(innertheme)$
63 | \useinnertheme{$innertheme$}
64 | $endif$
65 | $if(outertheme)$
66 | \useoutertheme{$outertheme$}
67 | $endif$
68 | % use upquote if available, for straight quotes in verbatim environments
69 | \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
70 | % use microtype if available
71 | \IfFileExists{microtype.sty}{%
72 | \usepackage{microtype}
73 | \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
74 | }{}
75 | $if(lang)$
76 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
77 | \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
78 | $if(babel-newcommands)$
79 | $babel-newcommands$
80 | $endif$
81 | \else
82 | \usepackage{polyglossia}
83 | \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
84 | $for(polyglossia-otherlangs)$
85 | \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
86 | $endfor$
87 | \fi
88 | $endif$
89 | \newif\ifbibliography
90 | $if(natbib)$
91 | \usepackage{natbib}
92 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
93 | $endif$
94 | $if(biblatex)$
95 | \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
96 | $for(bibliography)$
97 | \addbibresource{$bibliography$}
98 | $endfor$
99 | $endif$
100 | $if(verbatim-in-note)$
101 | \usepackage{fancyvrb}
102 | $endif$
103 | \hypersetup{
104 | $if(title-meta)$
105 | pdftitle={$title-meta$},
106 | $endif$
107 | $if(author-meta)$
108 | pdfauthor={$author-meta$},
109 | $endif$
110 | $if(keywords)$
111 | pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
112 | $endif$
113 | $if(colorlinks)$
114 | colorlinks=true,
115 | linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
116 | citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
117 | urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
118 | $else$
119 | pdfborder={0 0 0},
120 | $endif$
121 | breaklinks=true}
122 | %\urlstyle{same} % Use monospace font for urls
123 | $if(verbatim-in-note)$
124 | \VerbatimFootnotes % allows verbatim text in footnotes
125 | $endif$
126 | $if(listings)$
127 | \usepackage{listings}
128 | $endif$
129 | $if(lhs)$
130 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
131 | $endif$
132 | $if(highlighting-macros)$
133 | $highlighting-macros$
134 | $endif$
135 | $if(tables)$
136 | \usepackage{longtable,booktabs}
137 | \usepackage{caption}
138 | % These lines are needed to make table captions work with longtable:
139 | \makeatletter
140 | \def\fnum@table{\tablename~\thetable}
141 | \makeatother
142 | $endif$
143 | $if(graphics)$
144 | \usepackage{graphicx,grffile}
145 | \makeatletter
146 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
147 | \def\maxheight{\ifdim\Gin@nat@height>\textheight0.8\textheight\else\Gin@nat@height\fi}
148 | \makeatother
149 | % Scale images if necessary, so that they will not overflow the page
150 | % margins by default, and it is still possible to overwrite the defaults
151 | % using explicit options in \includegraphics[width, height, ...]{}
152 | \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
153 | $endif$
154 |
155 | % Prevent slide breaks in the middle of a paragraph:
156 | \widowpenalties 1 10000
157 | \raggedbottom
158 |
159 | $if(section-titles)$
160 | \AtBeginPart{
161 | \let\insertpartnumber\relax
162 | \let\partname\relax
163 | \frame{\partpage}
164 | }
165 | \AtBeginSection{
166 | \ifbibliography
167 | \else
168 | \let\insertsectionnumber\relax
169 | \let\sectionname\relax
170 | \frame{\sectionpage}
171 | \fi
172 | }
173 | \AtBeginSubsection{
174 | \let\insertsubsectionnumber\relax
175 | \let\subsectionname\relax
176 | \frame{\subsectionpage}
177 | }
178 | $endif$
179 |
180 | $if(links-as-notes)$
181 | % Make links footnotes instead of hotlinks:
182 | \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
183 | $endif$
184 | $if(strikeout)$
185 | \usepackage[normalem]{ulem}
186 | % avoid problems with \sout in headers with hyperref:
187 | \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
188 | $endif$
189 | \setlength{\parindent}{0pt}
190 | \setlength{\parskip}{6pt plus 2pt minus 1pt}
191 | \setlength{\emergencystretch}{3em} % prevent overfull lines
192 | \providecommand{\tightlist}{%
193 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
194 | $if(numbersections)$
195 | \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
196 | $else$
197 | \setcounter{secnumdepth}{0}
198 | $endif$
199 | $if(dir)$
200 | \ifxetex
201 | % load bidi as late as possible as it modifies e.g. graphicx
202 | $if(latex-dir-rtl)$
203 | \usepackage[RTLdocument]{bidi}
204 | $else$
205 | \usepackage{bidi}
206 | $endif$
207 | \fi
208 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
209 | \TeXXeTstate=1
210 | \newcommand{\RL}[1]{\beginR #1\endR}
211 | \newcommand{\LR}[1]{\beginL #1\endL}
212 | \newenvironment{RTL}{\beginR}{\endR}
213 | \newenvironment{LTR}{\beginL}{\endL}
214 | \fi
215 | $endif$
216 | $for(header-includes)$
217 | $header-includes$
218 | $endfor$
219 |
220 |
221 | $if(title)$
222 | \title[$shorttitle$]{$title$}
223 | $endif$
224 | $if(subtitle)$
225 | \subtitle{$subtitle$}
226 | $endif$
227 | $if(author)$
228 | \author[
229 | $if(short-author)$
230 | $for(short-author)$$short-author$$sep$ \and $endfor$
231 | $else$
232 | $for(author)$$author$$sep$ \and $endfor$
233 | $endif$
234 | ]{$for(author)$$author$$sep$ \and $endfor$}
235 | $endif$
236 | $if(institute)$
237 | \institute[
238 | $if(short-institute)$
239 | $for(short-institute)$$short-institute$$sep$ \and $endfor$
240 | $endif$
241 | ]{
242 | $if(department)$
243 | $for(department)$$department$$sep$ \and $endfor$ \\
244 | $endif$
245 | $for(institute)$$institute$$sep$ \and $endfor$
246 | $if(email)$
247 | \\ $for(email)$ \href{mailto:$email$}{\nolinkurl{$email$}}$sep$ \and $endfor$
248 | $endif$
249 | }
250 | $endif$
251 | \date[
252 | $if(short-date)$
253 | $short-date$
254 | $else$
255 | $date$
256 | $endif$]{
257 | $if(date)$
258 | $date$
259 | $if(license)$
260 | \\ \vspace{5mm}
261 | $endif$
262 | $endif$
263 | $if(license)$
264 | {\scriptsize $license$}
265 | $endif$
266 | }
267 |
268 | % ------------------------------------------------------------------------------------------------
269 | % BELOW ARE MY ADDITIONS
270 | % ------------------------------------------------------------------------------------------------
271 |
272 | % ------------------------------------------------------------------------------------------------
273 | % PACKAGE LIST
274 | % ------------------------------------------------------------------------------------------------
275 | \usepackage{
276 | booktabs,
277 | %fontspec,
278 | graphicx,
279 | multicol,
280 | pgfplots,
281 | ragged2e,
282 | tabularx,
283 | tikz,
284 | wasysym,
285 | hyperref,
286 | hanging,
287 | multirow,
288 | eso-pic,
289 | }
290 |
291 | \usepackage[export]{adjustbox}
292 | % ------------------------------------------------------------------------------------------------
293 | % GRAPHICS PATH
294 | % ------------------------------------------------------------------------------------------------
295 | \graphicspath{{./figs/}}
296 |
297 |
298 | % ------------------------------------------------------------------------------------------------
299 | % TABLE OF CONTENTS
300 | % ------------------------------------------------------------------------------------------------
301 | \useoutertheme[subsection=false,shadow]{miniframes}
302 | \setbeamertemplate{section in toc}[sections numbered]
303 | \setbeamertemplate{subsection in toc}[subsections numbered]
304 |
305 | % ------------------------------------------------------------------------------------------------
306 | % ITEMIZE
307 | % ------------------------------------------------------------------------------------------------
308 | \setbeamertemplate{itemize item}{$$\bullet$$}
309 | \setbeamertemplate{itemize subitem}{$$\circ$$}
310 | \setbeamertemplate{itemize subsubitem}{$$\bullet$$}
311 |
312 | \setlength{\parskip}{0.5em}
313 |
314 | % ------------------------------------------------------------------------------------------------
315 | % COLORS
316 | % ------------------------------------------------------------------------------------------------
317 |
318 | % sthlm Colors
319 | \definecolor{sthlmLightBlue}{RGB}{90,200,250}
320 | \definecolor{sthlmBlue}{RGB}{52,170,220}
321 | \definecolor{sthlmDarkBlue}{RGB}{0,122,255}
322 | \definecolor{sthlmLightRed}{RGB}{255,45,85}
323 | \definecolor{sthlmRed}{RGB}{255,59,48}
324 | \definecolor{sthlmLightYellow}{RGB}{255,204,0}
325 | \definecolor{sthlmYellow}{RGB}{255,149,0}
326 | \definecolor{sthlmPurple}{RGB}{88,86,214}
327 | \definecolor{sthlmGreen}{RGB}{76,217,100}
328 | \definecolor{sthlmGrey}{RGB}{142,142,147}
329 | \definecolor{sthlmLightGrey}{RGB}{233,233,233}
330 | \definecolor{sthlmDarkGrey}{RGB}{61,61,70}
331 |
332 | % General
333 | \setbeamercolor{normal text}{fg=sthlmDarkGrey}
334 | \hypersetup{colorlinks=true, urlcolor=sthlmDarkBlue, linkcolor=sthlmDarkGrey, citecolor=sthlmDarkBlue}
335 | \setbeamercolor{structure}{fg=sthlmDarkGrey}
336 | \setbeamercolor{alerted text}{fg=sthlmRed}
337 | \setbeamercolor{example text}{fg=white}
338 | \setbeamercolor{copyright text}{fg=sthlmLightBlue}
339 | \setbeamercolor{palette primary}{fg=sthlmDarkGrey}
340 | \setbeamercolor{palette secondary}{fg=sthlmDarkGrey,bg=sthlmLightGrey}
341 | \setbeamercolor{palette tertiary}{fg=black,bg=sthlmDarkGrey}
342 | \setbeamercolor{palette quaternary}{fg=white, bg=sthlmDarkGrey}
343 |
344 | \setbeamercolor{mini frame}{bg=sthlmLightGrey}
345 | \setbeamercolor{section in head/foot}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
346 |
347 | % Titlepage
348 | \setbeamercolor{title}{parent=normal text}
349 | \setbeamercolor{subtitle}{parent=normal text}
350 | \setbeamercolor{institute}{parent=normal text}
351 |
352 | % Content
353 | \setbeamercolor{frametitle}{parent=palette quaternary}
354 |
355 | % Blocks
356 | \setbeamercolor{block title}{fg=white,bg=sthlmDarkBlue}
357 | \setbeamercolor{block body}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
358 | \setbeamercolor{block title example}{fg=white, bg=sthlmGreen}
359 | \setbeamercolor{block body example}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
360 | \setbeamercolor{block title alerted}{fg=white, bg=sthlmLightRed}
361 | \setbeamercolor{block body alerted}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
362 |
363 | % Notes
364 | \setbeamercolor{note page}{fg=sthlmDarkGrey,bg=sthlmLightGrey}
365 | \setbeamercolor{note title}{fg=white, bg=sthlmDarkGrey}
366 | \setbeamercolor{note date}{parent=note title}
367 |
368 | % Page Number
369 | \setbeamercolor{page number in head/foot}{fg=sthlmDarkGrey}
370 |
371 | \setbeamercolor{qed}{fg=sthlmGrey}
372 | \setbeamercolor{itemize item}{fg=sthlmDarkBlue}
373 | \setbeamercolor{itemize subitem}{fg=sthlmDarkBlue}
374 | \setbeamercolor{itemize subsubitem}{fg=sthlmDarkBlue}
375 |
376 | % ------------------------------------------------------------------------------------------------
377 | % FONTS
378 | % ------------------------------------------------------------------------------------------------
379 |
380 | % General
381 |
382 | %% Declare fontfamilys
383 | %\if@doNoFlama%
384 | % % Sans serif math option
385 | % \if@doSans%
386 | % % Sans serif math
387 | % \usepackage{fontspec}%
388 | % \setmainfont{Arial Regular}%
389 | % \else%
390 | % % Serif math
391 | % \usefonttheme{professionalfonts}%
392 | % \usepackage[no-math]{fontspec}%
393 | % \fi%
394 | %
395 | % \newfontfamily\Light{Arial Regular}%
396 | % \newfontfamily\Book{Arial Black Regular}%
397 | % \newfontfamily\bfseries{Arial Bold}%
398 | % \setsansfont{Arial Regular}%
399 | %\else%
400 | % % Sans serif math option
401 | % \if@doSans%
402 | % % Sans serif math
403 | % \usepackage{fontspec}%
404 | % \setmainfont{FlamaLight}%
405 | % \else%
406 | % % Serif math
407 | % \usefonttheme{professionalfonts}%
408 | % \usepackage[no-math]{fontspec}%
409 | % \fi%
410 | %
411 | % \newfontfamily\Light{FlamaLight}%
412 | % \newfontfamily\Book{FlamaBook}%
413 | % \newfontfamily\bfseries{FlamaMedium}%
414 | % \setsansfont{FlamaLight}%
415 | % %\newfontfamily\texttt{SourceCodePro-Light}
416 | %\fi%
417 | %
418 | %%\renewcommand\UrlFont{\texttt}
419 | %
420 | %% Font sizes
421 | %
422 | %% Titlepage
423 | %\setbeamerfont{title}{family=\bfseries,size=\fontsize{24}{26}}
424 | %\setbeamerfont{subtitle}{family=\Light,size=\fontsize{14}{18}}
425 | %\setbeamerfont{subtitle}{size=\fontsize{14}{18}}
426 | %\setbeamerfont{date}{size=\fontsize{9}{11}}
427 | %\setbeamerfont{author}{family=\bfseries,size=\fontsize{13}{15}}
428 | %\setbeamerfont{institute}{size=\fontsize{09}{10}}
429 | %
430 | %% Section
431 | %\setbeamerfont{section title}{size*={39pt}{24pt}, family = \bfseries, series=\bfseries}% Content
432 | %\setbeamerfont{frametitle}{family=\bfseries,size=\large}
433 | %\setbeamerfont{copyright text}{family=\Light,size=\tiny}
434 | %\setbeamerfont{block title}{family=\Book,size=\large}
435 | %\setbeamerfont{block title alerted}{family=\Book,size=\large}
436 | %\setbeamerfont{alerted text}{family=\bfseries}
437 | %
438 | %%Captions
439 | %\setbeamerfont{caption name}{family=\Book}
440 |
441 |
442 |
443 |
444 | %% ------------------------------------------------------------------------------------------------
445 | %% FONT ASSIGMENTS
446 | %% ------------------------------------------------------------------------------------------------
447 | %% Title Page
448 | %\newfontfamily\Light{Roboto Light}
449 | %\setbeamerfont{title}{size=\LARGE, series=\bfseries}
450 | %\setbeamerfont{subtitle}{family=\Light, size=\small, shape=\normalfont}
451 | %\setbeamerfont{date}{family=\Light, size=\footnotesize}
452 | %\setbeamerfont{author}{size=\small, series=\bfseries}
453 | %\setbeamerfont{institute}{family=\Light, size=\scriptsize}
454 | %
455 | %% Section
456 | %\setbeamerfont{section title}{size=\Huge}
457 | %
458 | %% Content
459 | %\setbeamerfont{frametitle}{size=\Large, series=\bfseries}
460 | %\setbeamerfont{copyright text}{size=\tiny}
461 | %\setbeamerfont{block title}{size=\large, series=\bfseries}
462 | %\setbeamerfont{block title alerted}{size=\large, series=\bfseries}
463 | %\setbeamerfont{block title example}{size=\large, series=\bfseries}
464 | %
465 | %\setbeamerfont{caption}{size=\small}
466 | %\setbeamerfont{caption name}{family=\small}
467 |
468 | % ------------------------------------------------------------------------------------------------
469 | % FONT ASSIGMENTS
470 | % ------------------------------------------------------------------------------------------------
471 | % Title Page
472 | %\newfontfamily\Light{Roboto Light}
473 | \setbeamerfont{title}{size=\LARGE, series=\bfseries}
474 | \setbeamerfont{subtitle}{size=\small, shape=\normalfont}
475 | \setbeamerfont{date}{size=\footnotesize}
476 | \setbeamerfont{author}{size=\small, series=\bfseries}
477 | \setbeamerfont{institute}{size=\scriptsize}
478 |
479 | % Section
480 | \setbeamerfont{section title}{size=\Huge}
481 |
482 | % Content
483 | \setbeamerfont{frametitle}{size=\Large, series=\bfseries}
484 | \setbeamerfont{copyright text}{size=\tiny}
485 | \setbeamerfont{block title}{size=\large, series=\bfseries}
486 | \setbeamerfont{block title alerted}{size=\large, series=\bfseries}
487 | \setbeamerfont{block title example}{size=\large, series=\bfseries}
488 |
489 | \setbeamerfont{caption}{size=\small}
490 | \setbeamerfont{caption name}{family=\small}
491 |
492 | % ------------------------------------------------------------------------------------------------
493 | % TITLE PAGE
494 | % ------------------------------------------------------------------------------------------------
495 |
496 | \newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{%
497 | \put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
498 | }}%
499 | \newcommand\AtPageLowerRight[1]{\AtPageLowerLeft{%
500 | \put(\LenToUnit{\paperwidth},\LenToUnit{0\paperheight}){#1}%
501 | }}%
502 |
503 | %\AddToShipoutPictureBG*{% Add picture to current page
504 | % \AtStockLowerLeft{% Add picture to lower-left corner of paper stock
505 | % \includegraphics[width=\stockwidth,height=\stockheight]{tiger}}% http://latex.tug.org/texlive/devsrc/Master/texmf-dist/doc/generic/pstricks/images/tiger.eps
506 | %}
507 |
508 | % Titlepage structure
509 | \def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi}
510 | \def\titlepage{\usebeamertemplate{title page}}
511 | \setbeamertemplate{title page}
512 | %\frame[plain]{\titlepage}
513 | {
514 | % Add background to title page
515 | %\AddToShipoutPictureFG*{\includegraphics[width=\paperwidth]{backgroundiegs.pdf}}
516 | \AddToShipoutPictureFG*{
517 | \AtPageLowerRight{\put(-95, 0){
518 | \includegraphics[width=.2\paperwidth]{title_graphic.pdf}}}}
519 | %\AddToShipoutPictureFG*{\includegraphics[width=\paperwidth]{youngmetro_logo.png}}
520 | \begin{minipage}[b][\paperheight]{\textwidth}
521 | %\vspace*{5mm}
522 | %\includegraphics[height=14mm]{./logo}\par
523 | \vspace*{20mm}
524 | \ifx\insertsubtitle\@empty%
525 | \else%
526 | {\usebeamerfont{title}\usebeamercolor[fg]{title}\MakeUppercase{\inserttitle}\parskip0pt\par}%
527 | \fi%
528 | \ifx\insertsubtitle\@empty%
529 | \else%
530 | {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
531 | \vspace*{5mm}
532 | \fi%
533 | \ifx\insertdate\@empty%
534 | \else%
535 | {\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate\par}%
536 | \fi%
537 |
538 | \vfill
539 |
540 | \ifx\insertauthor\@empty%
541 | \else%
542 | {\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor\par}%
543 | \fi%
544 | \ifx\insertinstitut\@empty%
545 | \else%
546 | \vspace*{1mm}
547 | {\usebeamerfont{institute}\usebeamercolor[sthlmDarkBlue]{institute}\insertinstitute\par}%
548 | \fi%
549 | \vspace*{5mm}
550 | \end{minipage}
551 | }
552 |
553 | % ------------------------------------------------------------------------------------------------
554 | % SECTION PAGES
555 | % ------------------------------------------------------------------------------------------------
556 |
557 | % Make Sectionhead uppercase
558 | \newcommand{\insertsectionHEAD}{%
559 | \expandafter\insertsectionHEADaux\insertsectionhead}
560 | \newcommand{\insertsectionHEADaux}[3]{\MakeUppercase{#3}
561 | }
562 |
563 | \if@doSectionPage\@empty
564 | \else
565 | % Insert frame with section title at every section start
566 | \AtBeginSection[]
567 | {
568 | \begingroup
569 | \setbeamercolor{background canvas}{bg=sthlmDarkGrey}
570 | \begin{frame}[plain]
571 | \centering
572 | \vfill\usebeamerfont{section title}\textcolor{white}{\insertsectionHEAD}\vfill
573 | \end{frame}
574 | \endgroup
575 | }
576 | \fi
577 |
578 | % ------------------------------------------------------------------------------------------------
579 | % HEADLINE
580 | % ------------------------------------------------------------------------------------------------
581 | \makeatletter
582 | \def\progressbar@progressbar{} % the progress bar
583 | \newcount\progressbar@tmpcounta% auxiliary counter
584 | \newcount\progressbar@tmpcountb% auxiliary counter
585 | \newdimen\progressbar@pbht %progressbar height
586 | \newdimen\progressbar@pbwd %progressbar width
587 | \newdimen\progressbar@tmpdim % auxiliary dimension
588 |
589 | \progressbar@pbwd=\paperwidth
590 | \progressbar@pbht=1.25ex
591 |
592 | % the progress bar
593 | \def\progressbar@progressbar{%
594 | \progressbar@tmpcounta=\insertframenumber
595 | \progressbar@tmpcountb=\inserttotalframenumber
596 | \progressbar@tmpdim=\progressbar@pbwd
597 | % \divide\progressbar@tmpdim by 100
598 | % \multiply\progressbar@tmpdim by \progressbar@tmpcounta
599 | % \divide\progressbar@tmpdim by \progressbar@tmpcountb
600 | % \multiply\progressbar@tmpdim by 100
601 | \begin{tikzpicture}[very thin]
602 |
603 | \shade[top color=sthlmLightGrey,bottom color=sthlmLightGrey,middle color=sthlmLightGrey]
604 | (0pt, 0pt) rectangle ++ (\progressbar@pbwd, \progressbar@pbht);
605 |
606 | \shade[draw=sthlmDarkBlue,top color=sthlmDarkBlue,bottom color=sthlmDarkBlue,middle color=sthlmDarkBlue] %
607 | (0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
608 |
609 | \end{tikzpicture}%
610 | }
611 |
612 | \setbeamertemplate{headline}{
613 |
614 | \begin{beamercolorbox}[wd=\paperwidth,ht=1ex,center,dp=0ex]{sthlmLightGrey}%
615 | \progressbar@progressbar%
616 | \end{beamercolorbox}%
617 | }
618 |
619 | %% ------------------------------------------------------------------------------------------------
620 | %% FRAME TITLE IN ALL CAPS (MAC: USE "? + ? + }" to uncomment section
621 | %% ------------------------------------------------------------------------------------------------
622 | %\setbeamertemplate{frametitle}
623 | %{
624 | %\begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=3ex,dp=1.5ex]{frametitle}
625 | % \usebeamerfont{frametitle}\MakeUppercase{\insertframetitle}%
626 | %\end{beamercolorbox}
627 | %}
628 |
629 | % ------------------------------------------------------------------------------------------------
630 | % FRAME TITLE IN TITLE CASE (MAC: USE "? + ? + {" to comment-out section
631 | % ------------------------------------------------------------------------------------------------
632 | \setbeamertemplate{frametitle}
633 | {
634 | \begin{beamercolorbox}[sep=0ex,wd=\paperwidth,leftskip=0.25cm,rightskip=0.3cm,ht=2.75ex,dp=1.375ex]{frametitle}
635 | \usebeamerfont*{frametitle}{\insertframetitle}%
636 | \end{beamercolorbox}
637 | }
638 |
639 |
640 | %\setbeamertemplate{block alerted begin}
641 | %{
642 | % \setbeamercolor{item}{parent=block body alerted}
643 | % \par\vskip\medskipamount%
644 | % \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]{block title alerted}
645 | % \usebeamerfont*{block title alerted}\insertblocktitle%
646 | % \end{beamercolorbox}%
647 | % {\parskip0pt\par}%
648 | % {\nointerlineskip\vskip-0.5pt}%
649 | % \usebeamerfont{block body alerted}%
650 | % \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body alerted}%
651 | %}
652 | %\setbeamertemplate{block alerted end}
653 | %{\end{beamercolorbox}\vskip\smallskipamount}
654 |
655 | % ------------------------------------------------------------------------------------------------
656 | % FOOTLINE
657 | % ------------------------------------------------------------------------------------------------
658 | \usenavigationsymbolstemplate{}
659 | \setbeamertemplate{footline}
660 | {
661 | \leavevmode%
662 | \hbox{%
663 | \begin{beamercolorbox}[sep=0.25ex,wd=.333333\paperwidth,ht=3.25ex,dp=1.25ex,left]{author in head/foot}%
664 | \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
665 | \end{beamercolorbox}%
666 | \begin{beamercolorbox}[sep=0.5ex,wd=.333333\paperwidth,ht=3.25ex,dp=1.25ex,center]{title in head/foot}%
667 | \usebeamerfont{title in head/foot}\insertshorttitle
668 | \end{beamercolorbox}%
669 | \begin{beamercolorbox}[sep=0.5ex,wd=.333333\paperwidth,ht=3.25ex,dp=1.25ex,right]{date in head/foot}%
670 | \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
671 | \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
672 | \end{beamercolorbox}}%
673 | \vskip0pt%
674 | }
675 |
676 | % ------------------------------------------------------------------------------------------------
677 | % CAPTIONS
678 | % ------------------------------------------------------------------------------------------------
679 | \setbeamertemplate{caption label separator}{: }
680 |
681 | % ------------------------------------------------------------------------------------------------
682 | % BLOCKS
683 | % ------------------------------------------------------------------------------------------------
684 | \setbeamertemplate{block begin}
685 | {
686 | \setbeamercolor{item}{parent=block body}
687 | \par\vskip\medskipamount%
688 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]{block title}
689 | \usebeamerfont*{block title}\insertblocktitle%
690 | \end{beamercolorbox}%
691 | {\parskip0pt\par}%
692 | {\nointerlineskip\vskip-0.5pt}%
693 | \usebeamerfont{block body}%
694 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body}%
695 | }
696 | \setbeamertemplate{block end}
697 | {\end{beamercolorbox}\vskip\smallskipamount}
698 |
699 | \setbeamertemplate{block alerted begin}
700 | {
701 | \setbeamercolor{item}{parent=block body alerted}
702 | \par\vskip\medskipamount%
703 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]{block title alerted}
704 | \usebeamerfont*{block title alerted}\insertblocktitle%
705 | \end{beamercolorbox}%
706 | {\parskip0pt\par}%
707 | {\nointerlineskip\vskip-0.5pt}%
708 | \usebeamerfont{block body alerted}%
709 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body alerted}%
710 | }
711 | \setbeamertemplate{block alerted end}
712 | {\end{beamercolorbox}\vskip\smallskipamount}
713 |
714 | \setbeamertemplate{block example begin}
715 | {
716 | \par\vskip\medskipamount%
717 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]{block title example}
718 | \usebeamerfont*{block title example}\insertblocktitle%
719 | \end{beamercolorbox}%
720 | {\parskip0pt\par}%
721 | {\nointerlineskip\vskip-0.5pt}%
722 | \usebeamerfont{block body example}%
723 | \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body example}%
724 | }
725 | \setbeamertemplate{block example end}
726 | {\end{beamercolorbox}\vskip\smallskipamount}
727 |
728 | % ------------------------------------------------------------------------------------------------
729 | % BLOCK HOVERING ABOVE THE SLIDE
730 | % ------------------------------------------------------------------------------------------------
731 |
732 | \newcommand<>{\hover}[1]{\uncover#2{%
733 | \begin{tikzpicture}[remember picture,overlay]%
734 | \draw[fill,opacity=0.4] (current page.south west)
735 | rectangle (current page.north east);
736 | \node at (current page.center) {#1};
737 | \end{tikzpicture}}
738 | }
739 |
740 | % ------------------------------------------------------------------------------------------------
741 | % VERTICALLY ALIGNED COLUMNS
742 | % ------------------------------------------------------------------------------------------------
743 |
744 | \usepackage{environ}% Required for \NewEnviron, i.e. to read the whole body of the environment
745 |
746 | \newcounter{acolumn}% Number of current column
747 | \newlength{\acolumnmaxheight}% Maximum column height
748 |
749 |
750 | % `column` replacement to measure height
751 | \newenvironment{@acolumn}[1]{%
752 | \stepcounter{acolumn}%
753 | \begin{lrbox}{\@tempboxa}%
754 | \begin{minipage}{#1}%
755 | }{%
756 | \end{minipage}
757 | \end{lrbox}
758 | \@tempdimc=\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
759 | % Save height of this column:
760 | \expandafter\xdef\csname acolumn@height@\roman{acolumn}\endcsname{\the\@tempdimc}%
761 | % Save maximum height
762 | \ifdim\@tempdimc>\acolumnmaxheight
763 | \global\acolumnmaxheight=\@tempdimc
764 | \fi
765 | }
766 |
767 | % `column` wrapper which sets the height beforehand
768 | \newenvironment{@@acolumn}[1]{%
769 | \stepcounter{acolumn}%
770 | % The \autoheight macro contains a \vspace macro with the maximum height minus the natural column height
771 | \edef\autoheight{\noexpand\vspace*{\dimexpr\acolumnmaxheight-\csname acolumn@height@\roman{acolumn}\endcsname\relax}}%
772 | % Call original `column`:
773 | \orig@column{#1}%
774 | }{%
775 | \endorig@column
776 | }
777 |
778 | % Save orignal `column` environment away
779 | \let\orig@column\column
780 | \let\endorig@column\endcolumn
781 |
782 | % `columns` variant with automatic height adjustment
783 | \NewEnviron{acolumns}[1][]{%
784 | % Init vars:
785 | \setcounter{acolumn}{0}%
786 | \setlength{\acolumnmaxheight}{0pt}%
787 | \def\autoheight{\vspace*{0pt}}%
788 | % Set `column` environment to special measuring environment
789 | \let\column\@acolumn
790 | \let\endcolumn\end@acolumn
791 | \BODY% measure heights
792 | % Reset counter for second processing round
793 | \setcounter{acolumn}{0}%
794 | % Set `column` environment to wrapper
795 | \let\column\@@acolumn
796 | \let\endcolumn\end@@acolumn
797 | % Finally process columns now for real
798 | \begin{columns}[#1]%
799 | \BODY
800 | \end{columns}%
801 | }
802 |
803 | % ------------------------------------------------------------------------------------------------
804 | % IMAGES
805 | % ------------------------------------------------------------------------------------------------
806 |
807 | \newbox\mytempbox
808 | \newdimen\mytempdimen
809 |
810 | \newcommand\includegraphicscopyright[3][]{%
811 | \leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
812 | \mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
813 | \usebeamerfont{copyright text}{\usebeamercolor[fg]{copyright text}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
814 | }}
815 |
816 | \begin{document}
817 |
818 | % Hide progress bar and footline on titlepage
819 | $if(title)$
820 | \begin{frame}[plain]
821 | \titlepage
822 | \end{frame}
823 | $endif$
824 |
825 | $for(include-before)$
826 | $include-before$
827 |
828 | $endfor$
829 | $if(toc)$
830 | \begin{frame}
831 | \tableofcontents[hideallsubsections]
832 | \end{frame}
833 |
834 | $endif$
835 | $body$
836 |
837 | $if(natbib)$
838 | $if(bibliography)$
839 | $if(biblio-title)$
840 | $if(book-class)$
841 | \renewcommand\bibname{$biblio-title$}
842 | $else$
843 | \renewcommand\refname{$biblio-title$}
844 | $endif$
845 | $endif$
846 | \begin{frame}[allowframebreaks]{$biblio-title$}
847 | \bibliographytrue
848 | \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
849 | \end{frame}
850 |
851 | $endif$
852 | $endif$
853 | $if(biblatex)$
854 | \begin{frame}[allowframebreaks]{$biblio-title$}
855 | \bibliographytrue
856 | \printbibliography[heading=none]
857 | \end{frame}
858 |
859 | $endif$
860 | $for(include-after)$
861 | $include-after$
862 |
863 | $endfor$
864 | \end{document}
--------------------------------------------------------------------------------