% Template for Sapienza presentations with LaTeX beamer. % % Adapted by Andrea Gasparini, andrea@gasparini.cloud for % Sapienza presentations. % % Original template by Federico Zenith, federico.zenith@sintef.no. % Derived (through several iterations) from Håvard Berland's % beamerthementnu class. % % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % TODO: remove top-right logo from title page \ProvidesPackage{beamerthemesintef}[2021/11/02] \RequirePackage{etoolbox} \RequirePackage{tikz} \RequirePackage{setspace} % Force 16:9 aspect ratio \RequirePackage{geometry} \geometry{paperwidth=20cm,paperheight=11cm} % Caladea is a Cambria clone, Carlito a Calibri clone \RequirePackage{caladea,carlito} \renewcommand{\familydefault}{\sfdefault} \RequirePackage{graphicx,sintefcolor} % No navigation symbols \setbeamertemplate{navigation symbols}{} \newcommand{\@footlineauthor}{\insertauthor \enspace$\vert$\enspace} \newcommand{\@footlinepayoff}{\@footlineauthor\inserttitle} \newcommand{\footlinepayoff}[1]{\renewcommand{\@footlinepayoff}{#1}} % Define footline content \setbeamertemplate{footline}{% \begin{beamercolorbox}[wd=\textwidth,ht=5mm,dp=3mm,rightskip=1cm,leftskip=1cm]{footline} \insertframenumber/\inserttotalframenumber \ifstrempty{\@footlinepayoff}{}{% \usebeamerfont{footline}\hfill\@footlinepayoff } \end{beamercolorbox} } % Set footline AND coordinate blocks with it \newcommand{\footlinecolor}[1]{% if #1 is empty, makes footline transparent \ifstrempty{#1}{% \footlinepayoff{} \setbeamercolor{footline}{fg=darkgray, bg=} \setbeamercolor{block title}{fg=white,bg=maincolor} \setbeamercolor{block body}{fg=white,bg=maincolor} }{ \footlinepayoff{\@footlineauthor\inserttitle} \setbeamercolor{footline}{fg=white,bg=#1} \setbeamercolor{block title}{fg=white,bg=#1} \setbeamercolor{block body}{fg=white,bg=#1} }% } \footlinecolor{} % Default: no footline \pgfdeclareimage[width=0.07\paperwidth]{logo}{assets/JLU_logo_negative_1.png} %\pgfdeclareimage[width=0.07\paperwidth]{logo}{assets/logo_RGB} \pgfdeclareimage[width=0.07\paperwidth]{whitelogo}{assets/JLU_logo_2.png} %\pgfdeclareimage[width=0.07\paperwidth]{whitelogo}{assets/logo_RGB_negative} \newcommand{\@logo}{logo} % Set colours % NOTE! Beamer colors should be set in the preamble. It often works fine in the % document itself, but NOT for normal text foreground. % \themecolor should only be called from the preamble. \newcommand{\themecolor}[1]{ \ifstrequal{#1}{main}{% \setbeamercolor{footline}{fg=white} \setbeamercolor{normal text}{fg=white,bg=maincolor} \setbeamercolor{structure}{fg=white} \renewcommand{\@logo}{whitelogo} \setbeamercolor{block title}{fg=maincolor,bg=sintefgrey} \setbeamercolor{block body}{fg=darkgray,bg=JLUblockcolor} % \setbeamercolor{block body}{fg=darkgray,bg=sintefgrey} }{% \setbeamercolor{footline}{fg=darkgray} \setbeamercolor{normal text}{fg=darkgray,bg=white} \setbeamercolor{structure}{fg=maincolor} \renewcommand{\@logo}{logo} \setbeamercolor{block title}{fg=white,bg=maincolor} \setbeamercolor{block body}{fg=darkgray,bg=JLUblockcolor} %\setbeamercolor{block body}{fg=darkgray,bg=sintefgrey} } } \themecolor{white} % Default: white theme \setbeamercolor{title}{fg=maincolor,bg=white} \setbeamercolor{alerted text}{fg=sintefred} \setbeamercolor{author}{fg=black} \setbeamercolor{date}{fg=black} \setbeamercolor{supervisor}{fg=maincolor} \setbeamerfont{author}{size=\small, series=\mdseries} \setbeamerfont{supervisor}{size=\small, series=\mdseries} \setbeamerfont{date}{size=\small} \setbeamerfont{title}{series=\bfseries, size=\large} \setbeamerfont{subtitle}{series=\mdseries,size=\small} \setbeamerfont{frametitle}{series=\bfseries} \setbeamerfont{framesubtitle}{series=\mdseries} \setbeamerfont{footline}{size=\scriptsize} \setbeamerfont{block title}{series=\bfseries} %\setbeamerfont{block title}{series=\centering\bfseries} % Code to get prettier boxes \setbeamertemplate{blocks}[rounded] % Bullets in several levels \setbeamertemplate{itemize item}{\textbullet} \setbeamertemplate{itemize subitem}{\textemdash} \setbeamertemplate{itemize subsubitem}{\ensuremath{\circ}} \newenvironment{colorblock}[3][white]{% \begingroup \setbeamercolor{block title}{fg=#1,bg=#2} \setbeamercolor{block body} {fg=#1,bg=#2} \begin{block}{#3} }{% \end{block} \endgroup } % Put the logo in each slide's top left area \setbeamertemplate{headline}{\hspace{0.05\textwidth}\pgfuseimage{\@logo}} % Define frame title and subtitle layout \setbeamertemplate{frametitle}{% % \vspace*{-4.0ex} \vspace*{-4.50ex} \begin{beamercolorbox}[leftskip=1.7cm]{frametitle}% \usebeamerfont{frametitle}\insertframetitle\\ \usebeamerfont{framesubtitle}\insertframesubtitle \end{beamercolorbox} } \def\@courseLabel{} \def\@IDnumber{} \def\@supervisor{} \def\@insti{} \newcommand{\course}[1]{\def\@courseLabel{#1}} \newcommand{\IDnumber}[1]{\def\@IDnumber{#1}} \newcommand{\supervisor}[1]{\def\@supervisor{#1}} \newcommand{\insti}[1]{\def\@insti{#1}} % Define the title page \setbeamertemplate{title page}{% \vskip2pt plus 1filll% % Reposition the box in an inelegant way - but it works! \onehalfspacing \hspace{-15mm} \vspace{28mm} \begin{beamercolorbox}[wd=0.72\textwidth,sep=10pt,leftskip=11mm]{title}% {\usebeamerfont{title}\inserttitle} {\usebeamerfont{subtitle}\insertsubtitle} {\usebeamerfont{subtitle}\@courseLabel} {\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor \ifdefempty{\@IDnumber}{}{(\@IDnumber)}} \ifdefempty{\@supervisor}{}{\small{指导教师:} \usebeamerfont{supervisor}\usebeamercolor[fg]{supervisor}\@supervisor} \ifdefempty{\@insti}{}{ \usebeamerfont{author}\usebeamercolor[fg]{author}\@insti} {\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate} \end{beamercolorbox} } % Define slide splitting dimensions (e.g. title and chapter slides) \newcommand{\TikzSplitSlide}[1]{% \rule{0.56\paperwidth}{0pt}% \begin{tikzpicture} \clip (-0.1\paperwidth,-0.5\paperheight) -- ( 0.5\paperwidth,-0.5\paperheight) -- ( 0.5\paperwidth, 0.5\paperheight) -- ( 0.1\paperwidth, 0.5\paperheight) -- cycle; \node at (0.2\paperwidth,0) {% \includegraphics[height=\paperheight]{#1}% }; \end{tikzpicture} } \newbool{splittitle} \newcommand{\@TitleBackground}{} \newcommand{\titlebackground}{\@ifstar{\SplitBackground}{\FullBackground}} \newcommand{\FullBackground}[1]{\renewcommand{\@TitleBackground}{#1}} \newcommand{\SplitBackground}[1]{% \booltrue{splittitle}%6 \renewcommand{\@TitleBackground}{#1}% } % Overwrite the maketitle command for the title page \renewcommand{\maketitle}{ \begingroup \ifdefempty{\@TitleBackground}{}{% Skip if \@TitleBackground is empty \setbeamertemplate{background}{% \ifbool{splittitle}{% \TikzSplitSlide{\@TitleBackground} }{% Normal, full-screen background \includegraphics[height=\paperheight]{\@TitleBackground} } } } \begin{frame}% \titlepage% \end{frame}% \endgroup } \makeatletter \newenvironment{withoutheadline}{ \setbeamertemplate{headline}[default] \def\beamer@entrycode{\vspace*{-\headheight}} }{} \makeatother % Define chapter environment \newenvironment{chapter}[3][]{% Args: image (optional), color, frame title \begingroup \themecolor{main} \setbeamertemplate{footline}{} \ifstrempty{#2}{ \setbeamercolor{frametitle}{fg=white} \setbeamercolor{normal text}{fg=white,bg=maincolor} }{ \setbeamercolor{frametitle}{fg=white} \setbeamercolor{normal text}{fg=white,bg=#2} } \ifstrempty{#1}{}{\setbeamertemplate{background}{\TikzSplitSlide{#1}}} \setbeamertemplate{frametitle}{% \vspace*{8ex} \begin{beamercolorbox}[wd=0.45\textwidth]{frametitle} \usebeamerfont{frametitle}\insertframetitle\\ \usebeamerfont{framesubtitle}\insertframesubtitle \end{beamercolorbox} } \begin{frame}{#3} \hspace*{0.05\textwidth}% \minipage{0.35\textwidth}% \usebeamercolor[fg]{normal text}% }{% \endminipage \end{frame} \endgroup } % Define sidepic environment \newenvironment{sidepic}[2]{% Args: image, frame title \begingroup \setbeamertemplate{background}{% \hspace*{0.6\paperwidth}% \includegraphics[height=\paperheight]{#1}% } \setbeamertemplate{frametitle}{% Same as normal, but with right skip \vspace*{-3.5ex} \begin{beamercolorbox}[leftskip=2cm,rightskip=0.4\textwidth]{frametitle}% \usebeamerfont{frametitle}\insertframetitle\\ \usebeamerfont{framesubtitle}\insertframesubtitle \end{beamercolorbox} } \begin{frame}{#2} \minipage{0.6\textwidth}% }{% \endminipage \end{frame} \endgroup } % Define backmatter \newcommand{\backmatter}[1][]{ \begingroup \themecolor{main} \begin{frame}[c] \centering \begin{minipage}{\textwidth} \usebeamercolor[fg]{normal text} \centering % \ifstrequal{#1}{notitle}{}{ % \Huge \inserttitle % \vspace{5mm} % } \Huge \textsl{\\谢谢大家!} \end{minipage} \end{frame} \endgroup } % Define sectioning and table of contents \AtBeginSection[] { \begingroup \themecolor{main} \begin{frame}{目录} % \tableofcontents[currentsection] \tableofcontents[sectionstyle=show/shaded,subsectionstyle=show/shaded/hide,subsubsectionstyle=show/shaded/hide] \end{frame} \endgroup } \AtBeginSubsection[]{ \begingroup \themecolor{main} \begin{frame}{目录} \tableofcontents[sectionstyle=show/shaded,subsectionstyle=show/shaded/hide,subsubsectionstyle=show/shaded/hide] \end{frame} \endgroup } \AtBeginSubsubsection[]{ \begingroup \themecolor{main} \begin{frame}{目录} \tableofcontents[sectionstyle=show/shaded,subsectionstyle=show/shaded/hide,subsubsectionstyle=show/shaded/hide] \end{frame} \endgroup } % style of section presented in the table of contents \setbeamertemplate{section in toc}{$\blacktriangleright$~\inserttocsection} % automate subtitle of each frame \makeatletter \pretocmd\beamer@checkframetitle{\framesubtitle{\thesection \, \secname}} \makeatother % avoid numbering of frames that are breaked into multiply slides \setbeamertemplate{frametitle continuation}{}