From cfc625ca6ad82b9f0b3d559b8645ec10369c09da Mon Sep 17 00:00:00 2001 From: Lukas Pietzschmann Date: Thu, 22 Feb 2024 11:03:45 +0100 Subject: [PATCH] Added option to remove the section numbers in the title --- README.md | 1 + beamerthemeawesome.sty | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c9eba1c..b20a807 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ 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` or/and `subsecslide`. The absence of `secslide` indicates that you don't want an extra slide for every section. Analog for `subsecslide`. - Automatic toc: A table of contents is automatically inserted with the `\maketitle` command (After the title slide). If you want to disable this behavior, you have to set the `notoc` option. +- Section numbers in frame title: Each frage contains the current section (and subsection) number in its title. To disable this, you have to pass the `nonumbersinframetitle` option. If you disable section numbers in the title, and you use use the `wide` environment inside a frame, it can look weird when the title is shifted to the right, but the content is not. To cope with this, you can pass the `wide` option to the frame. This will also shift the title to the left. If you wanna set one (or more) of those values, you have to pass it to `\usetheme`. Look at ![example.tex](https://github.com/LukasPietzschmann/awesome-beamer/blob/master/example.tex) for, well, an example. diff --git a/beamerthemeawesome.sty b/beamerthemeawesome.sty index 4741727..f7d6cd1 100644 --- a/beamerthemeawesome.sty +++ b/beamerthemeawesome.sty @@ -15,6 +15,7 @@ \DeclareBoolOption{notoc} \DeclareBoolOption{secslide} \DeclareBoolOption{subsecslide} +\DeclareBoolOption{nonumbersinframetitle} \DeclareDefaultOption{\PassOptionsToPackage{\CurrentOption}{smile}} @@ -92,6 +93,19 @@ \BeforeBeginEnvironment{tabular}{\def\arraystretch{1.1}\rowcolors{2}{lightgray}{white}} +\providebool{wideframe} +\define@key{beamerframe}{wide}[true]{ + \booltrue{wideframe} + \begingroup +} + +\apptocmd{\beamer@reseteecodes}{% + \ifbool{wideframe}{% + \endgroup + \boolfalse{wideframe} + }{} +}{}{} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -269,8 +283,13 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newlength\awesome@sidebarwidth\setlength{\awesome@sidebarwidth}{0.15\paperwidth} +\newlength\awesome@textmargin\setlength{\awesome@textmargin}{0.05\paperwidth} \setbeamersize{description width=0.5cm} -\setbeamersize{sidebar width left=0.15\paperwidth} +\setbeamersize{sidebar width left=\awesome@sidebarwidth} +\setbeamersize{sidebar width right=\z@} +\setbeamersize{text margin left=\awesome@textmargin} +\setbeamersize{text margin right=\awesome@textmargin} \setbeamertemplate{caption}{\insertcaption} \setbeamertemplate{blocks}[rounded][shadow=false] @@ -287,7 +306,7 @@ } \newenvironment{wide}{\begingroup\leavevmode% - \hspace*{-2cm}\fboxsep\z@\minipage{\linewidth+2cm}% + \hspace*{-\awesome@sidebarwidth}\fboxsep\z@\minipage{\linewidth+2cm}% }{\endminipage\endgroup} \setbeamertemplate{subsection in toc}{% @@ -303,7 +322,7 @@ } \setbeamertemplate{frametitle}{% - \vspace{1em}\hspace{-\beamer@leftsidebar}\begin{beamercolorbox}[wd=\beamer@leftsidebar]{frametitle}% + \vspace{1em}\ifawesome@nonumbersinframetitle\ifbool{wideframe}{\hspace{-\awesome@sidebarwidth}}{}\else\hspace{-\awesome@sidebarwidth}\begin{beamercolorbox}[wd=\awesome@sidebarwidth]{frametitle}% \ifx\insertsection\empty\else% \color{accent}\thesection.% \ifx\insertsubsection\empty% @@ -317,7 +336,7 @@ \fi% \fi% \fi - \end{beamercolorbox}% + \end{beamercolorbox}\fi% \begin{beamercolorbox}{frametitle}% \insertframetitle% \end{beamercolorbox}