| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- % author Matus Necas, October 2026
- % original work by Jan Sumsky <jan.sumsky@gmail.com>, August 2024
- %
- % Description: High-level slide layout macros for Beamer presentations.
- % Provides specialized commands for title slides, table of contents,
- % section dividers, single-column, and two-column slide layouts.
- \RequirePackage{multicol}
- \input{organisation/info.sty} % Import user configurations and colors
- % ==============================================================================
- % DIMENSIONS CONFIGURATION
- % ==============================================================================
- \newlength{\uniTitleTopSpace}\setlength{\uniTitleTopSpace}{42pt} % Top spacing for title slides
- \newlength{\uniTitleSubtitleGap}\setlength{\uniTitleSubtitleGap}{15pt} % Gap between title and subtitle
- \newlength{\uniTitleAuthorGap}\setlength{\uniTitleAuthorGap}{10pt} % Gap before author (standard title)
- \newlength{\uniColorAuthorGap}\setlength{\uniColorAuthorGap}{10pt} % Gap before author (colored title)
- \newlength{\uniColumnIndent}\setlength{\uniColumnIndent}{0.8em} % Text indentation in columns
- \newlength{\uniFootlineRightPad}\setlength{\uniFootlineRightPad}{3mm} % Right padding in footline
- \newlength{\uniColumnGap}\setlength{\uniColumnGap}{2em} % Gap between two columns
- % ==============================================================================
- % STATE SWITCH AND GLOBAL FOOTLINE TOGGLE
- % ==============================================================================
- \newif\ifuni@onstitle
- \uni@onstitlefalse
- % ==============================================================================
- % HELPER MACRO FOR TWO-COLUMN SLIDE
- % ==============================================================================
- % #1: Left column width ratio relative to \textwidth (e.g., 0.5)
- % #2: Left column content
- % #3: Right column content
- \newcommand{\uni@renderColumns}[3]{%
- \noindent
- \begin{minipage}[t]{#1\textwidth}%
- \setlength{\fboxsep}{0pt}%
- \begin{minipage}[t]{\linewidth}%
- #2%
- \end{minipage}%
- \end{minipage}%
- \hspace{\uniColumnGap}%
- \begin{minipage}[t]{\dimexpr\textwidth - #1\textwidth - \uniColumnGap\relax}%
- \setlength{\fboxsep}{0pt}%
- \begin{minipage}[t]{\linewidth}%
- #3%
- \end{minipage}%
- \end{minipage}%
- }
- % ==============================================================================
- % HELPER MACRO FOR TITLE TEXT
- % ==============================================================================
- % #1: Title formatting, #2: Subtitle formatting, #3: Title text, #4: Subtitle text
- \newcommand{\uni@renderTitleText}[4]{%
- #1#3%
- \def\uni@tempsub{#4}%
- \ifx\uni@tempsub\@empty
- \else
- \vspace{\uniTitleSubtitleGap}%
- \par
- #2#4%
- \fi
- }
- % ==============================================================================
- % TABLE OF CONTENTS SLIDE
- % ==============================================================================
- % #1: Number of columns (optional, default is 1)
- \NewDocumentCommand{\slideTableOfContents}{o}{%
- \uni@onstitlefalse
- \begin{frame}{%
- \contentsname%
- }%
- \IfValueTF{#1}{%
- \ifnum#1>1%
- \begin{multicols}{#1}%
- \tableofcontents
- \end{multicols}%
- \else%
- \tableofcontents%
- \fi%
- }{%
- \tableofcontents%
- }%
- \end{frame}%
- }
- % ==============================================================================
- % 2. TITLE SLIDES
- % ==============================================================================
- % Creates a standard title slide using global Beamer variables (\inserttitle, \insertsubtitle, \insertauthor).
- \NewDocumentCommand{\slideTitle}{}{
- \uni@onstitletrue
- \begin{frame}[c]
- \vspace{\uniTitleTopSpace}
- \noindent
- \begin{minipage}{\textwidth}
- \raggedright
- \uni@renderTitleText
- {\usebeamerfont{title}\usebeamercolor[fg]{title}}
- {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}}
- {\inserttitle}{\insertsubtitle}%
-
- \vspace{\uniTitleAuthorGap}%
- {\usebeamerfont{author}\color{colorText}\insertauthor}%
- \end{minipage}
- \end{frame}
- }
- % Creates a colored title slide with custom background canvas and vertical centering matching \slideTitle.
- \NewDocumentCommand{\slideTitleColor}{}{
- \uni@onstitletrue
- {
- \usebeamercolor{footline}
- \setbeamercolor{background canvas}{bg=footline.bg}
-
- \begin{frame}[c,plain]
- \vspace{\uniTitleTopSpace}
- \noindent
- \begin{minipage}{\textwidth}
- \raggedright
- \color{footline.fg}%
- \uni@renderTitleText
- {\usebeamerfont{title}}
- {\usebeamerfont{subtitle}}
- {\inserttitle}{\insertsubtitle}%
-
- \vspace{\uniTitleAuthorGap}%
- {\usebeamerfont{author}\insertauthor}%
- \end{minipage}
- \end{frame}
- }
- }
- % ==============================================================================
- % 3. SECTIONS
- % ==============================================================================
- % Creates a dedicated section divider slide with vertical centering.
- % * : Optional star (captured as #1) to suppress automatic section registration
- % #2 : Section title text (+m supports multi-line text with \\)
- \NewDocumentCommand{\slideSection}{s +m}{
- \uni@onstitlefalse
- \IfBooleanF{#1}{\section{#2}}
- \begin{frame}
- \vfill
- \begin{beamercolorbox}[leftskip=\titlelf]{section title}
- \usebeamerfont{section title}#2
- \end{beamercolorbox}
- \vfill
- \end{frame}
- }
- % Creates a dedicated section divider slide with vertical centering and subtitle.
- % * : Optional star (captured as #1) to suppress automatic section registration
- % #2 : Section title text (+m supports multi-line text with \\)
- % #3 : Section subtitle text (+m supports multi-line text with \\)
- \NewDocumentCommand{\slideSectionSubtitle}{s +m +m}{
- \uni@onstitlefalse
- \IfBooleanF{#1}{\section{#2}}
-
- \begin{frame}
- \vfill
- \begin{beamercolorbox}[leftskip=\titlelf]{section title}
- \usebeamerfont{section title}#2%
- \IfNoValueF{#3}{%
- \par
- \vspace{\uniTitleSubtitleGap}%
- \usebeamerfont{subtitle}\color{colorText}#3%
- }%
- \end{beamercolorbox}
- \vfill
- \end{frame}
- }
- % ==============================================================================
- % 4. SINGLE-COLUMN SLIDES
- % ==============================================================================
- % Creates a plain single-column slide without a frame title.
- % #1: Slide content (+m supports multi-line text, lists, and macros)
- \NewDocumentCommand{\slideOneColumnPlain}{+m}{
- \uni@onstitlefalse
- \begin{frame}
- #1
- \end{frame}
- }
- % Creates a standard single-column slide with a frame title and section handling.
- % * : Optional star (captured as #1) to suppress automatic section registration
- % #2 : Frame and section title (m)
- % #3 : Slide content (+m)
- \NewDocumentCommand{\slideOneColumn}{s m +m}{
- \uni@onstitlefalse
- \IfBooleanF{#1}{\section{#2}}
-
- \begin{frame}{#2}
- #3
- \end{frame}
- }
- % ==============================================================================
- % 5. TWO-COLUMN SLIDES
- % ==============================================================================
- % Creates a blank two-column slide without a frame title.
- % #1: Left column width ratio (e.g., 0.5 for 50%)
- % #2: Left column content (+m supports multi-line text and macros)
- % #3: Right column content (+m supports multi-line text and macros)
- \NewDocumentCommand{\slideTwoColumnsPlain}{m +m +m}{
- \uni@onstitlefalse
- \begin{frame}
- \uni@renderColumns{#1}{#2}{#3}
- \end{frame}
- }
- % Creates a standard two-column slide with a frame title and section handling.
- % * : Optional star to suppress automatic section registration
- % #1 : Frame and section title (m)
- % #2 : Left column width ratio (m)
- % #3 : Left column content (+m)
- % #4 : Right column content (+m)
- \NewDocumentCommand{\slideTwoColumns}{s m m +m +m}{
- \uni@onstitlefalse
- \IfBooleanF{#1}{\section{#2}}
-
- \begin{frame}{#2}
- \uni@renderColumns{#3}{#4}{#5}
- \end{frame}
- }
|