%\PassOptionsToPackage{colorlinks}{hyperref}

\documentclass[10pt, aspectratio=169, usenames,dvipsnames]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% \usepackage[ngerman]{babel}
%\usepackage{amsmath}
\usepackage{float}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{subcaption}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage[binary-units]{siunitx}
%\geometry{textheight=17.07cm,textwidth=6.9cm}
%\usepackage{pgfpages}
%\pgfpagesuselayout{resize to}[physical paper height=17.07cm,
%                              physical paper width=6.9cm]
%\setbeamertemplate{note page}[plain]
%\setbeameroption{show notes on second screen=right}
\usepgfplotslibrary{colorbrewer}
\usetikzlibrary{external}
\tikzexternalize[prefix=build/]

\usepackage{csquotes}
\usepackage[citestyle=numeric, style=alphabetic, backend=biber,
            doi=false,url=false,isbn=false]{biblatex}
\addbibresource{presentation.bib}



\pgfplotsset{
    /pgfplots/colormap/mako/.style={
        colormap={mako}{
            rgb=(0.18195582, 0.11955283, 0.23136943)
            rgb=(0.25307401, 0.23772973, 0.48316271)
            rgb=(0.21607792, 0.39736958, 0.61948028)
            rgb=(0.20344718, 0.56074869, 0.65649508)
            rgb=(0.25187832, 0.71827158, 0.67872193)
            rgb=(0.54578602, 0.8544913, 0.69848331)
        }
    },
    /pgfplots/colormap/rocket/.style={
        colormap={rocket}{
            rgb=(0.20973515, 0.09747934, 0.24238489)
            rgb=(0.43860848, 0.12177004, 0.34119475)
            rgb=(0.67824099, 0.09192342, 0.3504148)
            rgb=(0.8833417, 0.19830556, 0.26014181)
            rgb=(0.95381595, 0.46373781, 0.31769923)
            rgb=(0.96516917, 0.70776351, 0.5606593)
        }
    },
    /pgfplots/colormap/cividis/.style={
        colormap={cividis}{
            rgb=(0.130669, 0.231458, 0.43284)
            rgb=(0.298421, 0.332247, 0.423973)
            rgb=(0.42512, 0.431334, 0.447692)
            rgb=(0.555393, 0.537807, 0.471147)
            rgb=(0.695985, 0.648334, 0.440072)
            rgb=(0.849223, 0.771947, 0.359729)
        }
    },
    colormap/cividis,
    colormap/mako,
    colormap/rocket,
}




\newbibmacro{string+doiurlisbn}[1]{%
  \iffieldundef{doi}{%
    \iffieldundef{url}{%
      \iffieldundef{isbn}{%
        \iffieldundef{issn}{%
          #1%
        }{%
          \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
        }%
      }{%
        \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
      }%
    }{%
      \href{\thefield{url}}{#1}%
    }%
  }{%
    \href{http://dx.doi.org/\thefield{doi}}{#1}%
  }%
}



\DeclareFieldFormat{title}{%
  \usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\usebibmacro{string+doiurlisbn}{\mkbibquote{#1\isdot}}}
\DeclareFieldFormat
  [suppbook,suppcollection,suppperiodical]
  {title}{\usebibmacro{string+doiurlisbn}{#1}}



\setlength {\marginparwidth }{2cm}

\newcommand{\templates}{../lib}

% packages to be included
\input{\templates/packages.tex}
\presetkeys{todonotes}{inline}{}

% modifications to stick to new KIT style
\input{\templates/modifications.tex}

% marcos used throughout the slides
\input{\templates/makros_own.tex}


\title{Application of Optimization Algorithms for Channel Decoding}
\subtitle{\small Midterm Presentation}
%\author{Andreas Tsouchlos}
\author{\vspace{1.5mm} Andreas Tsouchlos}

\institute{Karlsruhe Institute of Technology (KIT), \\ Communications Engineering Lab (CEL) }


\AtBeginSection[]
{
    \begin{frame}[t]
        \frametitle{\ifthenelse{\boolean{EnglishLanguage}}{Overview}{Übersicht}}
    \tableofcontents[sectionstyle=show/shaded,
                     subsectionstyle=show/show/shaded,
                     subsubsectionstyle=hide]
    \end{frame}
}
\AtBeginSubsubsection[]{}
\AtBeginSubsection[]{}


\pgfplotsset{
    discard if/.style 2 args={
        x filter/.append code={
            \edef\tempa{\thisrow{#1}}
            \edef\tempb{#2}
            \ifx\tempa\tempb
                \def\pgfmathresult{inf}
            \fi
        }
    },
    discard if not/.style 2 args={
        x filter/.append code={
            \edef\tempa{\thisrow{#1}}
            \edef\tempb{#2}
            \ifx\tempa\tempb
            \else
                \def\pgfmathresult{inf}
            \fi
        }
    },
    discard if gt/.style 2 args={
        x filter/.append code={
            \edef\tempa{\thisrow{#1}}
            \edef\tempb{#2}
            \ifdim\tempa pt > \tempb pt
                \def\pgfmathresult{inf}
            \fi
        }
    }
}


\DeclareCaptionLabelFormat{algocaption}{Algorithm} % defines a new caption label as Algorithm x.y

\lstnewenvironment{algorithm}[1][] %defines the algorithm listing environment
{
    \captionsetup{labelformat=algocaption,labelsep=colon} % defines the caption setup for:
                                                          % it ises label format as the declared
                                                          % caption label above and makes label
                                                          % and caption text to be separated
                                                          % by a ':'
    \lstset{ %this is the stype
        mathescape=true,
        frame=tB,
        numbers=left,
        numberstyle=\tiny,
        basicstyle=\normalfont,
        columns=fullflexible,
        keywordstyle=\color{black}\bfseries,
        keywords={a, for, end, do, b} % add the keywords you want, or load
                                      % a language as Rubens explains in his comment above.
        numbers=left,
        xleftmargin=.04\textwidth,
        #1 % this is to add specific settings to an usage of this
           % environment (for instnce, the caption and referable label)
    }
}
{}


\begin{document}

    \newboolean{EnglishLanguage}
    \setboolean{EnglishLanguage}{True}

    \begin{frame}[plain]
        \maketitle
    \end{frame}

    \begin{frame}[t]
        \frametitle{Overview}
        \tableofcontents
    \end{frame}

    \setnextsection{0}
    \input{sections/theoretical_background.tex}
    \input{sections/decoding_algorithms.tex}
    \input{sections/examination_results.tex}
    \input{sections/forthcoming_examination.tex}

    \begin{frame}[allowframebreaks]
        \frametitle{Bibliography}
        \printbibliography[heading=none]
    \end{frame}

    \input{sections/appendix.tex}


\end{document}
