%%%
%%% Carsten Gips, FH Bielefeld
%%% 06.09.2015
%%%
%%% Gemeinsame Definitionen fuer LaTeX-Exporte: Slides/Beamer, Uebungsblatt, Klausur, ...)
%%%

%------------------------------------- Pakete ---------------------
\usepackage{xspace}
%------------------------------------- Pakete ---------------------


%------------------------------------- Farben ---------------------
\usepackage{xcolor}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{dkred}{rgb}{0.6,0,0}
\definecolor{dkblue}{rgb}{0,0,0.6}
\definecolor{gray}{rgb}{0.7,0.7,0.7}
\definecolor{listinggray}{gray}{0.92}
\definecolor{midnightblue}{rgb}{0.2,0.2,0.7}
%------------------------------------- Farben ---------------------


%------------------------------------- Befehle ---------------------
\newcommand{\Alert}[1]{\alert{\textbf{#1}}\xspace}
\newcommand{\blueArrow}{{\color{midnightblue}$\pmb{\Rightarrow}$}\xspace}

\newcommand{\columnsbegin}{\begin{columns}}
\newcommand{\columnsend}{\end{columns}}
\newcommand{\minipagebegin}{\begin{minipage}}
\newcommand{\minipageend}{\end{minipage}}
\newcommand{\centerbegin}{\begin{center}}
\newcommand{\centerend}{\end{center}}

\newsavebox{\mynotebox}
\newcommand{\usemynotebox}{\usebox{\mynotebox}}
\newenvironment{mynotes}[1][\textwidth]{\begin{lrbox}{\mynotebox}\begin{minipage}{#1}}{\end{minipage}\end{lrbox}\usemynotebox}
\newcommand{\notesbegin}{\begin{mynotes}}
\newcommand{\notesend}{\end{mynotes}}

\newsavebox{\mycolorbox}
\newenvironment{mycbox}{\begin{lrbox}{\mycolorbox}}{\end{lrbox}\begin{center}\fcolorbox{blue}{listinggray}{\usebox{\mycolorbox}}\end{center}}
\newcommand{\cboxbegin}{\begin{mycbox}}
\newcommand{\cboxend}{\end{mycbox}}
%------------------------------------- Befehle ---------------------


%------------------------------------- Listings ---------------------
%% Einstellungen fuer alle Listings (Package-Import in Template)
\lstset{basicstyle=\small\ttfamily\mdseries, xleftmargin=\bigskipamount, keywordstyle=\bfseries\color{dkblue}, identifierstyle=\ttfamily, commentstyle=\bfseries\color{gray}\textsl, stringstyle=\color{magenta}\upshape, emphstyle=\color{red}, emphstyle={[2]\color{blue}}, texcl=false, showspaces=false, showstringspaces=false, numbers=left, numberstyle=\footnotesize, breaklines=true, tabsize=4, backgroundcolor=\color{listinggray}, frame=shadowbox}

%% Latex-Keywords
%\lstset{morekeywords={subtitle, institute, logo, titlegraphic, subject, keywords, author, document, subfigure, chapter, section, subsection,subsubsection, paragraph, tiny, small, itemize, description, enumerate, lsubset, boolean, setboolean, ifthen, lengthtest, equal, IfFileExists, InputIfFileExists, AtBeginDocument, AtEndDocument, DefinesOption, ProcessOptions, ExecuteOption, ProvidesPackage, RequirePackage, align, center, minipage, includegraphics, maketitle, tableofcontents, equation, cases}}

%% Scala-Keywords: Scala wird von Listings nicht unterstützt?!
\lstset{morekeywords={class, object, trait, extends, override, new, def, val, var, for, yield, if, else, require, with, match, case}}

%% Ruby/IO-Keywords
%\lstset{morekeywords={print,Object,clone,slotNames,type,method,proto,getSlot,block,super,resend,OperatorTable,addOperator,call,sender,target,message,doMessage,forward}}

%% Java-Keywords
%\lstset{morekeywords={project,target,echo,property,javac,delete,copy,fileset,dirset,include,exclude,classpath,pathelement,junit,test,batchtest,formatter,junitreport,report}}


%% Code-Befehl (Code im Text: lieber grün und fett als texttt und klein)
%% => DEPRECATED!
\newcommand{\code}[1]{\textcolor{dkgreen}{\texttt{\textbf{#1}}}\xspace}
%------------------------------------- Listings ---------------------


