\documentclass[aspectratio=169]{beamer}

% =============== Further packages

% Graphical elements
\usepackage{tikz}
\usepackage{graphicx}

% Custom bullets
\usepackage{pifont}

% Animated pictures: removed because the example animation files are not available.
% \usepackage{animate}

% Blindtext
\usepackage{lipsum}

% Code listings: use verbatim so no shell-escape / minted setup is required.
% \usepackage{minted}

% Wrapping text around image
\usepackage{wrapfig}

% Use multiple subfigures
\usepackage{subcaption}

% =============== Definition of directories

\graphicspath{{pics/}}
% Robust image inclusion: if an image is missing, LaTeX prints a small placeholder
% instead of stopping with a fatal error. Existing images are still used normally.
\newcommand{\safeincludegraphics}[2][]{%
  \IfFileExists{#2}{\includegraphics[#1]{#2}}{%
    \IfFileExists{pics/#2}{\includegraphics[#1]{pics/#2}}{%
      \IfFileExists{Material/#2}{\includegraphics[#1]{Material/#2}}{%
        \fbox{\scriptsize Missing image: \texttt{#2}}%
      }%
    }%
  }%
}


% =============== Definition of template

\usetheme{Boadilla}

% Colors
\usepackage{array}
\usepackage{colortbl}
% define new colors

\definecolor{upb_hellblau}{rgb}{0.0, 0.47, 0.77}
\definecolor{upb_dunkelblau}{rgb}{0.0, 0.25, 0.43}
\definecolor{LightRed}{RGB}{252,160,140}
\definecolor{LightBlue}{RGB}{140,186,252}
  
\setbeamercolor{frametitle}{fg=upb_dunkelblau, bg=white}
\setbeamercolor{title}{fg=white, bg=upb_dunkelblau}
\setbeamercolor{structure}{fg=upb_dunkelblau}


% use the colortbl package to define a new column
\newcolumntype{a}{>{\columncolor{LightRed}}c}

% Header definition    
\newlength{\headerlr}
\setlength{\headerlr}{1em} % EINSTELLPUNKT: Innenabstand links/rechts
\setbeamertemplate{frametitle}{%
  \ifnum\insertpagenumber>1
    \vbox{%
      % Header with MISOR logo
      \begin{beamercolorbox}[wd=\paperwidth, leftskip=\headerlr, rightskip=\headerlr, ht=2.8ex, dp=1.2ex]{frametitle}
        \usebeamerfont{frametitle}%
        \insertframetitle%
        \hfill
        \raisebox{-0.3\height}{\safeincludegraphics[height=3ex]{Material/misor.png.png}}%
      \end{beamercolorbox}%
      % Subtitle (if used)
      \ifx\insertframesubtitle\empty
      \else
      \vspace{-0.9ex}
        \begin{beamercolorbox}[wd=0.5\paperwidth, leftskip=\headerlr, rightskip=\headerlr, ht=2ex, dp=0.8ex]{framesubtitle}
          \vspace{1ex}
          \usebeamerfont{framesubtitle}\insertframesubtitle
          \vspace{-2.5ex}
        \end{beamercolorbox}%
      \fi
	  \vspace{-1ex}      
            \hspace*{0.2\headerlr}{\color{upb_dunkelblau}\rule{\dimexpr\paperwidth-2.4\headerlr}{0.8pt}}
    }%
  \fi
}

\setbeamertemplate{itemize items}[ball markers]
\setbeamertemplate{enumerate items}[ball markers]
\setbeamertemplate{blocks}[rounded][shadow=false]
%\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{caption}[numbered]


% Title page details

\newcommand{\titleleftlogo}{UPB.png}
\newcommand{\titlerightlogo}{misor.png.png}

% Headline: nur auf Seite 1 (Titelfolie) zwei Logos links/rechts
\setbeamertemplate{headline}{%
  \ifnum\insertpagenumber=1
    \vspace{0.5ex}% oberer Innenabstand
    \hbox to \paperwidth{%
      \hspace*{1em}%
      \raisebox{0pt}[\height][0pt]{\safeincludegraphics[height=1.2cm]{Material/UPB.png}}%
      \hfill
      \raisebox{0pt}[\height][0pt]{\safeincludegraphics[height=0.7cm]{Material/misor.png.png}}%
      \hspace*{1em}%
    }%
    \vspace{0.5ex}% unterer Innenabstand
  \fi
}
\title {\LaTeX{} Main title}
\subtitle{Subtitle}
\author[Guido Schryen et al. ]{Guido Schryen\inst{1} \and Duffy Duck\inst{1} \and Monty Python\inst{2}}
\institute[MISOR et al.]{\inst{1} Management Information Systems (MISOR) and \inst{2} Fawlty Towers}
\date[]{\today}



\begin{document}

\begin{frame}
% Print the title page as the first slide
\titlepage
\end{frame}

\begin{frame}{Some useful links}
\begin{itemize}
	\item LaTeX Beamer introduction / Quick-start guide: \break \url{https://latex-beamer.com/quick-start/}
	\item A simple guide to Beamer – Step by Step: \break \url{https://latex-beamer.com/tutorials/}
	\item Themes: \break \url{https://latex-beamer.com/tutorials/beamer-themes/}
	\item Colorthemes: \break \url{https://deic.uab.cat/~iblanes/beamer_gallery/index_by_color.html }
\end{itemize}
\end{frame}

\begin{frame}[label=toc]{Outline}
    \tableofcontents
\end{frame}

%current section
\AtBeginSection[ ]
{
\begin{frame}{Recurrent Outline}
    \tableofcontents[currentsection,hideallsubsections]
\end{frame}
}

\section{Lists}
\begin{frame}{Itemize environment (default)}
    \begin{itemize}
    	\item First item
    	\item Second item
    	\begin{itemize}
    		\item First item
    		\item Second item
    	\end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}{Pifont symbols for Beamer lists}
\begin{itemize}
    \item[\ding{51}] Code 51
    \item[\ding{56}] Code 56
    \item[\ding{43}] Code 43
    \item[\ding{118}] Code 118
    \item[\ding{170}] Code 170
\end{itemize}
\end{frame}

\begin{frame}{Pifont symbol overview}

\begin{abstract}
Here are some commonly used symbols from the \texttt{pifont} package.
This version does not require the missing image file \texttt{pifontSymbols}.
\end{abstract}

\begin{center}
\begin{tabular}{c c@{\hspace{1cm}}c c@{\hspace{1cm}}c c}
\textbf{Code} & \textbf{Symbol} & \textbf{Code} & \textbf{Symbol} & \textbf{Code} & \textbf{Symbol} \\ \\[-0.8em]
51  & \ding{51}  & 55  & \ding{55}  & 43  & \ding{43}  \\
56  & \ding{56}  & 118 & \ding{118} & 170 & \ding{170} \\
72  & \ding{72}  & 108 & \ding{108} & 110 & \ding{110}
\end{tabular}
\end{center}
\end{frame}

\begin{frame}{Enumerate environment (default)}{Some Subtitle}

\begin{enumerate}
    \item First item
    \item Second item
    \item Third item
    \begin{enumerate}
    	\item First subitem
	    \item Second subitem
    	\item Third subitem
    \end{enumerate}
\end{enumerate}
 
\end{frame}

\begin{frame}{Description environment (default)}
    
\begin{description}
    \item[API] Application Programming Interface
    \item[ROM] Read Only Memory
    \item[RAM] Random Access Memory
\end{description}
    
\end{frame}

\section{Tables and figures}
\subsection{Tables}
\begin{frame}{Colored table}
    
\begin{table}
\begin{tabular}{l||rara}
\hline
\rowcolor{LightBlue}
    The variables & \multicolumn{4}{c}{The data}\\ \hline
    var 1 & 1 & 2 & 3 & 4 \\ \hline
    var 2 & 1 & 2 & 3 & 4 \\ \hline
    var 3 & 1 & 2 & 3 & 4 \\ \hline
\end{tabular}
\caption{Colored table}
\end{table}
    
\end{frame}

\subsection{Figures and images}

\begin{frame}{First image}

In Figure \ref{fig:fawltyTowers} you can see the first image in this presentation. 

\begin{figure}
\centering
    \safeincludegraphics[width=0.25\textwidth,angle=45]{fawlty-towers1.png}
    \caption{Fawlty towers.}
    \label{fig:fawltyTowers}
\end{figure}

\end{frame}


\begin{frame}{Image in second column}

\begin{columns}
% Column 1
\begin{column}{0.5\textwidth}
        Here I can explain in detail what the figure represents.
\end{column}
% Column 2    
\begin{column}{0.5\textwidth}
    \begin{figure}
    \centering
        \safeincludegraphics[width=0.7\textwidth]{fawlty-towers1.png}
        \caption{A figure that is next to a certain explanation.}
    \end{figure}
\end{column}
\end{columns}

\end{frame}

\begin{frame}{Right-aligned figure}
    \hfill
    \safeincludegraphics[width=0.2\textwidth]{fawlty-towers1.png}
\end{frame}

\begin{frame}{Figure aligned at the top and centered}
    \vspace*{-40pt}
    \centering 
    \safeincludegraphics[width=0.2\textwidth]{fawlty-towers1.png}
    \vfill
\end{frame}

\begin{frame}{Opacity of an image}
\begin{tikzpicture}[remember picture, overlay]
\onslide<1>
\node
[
    left=1cm,
    opacity=0.3] at (current page.east)
{
    \safeincludegraphics[width=0.3\textwidth]{fawlty-towers1.png}
};   
\onslide<2>
\node
[
    left=1cm,
    opacity=1] at (current page.east)
{
    \safeincludegraphics[width=0.3\textwidth]{fawlty-towers1.png}
}; 
\end{tikzpicture}
\end{frame}

\begin{frame}{How to wrap text around a graphic}
\begin{wrapfigure}{r}{0.5\textwidth}
    \centering
    \safeincludegraphics[width=0.2\textwidth]{fawlty-towers1.png}
    \caption{Wrapping text around figures}
\end{wrapfigure}
\small \lipsum[1-1]
\end{frame}

\begin{frame}{Text over an image}
\centering
\begin{tikzpicture}
\node (image) 
{
    \safeincludegraphics[width=0.7\textwidth]{fawlty-towers1.png}
};
\node
[
    fill=teal,
    align=center,
    text=white,
    font={\huge\bfseries}
] at (image.center) {A beautiful photo!};
\end{tikzpicture}
\end{frame}

{
\setbeamertemplate{background canvas}
    {%
        \safeincludegraphics[width=\paperwidth,height=\paperheight]{nature.png}
    }
    
\begin{frame} {Special background}
\end{frame}
}


\begin{frame}{Subfigures in Beamer}

As you can see in Figure~\ref{fig:images}, I have inserted two images that I can reference independently: Figures~\ref{fig:nature} and~\ref{fig:fawlty-towers1}.

\begin{figure}
\centering
    \begin{subfigure}[t]{0.4\textwidth}
        \safeincludegraphics[width=0.5\textwidth]{nature.png}
        \caption{Image of the nature V1.}
        \label{fig:nature}
    \end{subfigure}
    \begin{subfigure}[b]{0.4\textwidth}
        \safeincludegraphics[width=\textwidth]{fawlty-towers1.png}
        \caption{Image of the nature V2.}
        \label{fig:fawlty-towers1}
    \end{subfigure}
\caption{Two images I want to insert.}
\label{fig:images}
\end{figure}
\end{frame}

\section{Formats, blocks, and hyperlinks}


\subsection{Formating}

\begin{frame}[label=TwoColumnsFrame]{Two columns frame in beamer}
    
\begin{columns}[T]
% Column 1
\begin{column}{0.49\textwidth}
	\centering
    Text here! Text here! ...
\end{column}

%Pseudo column
    \begin{column}{.02\textwidth}
        \rule{.1mm}{0.7\textheight}
    \end{column}

% Column 2
\begin{column}{0.5\textwidth}
	\begin{figure}
    	\safeincludegraphics[scale=0.5]{Material/misor.png.png}
           \caption{Misor logo}
     \end{figure}
\end{column}
\end{columns}    
    
\end{frame}

\begin{frame}{Text alignments}

\begin{abstract}
	In general LaTeX documents, paragraphs are usually fully justified, that is, flush both the left and right margins. If you want to change this justification, LaTeX offers the built-in environments flushleft, flushright and center to produce left justified, right justified and centred paragraphs, respectively.
\end{abstract}

\begin{flushright}
    flushright
\end{flushright}

\begin{center}
    centered
\end{center}

\begin{flushleft}
    flushleft
\end{flushleft}

In general LaTeX documents, paragraphs are usually fully justified, that is, flush both the left and right margins. If you want to change this justification, LaTeX offers the built-in environments flushleft, flushright and c $\ldots$


\end{frame}

\begin{frame}[fragile]{Semiverbatim}

\begin{abstract}
  The text inside this environment is typeset like verbatim text. However, the characters \textbackslash, \{ and \} retain their meaning. 
\end{abstract}

\begin{semiverbatim}
	Logarithm is shown with $log_b x$
\end{semiverbatim}

\end{frame}

% Code listing in Beamer


\begin{frame}[fragile]
\frametitle{Python Code listing in Beamer}

The following Python code adds two numbers and display the result using \verb|print()| function:


\rule{\textwidth}{1pt}

\scriptsize
\begin{verbatim}
# This program adds two numbers

num1 = 1.5
num2 = 6.3

# Add two numbers
sum = num1 + num2

# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
\end{verbatim}

\rule{\textwidth}{1pt}

\end{frame}



\subsection{Blocks}
\begin{frame}{Blocks}
    
\begin{block}{Block 1}
This is a simple block in beamer.
\end{block}

\begin{alertblock}{Block 2}
This is an alert block in beamer.
\end{alertblock}

\begin{exampleblock}{Block 3}
This is an example block in beamer.
\end{exampleblock}
    
\end{frame}

\begin{frame}{Math related blocks in Beamer}{Theorem, Corollary and Proof}

\begin{theorem}
    It's in \LaTeX{} so it must be true $ a^2 + b^2 = c^2$.
\end{theorem}

\begin{corollary}
    a = b
\end{corollary}

\begin{proof}
    a + b = b + c
\end{proof} 
    
\end{frame}

\begin{frame}{List of all block environments}

\begin{abstract}
The following table illustrates different block environments directly in \LaTeX{}.
This version does not require the missing image file \texttt{blockEnvironments}.
\end{abstract}

\begin{center}
\begin{tabular}{l l}
\textbf{Environment} & \textbf{Use} \\ \\[-0.8em]
\texttt{block}        & Standard information block \\
\texttt{alertblock}   & Highlight warnings or important points \\
\texttt{exampleblock} & Examples or positive results \\
\texttt{theorem}      & Mathematical statements \\
\texttt{proof}        & Proofs or derivations
\end{tabular}
\end{center}
\end{frame}


\begin{frame}{Hyperlinks and abstract of a frame}

% Abstract environment
\begin{abstract}
  This environment will create a title abstract in the information area of the frame. The margins will be wider than other
environments. 
\end{abstract}

	\hyperlink{TwoColumnsFrame}{Link to slide on two columns frame...}\\
	\hyperlink{toc}{\beamerbutton{Link to TOC ...}}
	
\end{frame}



\section{Dynamic elements}

\subsection{Overlays}

\begin{frame}{Creating Overlays in Beamer}{Pause command}
\begin{itemize}
    \item Shown from the first slide on.
\pause
    \item Shown from the second slide on.
\pause
    \item Shown from the third slide on.
\end{itemize}
\end{frame}

\begin{frame}{Overlay specifications}
\textit<1>{
    This text will be italicized only on the first slide.}
\textbf<2-4>{
    This will be bold text from the second slide to the fourth.}
\texttt<5->{
    This will be typewriter text from the fifth slide on.}
\end{frame}

\subsection{Embedded animations}

\begin{frame}{Animation}
\begin{itemize}
    \item The original command required external files named
    \texttt{Animated-0}, \texttt{Animated-1}, \ldots, \texttt{Animated-4}.
    \item Since these files are not part of the project, the frame is replaced by
    this placeholder and now compiles without the \texttt{animate} package.
\end{itemize}

% If the files are available, you can restore the original animation with:
% \usepackage{animate}
% ...
% \animategraphics[loop,width=4cm]{50}{Animated-}{0}{4}
\end{frame}





\end{document}