%
% items enger zusammen!!!!
%
\setlength{\itemsep}{1pt plus 4pt}
\setlength{\parsep}{0mm}
\setlength{\itemindent}{5mm}

\newcommand{\ALBERTA}{\textsf{ALBERTA}\xspace}
\newcommand{\Version}{Version 2.0\xspace}
\newcommand{\kitem}[1]{\item[{\ttfamily\bfseries #1}]}
\newcommand{\hyperitem}[2]{\item[\hypertarget{#1}{\ttfamily\bfseries #2}]}
\newcommand{\nil}{\texttt{NULL}\xspace}
\newcommand{\false}{\texttt{false}\xspace}
\newcommand{\true}{\texttt{true}\xspace}
\newcommand{\Strut}{\vphantom{$f^f_f$}}
\renewcommand{\iff}{if{f}\xspace}

\swapnumbers
\newtheorem{theorem}{Theorem}[section]
\newcommand{\theoremref}[1]{Theorem~\ref{#1}}
\newtheorem{lemma}[theorem]{Lemma}
\newcommand{\lemmaref}[1]{Lemma~\ref{#1}}
\newtheorem{corollary}[theorem]{Corollary}
\newcommand{\corollaryref}[1]{Corollary~\ref{#1}}
\newtheorem{exercise}[theorem]{Exercise}
\newcommand{\exerciseref}[1]{Exercise~\ref{#1}}
\newtheorem{compatibility}[theorem]{Compatibility Note}
\newcommand{\compatref}[1]{Compatibility~Note~\ref{#1}}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newcommand{\definitionref}[1]{Definition~\ref{#1}}
\newtheorem{algorithm}[theorem]{Algorithm}
\newcommand{\algorithmref}[1]{Algorithm~\ref{#1}}
\newtheorem{remark}[theorem]{Remark}
\newcommand{\remarkref}[1]{Remark~\ref{#1}}
\newtheorem{scheme}[theorem]{Scheme}
\newcommand{\schemeref}[1]{Scheme~\ref{#1}}
\newtheorem{example}[theorem]{Example}
\newcommand{\exampleref}[1]{Example~\ref{#1}}
\newcommand{\tableref}[1]{Table~\ref{#1}}

\newtheorem{_function}[theorem]{Function}
\newcommand{\functionref}[1]{Function~\ref{#1}}
\newtheorem{_datatype}[theorem]{Datatype}
\newcommand{\datatyperef}[1]{Datatype~\ref{#1}}
\newtheorem{_structure}[theorem]{Structure}
\newcommand{\structureref}[1]{Structure~\ref{#1}}

\newenvironment{function}[1]%
{\begin{_function}[\code{#1}]~\hfill

\renewcommand{\descriptionlabel}[1]{\hspace\labelsep
  \normalfont\itshape ##1}
\begin{description}}%
{\end{description}\end{_function}}

\newenvironment{datatype}[1]%
{\begin{_datatype}[\code{#1}]~\hfill

\renewcommand{\descriptionlabel}[1]{\hspace\labelsep
  \normalfont\itshape ##1}
\begin{description}}%
{\end{description}\end{_datatype}}

\newenvironment{structure}[1]%
{\begin{_structure}[\code{#1}]~\hfill

\renewcommand{\descriptionlabel}[1]{\hspace\labelsep
  \normalfont\itshape ##1}
\begin{description}}%
{\end{description}\end{_structure}}

%\newtheorem{algorithm}{Algorithm}[section]
%\newtheorem{theorem}{Theorem}[section]
%\newtheorem{lemma}{Lemma}[section]
%\newtheorem{definition}{Definition}[section]

% Kuni's Spielzeuge
\newcommand{\Comment}[1]{}
\newenvironment{algotab}%
{~\ttfamily\begin{samepage}%
\begin{tabbing}%
 \hspace*{5mm}\=\hspace{3ex}\=\hspace{3ex}\=\hspace{3ex}\=\hspace{3ex}%
\=\hspace{3ex}\=\hspace{3ex}\=\hspace{3ex}\=\hspace{3ex}\kill}%
{\end{tabbing}\end{samepage}}
\newenvironment{descr}
{\begin{list}{$\bullet$}{\topsep0mm \labelwidth0cm \leftmargin5mm %
  \itemsep1pt plus 4pt \topsep3pt \parsep1pt plus 4pt \labelsep3mm}}
{\end{list}}
\newenvironment{indented}{\par\begin{list}{}%
 {\setlength{\leftmargin}{5mm}\setlength{\parskip}{0mm}%
 \setlength{\topsep}{0mm}\setlength{\partopsep}{0mm}%
 \setlength{\parsep}{0mm}\setlength{\itemsep}{0mm}}\item[]}%
 {\end{list}}
\newcommand{\todo}[1]{{\Large \sc #1???}}

\ifpdf
\else
%\newcommand{\hyperpage}[1]{#1}
\fi
%\newenvironment{algorithm}[#1]%
%{\begin{Algorithm}[#1]~par\tt}{\end{Algorithm}}


\newcommand{\bv}{~\par\begin{list}%
{\bf test}{\labelwidth0cm \leftmargin4mm \itemsep1pt plus 4pt%
             \topsep3pt \parsep1pt plus 4pt \labelsep0mm \small}\item[]}
\newcommand{\ev}{\end{list}\par\noindent}
%\def\idx#1{\index{#1}}
%\def\bvi#1{\bv \index{#1}}
%\def\evi{\ev}
%\def\bvii#1#2{\bv \index{#1}\index{#2}}
%\def\evii{\ev}
%\def\bviii#1#2#3{\bv \index{#1}\index{#2}\index{#3}}
%\def\eviii{\ev}
%\def\bviiii#1#2#3#4{\bv \index{#1}\index{#2}\index{#3}\index{#4}}
%\def\eviiii{\ev}
\newcommand{\bs}{$\backslash$}
%\def\code#1{\ifmmode\mathtt{#1}\else\texttt{#1}\fi}
\newcommand{\code}[1]{{\ifmmode\mathchoice{\mbox{\texttt{#1}}}%
{\mbox{\texttt{#1}}}%
{\mbox{\scriptsize{\texttt{#1}}}}%
{\mbox{\scriptsize{\texttt{#1}}}}%
\else{\ttfamily\upshape #1}\fi}}

\renewcommand{\atop}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}

\newcommand{\ds}{\displaystyle}
\renewcommand{\dim}{\mathrm{dim}\xspace}
\newcommand{\eps}{\varepsilon}
\newcommand{\GD}{{\Gamma_D}}
\newcommand{\GN}{{\Gamma_N}}
\newcommand{\mathref}[1]{\ifmmode\mathrm{(\ref{#1})}\else(\ref{#1})\fi}
\newcommand{\secref}[1]{Section~\ref{#1}}
\newcommand{\secrefii}[2]{Sections~\ref{#1}, \ref{#2}}
\newcommand{\figref}[1]{Figure~\ref{#1}}
\newcommand{\figrefii}[2]{Figures~\ref{#1}, \ref{#2}}

\newcommand{\half}{\frac12}
\newcommand{\Hk}{\mathaccent23 H}
\newcommand{\hS}{{h_S}}

\newcommand{\jedenorm}[3]{{#1}{#2}{#1}_{#3}}
\newcommand{\jedenormq}[3]{{#1}{#2}{#1}_{#3}^2}
\newcommand{\jedesskp}[5]{{#1}{#2},\,{#3}{#4}_{#5}}

\newcommand{\lnorm}[2]{\jedenorm{\|}{#1}{#2}}
\newcommand{\lnormq}[2]{\jedenormq{\|}{#1}{#2}}
\newcommand{\lskp}[3]{\jedesskp{\big(}{#1}{#2}{\big)}{#3}}
\newcommand{\ldual}[3]{\jedesskp{\big\langle}{#1}{#2}{\big\rangle}{#3}}
\newcommand{\lduals}[3]{\ldual{#1}{#2}{#3^{^*}\!\times #3}}
\newcommand{\fnorm}[2]{[\![#1]\!]_{#2}}
\newcommand{\Lin}{\mathcal{L}}
\newcommand{\Nc}{\mathaccent23 N}
\newcommand{\nO}{\nu_{\scriptscriptstyle \Omega}}
\newcommand{\rhoS}{\rho_S}
\newcommand{\Shat}{\hat S}
\newcommand{\Sbar}{\bar S}
\newcommand{\Phat}{\hat\P}
\newcommand{\Pbar}{\bar\P}
\newcommand{\PS}{\P_S}
\newcommand{\vphi}{\varphi}
\newcommand{\ph}{\vphi_h}
\newcommand{\pbar}{\bar\vphi}
\newcommand{\phat}{\hat\vphi}
\newcommand{\gh}{g_h}
\newcommand{\tria}{\mathcal{S}}
\newcommand{\triaT}{\mathcal{T}}
\newcommand{\uh}{u_h}
\newcommand{\vh}{v_h}
\newcommand{\lS}{\lambda^{S}}
\newcommand{\lShat}{\lambda^{\Shat}}
\newcommand{\LS}{\Lambda^{S}}
\newcommand{\lSp}{\lambda^{S'}}
\newcommand{\lc}[1]{\lambda_\code{#1}}
\newcommand{\nablal}{\nabla_{\hskip -2pt \lambda}}
\newcommand{\supp}{\mathrm{supp}}
\newcommand{\tol}{\mathit{tol}}
\newcommand{\xhat}{\hat x}
\newcommand{\xS}{x^S}
\newcommand{\xShat}{x^{\Shat}}
\newcommand{\Xc}{\mathaccent23 X}
%\newcommand\Xc{X_0}

\newcommand{\ul}[1]{\underline{#1}}
\newcommand{\I}{\mathbb{I}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\renewcommand{\P}{\mathbb{P}}

\let\Vec=\vec
\renewcommand{\vec}[1]{\boldsymbol{#1}}

\DeclareMathOperator{\Span}{span}

\newcommand{\DOW}{\code{DIM\_OF\_WORLD}\xspace}
\newcommand{\DIMMAX}{\code{DIM\_MAX}\xspace}
\newcommand{\DIMLIM}{\code{DIM\_LIMIT}\xspace}
\newcommand{\BARYMAX}{\code{N\_LAMBDA\_MAX}\xspace}
\newcommand{\albertaH}{\code{alberta.h}\xspace}
\newcommand{\REALD}{\code{REAL\_D}\xspace}
\newcommand{\REALB}{\code{REAL\_B}\xspace}
\newcommand{\DOFs}{\code{DOFs}\xspace}
\newcommand{\DOF}{\code{DOF}\xspace}

%----------------Bilder, Nummerierung
%\numberwithin{equation}{chapter}
%\numberwithin{table}{section}
%\numberwithin{figure}{section}


%\@addtoreset{equation}{section}
%\@addtoreset{table}{section}
%\@addtoreset{figure}{section}

\renewcommand{\labelenumii}{\roman{enumii}.}
%\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
%\renewcommand{\theequation}{\mbox{\arabic{section}.\arabic{equation}}}
