% author Matus Necas, October 2026 % original work by Jan Sumsky , 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} }