%%
%% This is file `mikoslides.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mikoslides.dtx  (with options: `package')
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{mikoslides}[2019/03/20 v1.2 MiKo slides Package]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=mks@sty,prefix=mks@sty@}
\DeclareStringOption[section]{topsect}
\DeclareBoolOption{mh}
\AddToKeyvalOption*{mh}{
  \PassOptionsToPackage{mh}{stex}
  \PassOptionsToPackage{mh}{smglom}
  \PassOptionsToPackage{mh}{tikzinput}}
\newif\ifnotes\notestrue
\DeclareBoolOption{notes}
\AddToKeyvalOption*{notes}{\notestrue\PassOptionsToPackage{notes}{statements}}
\DeclareComplementaryOption{slides}{notes}
\AddToKeyvalOption*{slides}{\notesfalse\PassOptionsToPackage{nontheorem}{statements}}
\DeclareBoolOption{sectocframes}
\AddToKeyvalOption*{sectocframes}{\PassOptionsToPackage{msection}{statements}}
\DeclareBoolOption{frameimages}
\DeclareBoolOption{noproblems}
\DeclareDefaultOption{\PassOptionsToPackage{\CurrentOption}{stex}
                           \PassOptionsToPackage{\CurrentOption}{smglom}
                           \PassOptionsToPackage{\CurrentOption}{tikzinput}}
