Added keys for customizing

This commit is contained in:
Lukas Pietzschmann
2022-12-09 21:39:41 +01:00
parent 8d31366796
commit 17b186ef42
3 changed files with 77 additions and 18 deletions

View File

@@ -4,6 +4,11 @@ The kinda awesome beamer theme!
## Using the theme
Just copy and paste `beamerthemeawesome.sty` into your project, add `\usetheme{awesome}` into your main file and your good to go :)
## Options
This theme provides some settings you can tweak:
- Language: Possible values are `english` or `german`. This changes the value passed to babel and csquotes. If none of both is selected, `german` is used.
- Extra slides: For each section and subsection an extra slide containing the title can be inserted. This is controlled by passing `secslide` and `subsecslide`. The absence of `secslide` indicates that you don't want an extra slide for every section. This is analog for `subsecslide`.
## Compilation
Using this theme requires you to run your compiler multiple times on your main LaTeX file. This is required for those litte dots in the footer to work.
If you're using latexmk you don't have to do this manually as latexmk can figure this stuff out by itself.

View File

@@ -1,7 +1,40 @@
\ProvidesPackage{awesome-beamer-theme}[]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=awesome,prefix=awesome@}
\newif\ifawesome@english@
\DeclareVoidOption{english}{
\awesome@english@true
}
\DeclareVoidOption{german}{
\awesome@english@false
}
\DeclareBoolOption{secslide}
\DeclareBoolOption{subsecslide}
\ProcessKeyvalOptions*
\ifawesome@english@
\RequirePackage[english]{babel}
\else
\RequirePackage[ngerman]{babel}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{fontspec}
\RequirePackage[ngerman]{babel}
\RequirePackage{microtype}
\RequirePackage{chngcntr}
\RequirePackage{scrextend}
@@ -401,7 +434,15 @@
\fi%
\fi%
\hfill%
\colorbox{awesomehighlight!70}{\hspace{0.3cm}Seite~\insertframenumber~/~\inserttotalframenumber\hspace{0.3cm}}%
\colorbox{awesomehighlight!70}{
\hspace{0.3cm}
\ifawesome@english@
Page
\else
Seite
\fi
~\insertframenumber~/~\inserttotalframenumber\hspace{0.3cm}
}%
\end{beamercolorbox}%
}
\vskip0pt%
@@ -424,7 +465,16 @@
\hfill%
\inserttitle%
\hfill%
\colorbox{awesomehighlight!70}{\hspace{0.3cm}Seite~\insertframenumber~/~\inserttotalframenumber\hspace{0.3cm}}%
\colorbox{awesomehighlight!70}{
\hspace{0.3cm}
\ifawesome@english@
Page
\else
Seite
\fi
~\insertframenumber~/~\inserttotalframenumber
\hspace{0.3cm}
}%
\end{beamercolorbox}%
}
\vskip0pt%
@@ -442,21 +492,25 @@
\AtBeginSection[]{
\begin{frame}[noframenumbering]
\thispagestyle{navigation@toc}
\vfill
\centering
\usebeamerfont{title}\usebeamercolor[fg]{section number projected}\insertsectionnumber.~\usebeamercolor[fg]{title}\insertsectionhead\par
\vfill
\end{frame}
\ifawesome@secslide
\begin{frame}[noframenumbering]
\thispagestyle{navigation@toc}
\vfill
\centering
\usebeamerfont{title}\usebeamercolor[fg]{section number projected}\insertsectionnumber.~\usebeamercolor[fg]{title}\insertsectionhead\par
\vfill
\end{frame}
\fi
}
\AtBeginSubsection[]{
\begin{frame}[noframenumbering]
\thispagestyle{navigation@toc}
\vfill
\centering
\usebeamerfont{title}\usebeamercolor[fg]{section number projected}\insertsectionnumber.\textsubscript{\usebeamercolor[fg]{subsection number projected}\insertsubsectionnumber}~\usebeamercolor[fg]{title}\insertsubsectionhead\par
\vfill
\end{frame}
\ifawesome@subsecslide
\begin{frame}[noframenumbering]
\thispagestyle{navigation@toc}
\vfill
\centering
\usebeamerfont{title}\usebeamercolor[fg]{section number projected}\insertsectionnumber.\textsubscript{\usebeamercolor[fg]{subsection number projected}\insertsubsectionnumber}~\usebeamercolor[fg]{title}\insertsubsectionhead\par
\vfill
\end{frame}
\fi
}

View File

@@ -2,7 +2,7 @@
\usepackage{lipsum}
\usetheme{awesome}
\usetheme[english, secslide, subsecslide]{awesome}
\title{Test Presentation}
\author{Lukas Pietzschmann}