]> gitweb.michael.orlitzky.com - beamer-mjo.git/commitdiff
beamerthemeUMBC.sty: allow partless sections.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 25 Apr 2023 15:30:48 +0000 (11:30 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 25 Apr 2023 15:30:48 +0000 (11:30 -0400)
Sometimes having a full Part : Section hierarchy is too much. We can
now use only sections, and the part titles (and the colon separators)
will be gracefully omitted.

beamerthemeUMBC.sty

index a376fd58195fca9edd8cfd51240bd1367f20825f..6824ac8a18928e05e17d11c395b36e069a35246e 100644 (file)
 % Create a slide introducing new sections.
 \AtBeginSection[]{
   \begin{frame}
-    \frametitle{Part \thepart, Section \thesection}
+    \frametitle{
+      \ifx\insertpart\@empty%
+      \else%
+      Part \thepart, %
+      \fi%
+      Section \thesection
+    }
     \vfill
     \begin{center}
-      \usebeamerfont{title}\insertpart: \insertsectionhead\par%
+      \usebeamerfont{title}
+      \ifx\insertpart\@empty%
+      \else%
+      \insertpart: %
+      \fi%
+      \insertsectionhead\par%
     \end{center}
     \vfill
   \end{frame}
 
 % Define a new ``partsecframe'' environment that uses a default frame
 % title of ``<part>: <section>'' when no other frame title is given.
-\newenvironment{partsecframe}[1][\insertpart: \insertsectionhead]
+\newenvironment{partsecframe}[1][%
+  \ifx\insertpart\@empty%
+  \else%
+  \insertpart: %
+  \fi%
+  \insertsectionhead%
+]
   {\begin{frame}{#1}}
   {\end{frame}}