% packages
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{listings}
\usepackage[newfloat=true]{minted}
\usepackage{xparse}

% for \verb inside \item
\usepackage[T1]{fontenc}
\usepackage[Q=yes]{examplep}

\input{../common/common_configuration.tex}

% package configuration
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{footline}[frame number]

% macros and environments
\newcommand{\slidep}{\onslide<+->}
\newenvironment{itemizep}
 {\begin{itemize}[<+->]}
 {\end{itemize}}
 
\NewDocumentCommand {\slide} { m O{} O{} }
	{\begin{frame}{#3}
		\frametitle{\thesection.\ifnum\thesubsection=0\else\thesubsection.\fi\ \currentname {#2}}
		\input{#1}
	\end{frame}}
	
\NewDocumentCommand {\slidetoc} { }
	{\begin{frame}
		\frametitle{\thesection. \currentname}
		\tableofcontents[currentsection,hideothersubsections]
	\end{frame}}
 
 % sections numbered
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
\defbeamertemplate{subsubsection in toc}{subsubsections numbered}
{\leavevmode\leftskip=3em%
 \rlap{\hskip-3em\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber}%
 \inserttocsubsubsection\par}
\setbeamertemplate{subsubsection in toc}[subsubsections numbered] 

% get current section name
\usepackage{nameref}
\makeatletter
\newcommand*{\currentname}{\@currentlabelname}
\makeatother