\newcommand{\hrefn}[1]{\href{#1}{#1}}

% Macht richtige Anfuehrungszeichen: ,, Bla ''
\newcommand{\myquote}[1]{\glqq{}#1\grqq{}}

\newcommand{\todo}[1]{%
  $\bigstar$%
  \marginpar{%
  \begin{flushleft}%
  \vspace{-1.5\baselineskip}%
  $\bigstar$\textbf{TODO:\\}%
  #1
  \end{flushleft}%
  }%
}%

\newcommand{\stress}[1]{\emph{#1}}

%buzzwords am Rand notieren
\newcommand{\buzzwords}[1]{%
  \marginpar{%
  \begin{flushleft}%
  \textbf{{\small #1}}%
  \end{flushleft}%
  }%
}%

\input{icl-file-root}


\newcommand{\reffig}[1]{%
  Figure \ref{#1}
}%
\newcommand{\seefig}[1]{%
  [see \reffig{#1}]
}%
%\newcommand{\iclfileroot}{%
%  file:///vol/nivision/ICL/4.1%
%}%

\newcommand{\iclrefref}{%
  {\tiny{\textbf{\href{\iclfileroot/ICL/index.html}{[ICL-Reference]}}}}%
}%

%  {\tiny{\textbf{\href{file:///vol/nivision/ICL/4.1/doc/ICL#1/icl#2_8h.html}{[ICL#1:icl#2.h]}}}}%
\newcommand{\iclheaderref}[2]{%
  {\tiny{\textbf{\href{\iclfileroot/ICL#1/icl#2_8h.html}{[ICL#1:icl#2.h]}}}}%
}%
%  {\tiny{\textbf{\href{file:///vol/nivision/ICL/4.1/doc/ICL#1/namespaceicl.html}{[ICL#1:functions]}}}}%
\newcommand{\iclnamespaceref}[1]{%
  {\tiny{\textbf{\href{\iclfileroot/ICL#1/namespaceicl.html}{[ICL#1:functions]}}}}%
}%

%  {\tiny{\textbf{\href{file:///vol/nivision/ICL/4.1/doc/ICL#1/classicl_1_1#2.html}{[ICL#1:#2]}}}}%
\newcommand{\iclclassref}[2]{%
  {\tiny{\textbf{\href{\iclfileroot/ICL#1/classicl_1_1#2.html}{[ICL#1:#2]}}}}%
}
\newcommand{\iclstructref}[2]{%
  {\tiny{\textbf{\href{\iclfileroot/ICL#1/structicl_1_1#2.html}{[ICL#1:#2]}}}}%
}


%  {\tiny{\textbf{\href{file:///vol/nivision/ICL/4.1/doc/ICL#1/index.html}{[ICL#1]}}}}%
\newcommand{\iclpackageref}[1]{%
  {\tiny{\textbf{\href{\iclfileroot/ICL#1/index.html}{[ICL#1]}}}}%
}


\newcommand{\reference}[1]{%
  {(\small{$\Rightarrow$})}
  \marginpar{%
  \begin{flushleft}%
    {\small{ $\Rightarrow$ #1}}%
  \end{flushleft}%
  }%
}%


% #1: filename
% #2: label
% #3: caption
% #4: size etc. e.g. width=40px
\newcommand{\iclfigure}[3]{
\begin{figure}[!ht]
  \centering
  \includegraphics[#3]{media/#1}
  \caption{
    #2
    %\picfilename{#1}
  }
  \label{#1}
\end{figure}
}


\newcommand{\includechapter}[2]{\chapter{#1\label{cha:#2}}\input{chapters/#2}\pagebreak}

%\newcommand{\inlinecode}[1]{\textbf{\texttt{#1}}}
\newcommand{\inlinecode}[1]{\lstinline[breaklines=false]^#1^}
\newcommand{\icode}[1]{\lstinline[breaklines=false]^#1^}

\newcommand{\displaycode}[1]{
\begin{lstlisting}[numbers=none]^^J
#1^^J
\end{lstlisting}
}

%\def \displaycode [#1] {\\%
%begin{lstlisting}\\%
%#1\\%
%\end{lstlisting}\\%
%}

\newcommand{\cstring}[1]{\textbf{\texttt{#1}}}
\newcommand{\filename}[1]{\textbf{\texttt{#1}}}
  
\newcommand{\buzz}[1]{\buzzwords{#1}}

% Für die Darstellung von mathm. Räumen
\newcommand{\mathr}[1]{\ensuremath{I\hspace{-0.39em}#1}\xspace}
% O(n) Notation
% Øexistiert eigentlich schon und produziert
% sowas wie ein durchschittssymbol
%\renewcommandØ[1]{\textit{O}\ensuremath{(#1)}}

% Abkürzungen
\newcommand{\zB}{z.\,B.\xspace}
\newcommand{\zZ}{z.\,Z.\xspace}
\newcommand{\ZZ}{Z.\,Z.\xspace}
\newcommand{\bspw}{bspw.\xspace}
\newcommand{\bsp}{Bsp.\xspace}
\newcommand{\sog}{sog.\xspace}
\newcommand{\usw}{usw.\xspace}
\newcommand{\bzw}{bzw.\xspace}
\renewcommand{\dh}{d.\,h.\xspace}
\newcommand{\iAllg}{i.\,Allg.\xspace}
\newcommand{\idR}{i.\,d.\,R.\xspace}
\newcommand{\evtl}{evtl.\xspace}
\newcommand{\etc}{etc.\xspace}
\newcommand{\uU}{u.\,U.\xspace}
\newcommand{\uA}{u.\,A.\xspace}
\newcommand{\ggf}{ggf.\xspace}
\newcommand{\bzgl}{bzgl.\xspace}
\newcommand{\obda}{o.\,B.\,d.\,A.\xspace}

\lstset{% general command to set parameter(s)
  language=c++,
   basicstyle=\footnotesize\ttfamily,          % print whole listing small
   keywordstyle=\color{DodgerBlue4}\bfseries\underbar,
                               % underlined bold black keywords
   identifierstyle=\color{black},           % nothing happens
   commentstyle=\bfseries\color{Azure4}, % white comments
   stringstyle=\underbar\itshape\color{IndianRed2},      % typewriter type for strings
   showstringspaces=false}     % no special string spaces


% für einheitlichen code-includings: z.B. codefile{hello_world.cpp,Legendäres \dq Hello World \dq example}
\newcommand{\codefile}[2]{\lstinputlisting[numbers=left,stringstyle=\texttt,label=#1,caption=#2]{media/code/#1}}
%\newcommand{\coderow}[1]{
%  \marginpar{
%    \begin{lstlisting}
%      {\small #1} 
%    \end{lstlisting}
%  }
%}


%noch nicht feddig
%\newenvironment{code}[2]{\begin{lstlisting}[label=#1,caption=#2]}{\end{lstlisting}}


