%======================== Fonts ==========================
%
\mode<article>{%
  \usepackage[utf8]{inputenc}
  \usepackage{hyperref}
  \usepackage[T1]{fontenc}
  \usepackage[altbullet]{lucidabr}     % get larger bullet
}%
\mode<presentation>{%
  \usepackage[T1]{fontenc}
  \usepackage[default]{sourcesanspro}
  \usepackage[scaled=1.0]{newtxsf}
  \usepackage{inconsolata}
}%
%======================== Algorithms ==========================
%
\usepackage{clrscode3e}
\renewcommand{\proc}[1]{\textnormal{\scshape\bfseries#1}}
%
%======================== Beamer settings ==========================
%
% Beamer theme and theme configuration
\mode<article>{%
  \setbeamertemplate{frametitle}{\subsubsection*{\insertframetitle}}
  \setbeamertemplate{frame begin}{}
  \setbeamertemplate{frame end}{\par\medskip}
}%
\mode<presentation>{%
  \usetheme{default}
  \beamertemplatenavigationsymbolsempty%
  %
  % margins
  \setbeamersize{text margin left=0.5cm,text margin right=0.5cm}
  %
  % presentation title
  \setbeamerfont{title}{size=\LARGE,series=\bfseries}
  \setbeamercolor{title}{fg=blue!70!black}
  \setbeamerfont{title}{size=\LARGE,series=\bfseries}
  \setbeamercolor{title}{fg=blue!70!black}
  %
  % slide title (Notice: no subtitle!)
  \setbeamerfont{frametitle}{size=\Large,series=\bfseries}
  \setbeamercolor{frametitle}{fg=blue!70!black}
  \setbeamertemplate{frametitle}{%
    \nointerlineskip
    \begin{beamercolorbox}[sep=.1ex,wd=\paperwidth,leftskip=.5cm,rightskip=0pt]{frametitle}%
      \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\hfill\insertframetitle\;\strut%
    \end{beamercolorbox}}%
  %
  % alerted text
  \setbeamerfont{alerted text}{shape=\itshape,series=\bfseries}
  \setbeamercolor{alerted text}{fg=blue!70!black}
  %
  % itemize
  \setbeamercolor{itemize item}{fg=blue!70!black}
  \setbeamercolor{itemize subitem}{fg=blue!70!black}
  \setbeamertemplate{itemize item}[square]
  \setbeamertemplate{itemize subitem}[triangle]
  %
  % blocks
  \setbeamercolor{block body example}{fg=black!90,bg=black!10}
  \setbeamercolor{block title example}{fg=white,bg=blue!30!black!30}
  \setbeamertemplate{blocks}[shadow=true]
}
%
\usepackage{iftex}
\ifpdf\relax
\else
%
% We are not using PDFLaTeX and therefore we load and use PSTricks
%
\usepackage{pstricks}
\usepackage{pst-node}

%======================== PsTricks settings and styles ================
\mode<presentation>{%
  %
  % reference points
  \setbeamertemplate{background canvas}{%
    \pnode(0.5\paperwidth,-0.5\paperheight){CANVASCENTER}%
    \pnode(0,0){CANVASTOPLEFT}%
    \pnode(\paperwidth,-\paperheight){CANVASBOTTOMRIGHT}%
    \pnode(0,-\paperheight){CANVASBOTTOLEFT}%
    \pnode(\paperwidth,0){CANVASTOPRIGHT}%
  }%
}%
\psset{dimen=middle,shadowcolor=gray,shadowsize=4pt}
\IfFileExists{ac-pst-shadow.sty}{%
\usepackage{ac-pst-shadow}
\psset{shadowopacity=0.5}}{}%
\relax%
\newpsobject{algobox}{psshadowbox}{%
  fillstyle=solid,linestyle=none,fillcolor=black!10}
\newpsobject{alertbox}{psframebox}{%
  boxsep=false,fillstyle=solid,doubleline=true,fillcolor=white,linecolor=blue}
%
\fi %%  Done with PSTricks