\ProcessKeyvalOptions{mks@sty}
\ifmks@sty@notes
\RequirePackage{a4wide}
\RequirePackage{marginnote}
\RequirePackage{xcolor}
\RequirePackage{mdframed}
\RequirePackage[noxcolor,noamsthm]{beamerarticle}
\fi
\ifmks@sty@mh\RequirePackage{mikoslides-mh}\fi
\RequirePackage{etoolbox}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{comment}
\RequirePackage{textcomp}
\RequirePackage{url}
\RequirePackage{graphicx}
\RequirePackage{stex-logo}
\RequirePackage{pgf}
\ifmks@sty@notes
\RequirePackage[bookmarks,bookmarksopen,bookmarksnumbered,breaklinks,
linkcolor=black,citecolor=black,urlcolor=cyan,filecolor=cyan,colorlinks]{hyperref}
\fi
\RequirePackage{metakeys}
\ifmks@sty@notes
\renewcommand\usetheme[2][]{\usepackage[#1]{beamernotestheme#2}}
\fi
\newcounter{slide}
\newlength{\slidewidth}\setlength{\slidewidth}{12.8cm}
\newlength{\slideheight}\setlength{\slideheight}{9cm}
\ifmks@sty@notes%
  \renewenvironment{note}{\ignorespaces}{}%
\else%
  \excludecomment{note}%
\fi%
\newcommand\ninputref[2][]{\ifmks@sty@notes\inputref[#1]{#2}\fi}
\ifmks@sty@notes
  \newlength{\slideframewidth}
  \setlength{\slideframewidth}{1.5pt}
  \addmetakey{frame}{label}
  \addmetakey[yes]{frame}{allowframebreaks}
  \addmetakey{frame}{allowdisplaybreaks}
  \addmetakey[yes]{frame}{fragile}
  \addmetakey[yes]{frame}{shrink}
  \addmetakey[yes]{frame}{squeeze}
  \addmetakey[yes]{frame}{t}
  \renewenvironment{frame}[1][]{%
    \metasetkeys{frame}{#1}%
    \stepcounter{slide}%
    \def\@currentlabel{\theslide}%
    \ifx\frame@label\@empty%
    \else%
      \label{\frame@label}%
    \fi%
    \def\itemize@level{outer}%
    \def\itemize@outer{outer}%
    \def\itemize@inner{inner}%
    \renewcommand\newpage{}%
    \renewcommand\metakeys@show@keys[2]{\marginnote{{\scriptsize ##2}}}%
    \renewenvironment{itemize}{%
      \ifx\itemize@level\itemize@outer%
        \def\itemize@label{$\rhd$}%
      \fi%
      \ifx\itemize@level\itemize@inner%
        \def\itemize@label{$\scriptstyle\rhd$}%
      \fi%
      \begin{list}%
      {\itemize@label}%
      {\setlength{\labelsep}{.3em}%
       \setlength{\labelwidth}{.5em}%
       \setlength{\leftmargin}{1.5em}%
      }%
      \edef\itemize@level{\itemize@inner}%
    }{%
      \end{list}%
    }%
    \begin{mdframed}[linewidth=\slideframewidth,skipabove=1ex,skipbelow=1ex,userdefinedwidth=\slidewidth,align=center]\sf%
  }{%
    \medskip\miko@slidelabel\end{mdframed}%
  }%
  \renewcommand{\frametitle}[1]{{\Large\bf\sf\color{blue}{#1}}\medskip}%
\fi %ifnotes
\newrobustcmd\frameimage[2][]{%
  \stepcounter{slide}%
  \ifmks@sty@frameimages%
    \def\Gin@ewidth{}\setkeys{Gin}{#1}%
    \ifmks@sty@notes\else\vfill\fi%
    \ifx\Gin@ewidth\@empty%
      \mycgraphics[width=\slidewidth,#1]{#2}\else\mycgraphics[#1]{#2}%
    \fi%
    \par\strut\hfill{\footnotesize Slide \arabic{slide}}%
    \ifmks@sty@notes\else\vfill\fi%
  \fi%
}% ifframeimages
\ifmks@sty@notes\newcommand\pause{}\fi
\ifmks@sty@notes\newenvironment{nomtext}[1][]{\begin{omtext}[#1]}{\end{omtext}}%
\else\excludecomment{nomtext}\fi%
\ifmks@sty@notes\newenvironment{nomgroup}[2][]{\begin{omgroup}[#1]{#2}}{\end{omgroup}}%
\else\excludecomment{nomgroup}\fi%
\newlength{\slidelogoheight}
\ifmks@sty@notes%
  \setlength{\slidelogoheight}{.4cm}%
\else%
  \setlength{\slidelogoheight}{1cm}%
\fi%
\newsavebox{\slidelogo}%
\sbox{\slidelogo}{\sTeX}%
\newrobustcmd{\setslidelogo}[1]{%
  \sbox{\slidelogo}{\includegraphics[height=\slidelogoheight]{#1}}%
}%
\def\source{Michael Kohlhase}% customize locally
\newrobustcmd{\setsource}[1]{\def\source{#1}}%
\def\copyrightnotice{\footnotesize\copyright:\hspace{.3ex}{\source}}%
\newsavebox{\cclogo}%
\sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{cc_somerights}}%
\newif\ifcchref\cchreffalse%
\AtBeginDocument{%
  \@ifpackageloaded{hyperref}{\cchreftrue}{\cchreffalse}
}%
\def\licensing{%
  \ifcchref%
    \href{http://creativecommons.org/licenses/by-sa/2.5/}{\usebox{\cclogo}}%
  \else%
    {\usebox{\cclogo}}%
  \fi%
}%
\newrobustcmd{\setlicensing}[2][]{%
  \def\@url{#1}%
  \sbox{\cclogo}{\includegraphics[height=\slidelogoheight]{#2}}%
  \ifx\@url\@empty%
    \def\licensing{{\usebox{\cclogo}}}%
  \else%
    \def\licensing{%
      \ifcchref%
      \href{#1}{\usebox{\cclogo}}%
      \else%
      {\usebox{\cclogo}}%
      \fi%
    }%
  \fi%
}%
\newrobustcmd\miko@slidelabel{%
  \vbox to \slidelogoheight{%
    \vss\hbox to \slidewidth%
    {\licensing\hfill\copyrightnotice\hfill\arabic{slide}\hfill\usebox{\slidelogo}}%
  }%
}%
\sffamily
\AtBeginDocument{%
\definecolor{green}{rgb}{0,.5,0}%
\definecolor{purple}{cmyk}{.3,1,0,.17}%
}%
\def\defemph#1{{\textcolor{magenta}{#1}}}
\def\notemph#1{{\textcolor{magenta}{#1}}}
\def\stDMemph#1{{\textcolor{blue}{#1}}}
\def\@@lec#1{(\textcolor{green}{#1})}
\pgfdeclareimage[width=.8em]{miko@small@dbend}{dangerous-bend}
\def\smalltextwarning{%
  \pgfuseimage{miko@small@dbend}%
  \xspace%
}%
\pgfdeclareimage[width=1.2em]{miko@dbend}{dangerous-bend}
\newrobustcmd\textwarning{%
  \raisebox{-.05cm}{\pgfuseimage{miko@dbend}}%
  \xspace%
}%
\pgfdeclareimage[width=2.5em]{miko@big@dbend}{dangerous-bend}%
\newrobustcmd\bigtextwarning{%
  \raisebox{-.05cm}{\pgfuseimage{miko@big@dbend}}%
  \xspace%
}%
\newrobustcmd\putgraphicsat[3]{%
  \begin{picture}(0,0)\put(#1){\includegraphics[#2]{#3}}\end{picture}%
}%
\newrobustcmd\putat[2]{%
  \begin{picture}(0,0)\put(#1){#2}\end{picture}%
}%
\ifmks@sty@sectocframes%
\ifdefstring\mks@sty@topsect{part}{%
  \newcounter{mpart}\newcounter{mchapter}\newcounter{msection}[mchapter]}
{\ifdefstring\mks@sty@topsect{chapter}{%
    \newcounter{mchapter}\newcounter{msection}[mchapter]}
  {\newcounter{msection}}}
\newcounter{msubsection}[msection]%
\newcounter{msubsubsection}[msubsection]%
\newcounter{msubsubsubsection}[msubsubsection]%
\fi% ifsectocframes
\RequirePackage{stex}
\RequirePackage{smglom}
\RequirePackage{tikzinput}
\section@level=2
\ifdefstring{\mks@sty@topsect}{part}{\section@level=0}{}
\ifdefstring{\mks@sty@topsect}{chapter}{\section@level=1}{}
\ifmks@sty@notes\else% only in slides
\def\part@prefix{\ifdefstring\mks@sty@topsect{part}{\arabic{mchapter}.}{}}
\renewenvironment{omgroup}[2][]{%
  \metasetkeys{omgroup}{#1}\sref@target%
  \advance\section@level by 1%
  \ifmks@sty@sectocframes%
  \stepcounter{slide}
  \begin{frame}[noframenumbering]%
  \vfill\Large\centering%
  \red{%
    \ifcase\section@level\or
    \stepcounter{mpart}
    \def\@@label{Part \Roman{mpart}}
    \def\currentsectionlevel{part}
    \or%
    \stepcounter{mchapter}
    \def\@@label{Chapter \arabic{mchapter}}
    \def\currentsectionlevel{chapter}
    \or
    \stepcounter{msection}
    \def\@@label{\part@prefix\arabic{msection}}
    \def\currentsectionlevel{section}
    \or
    \stepcounter{msubsection}
    \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}}
    \def\currentsectionlevel{subsection}
    \or
    \stepcounter{msubsubsection}
    \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}.\arabic{msubsubsection}}
    \def\currentsectionlevel{subsubsection}
    \or
    \stepcounter{msubsubsubsection}
    \def\@@label{\part@prefix\arabic{msection}.\arabic{msubsection}.\arabic{msubsubsection}.\arabic{msubsubsubsection}}
    \def\currentsectionlevel{subsubsubsection}
    \fi% end ifcase
    \@@label\sref@label@id\@@label
    \quad #2%
  }%
  \vfill%
  \end{frame}%
  \fi %ifmks@sty@sectocframes
}
{\advance\section@level by -1}%
\fi% ifmks@sty@notes
\def\inserttheorembodyfont{\normalfont}
\defbeamertemplate{theorem begin}{miko}
{\inserttheoremheadfont\inserttheoremname\inserttheoremnumber
  \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
  \inserttheorempunctuation\inserttheorembodyfont\xspace}
\defbeamertemplate{theorem end}{miko}{}
\setbeamertemplate{theorems}[miko]
\expandafter\def\csname Parent2\endcsname{}
\ifmks@sty@notes%
  \renewenvironment{columns}[1][]{%
    \par\noindent%
    \begin{minipage}%
    \slidewidth\centering\leavevmode%
  }{%
    \end{minipage}\par\noindent%
  }%
  \newsavebox\columnbox%
  \renewenvironment<>{column}[2][]{%
    \begin{lrbox}{\columnbox}\begin{minipage}{#2}%
  }{%
    \end{minipage}\end{lrbox}\usebox\columnbox%
  }%
\fi% ifnotes
\ifmks@sty@noproblems%
  \newenvironment{problems}{}{}%
\else%
  \excludecomment{problems}%
\fi%
\endinput
%%
%% End of file `mikoslides.sty'.
