\usepackage{url}
\usepackage{ifpdf}
\usepackage{pgf}
\usepackage{color}
\usepackage{changebar}
\usepackage{datetime}

\newcommand{\version}[0]{\em *** Version: \today, \currenttime~***}


%% block comments

% start block comment
\let\bc=\iffalse

% end block comment
\let\ec=\fi         

%% itize & enumate: Compacte itemize en enumerate

\newenvironment{itize}{%
\begin{list}{$\bullet$}{
\parsep  = 0pt
\parskip = 0pt
\topsep  = 0pt
\itemsep = 0pt
}}{\end{list}}

\newcounter{enumctr}

\newenvironment{enumate}{%
\begin{list}{\arabic{enumctr}}{
\usecounter{enumctr}
\parsep  = 0pt
\parskip = 0pt
\topsep  = 0pt
\itemsep = 0pt
}}{\end{list}}


%% Light syntax for fixed width fonts (\p stands for html's <pre>)
\newcommand{\p}[1]{\texttt{#1}}


%% Light syntax for lists
% 
% 
% \bl
% \o list item 1
% \o list item 2
% \el

% first save the old \o in an sbox and call it \slasho
\newsavebox{\slashobox}
\sbox{\slashobox}{\o}
\newcommand{\slasho}{\usebox{\slashobox}}

\newsavebox{\bfslashobox} 
\sbox{\bfslashobox}{\bf \o}
\newcommand{\bfslasho}{\usebox{\bfslashobox}}

\renewcommand{\o}{\item}

\newcommand{\bl}[0]{\begin{itize}}
\renewcommand{\o}[0]{\item}
\newcommand{\el}[0]{\end{itize}}


%% \gray: shorthand for \textcolor{gray}
\newcommand{\gray}[1]{\textcolor{gray}{#1}}


%% \pre: shorthand for \texttt    (pre from HTML's <PRE>)
\newcommand{\pre}[1]{\texttt{#1}}

\newcommand{\todo}[1]{%
%\error                uncomment to make sure there are no todos left
\textcolor{blue}{\mbox{$^\ast$}}\marginpar{\raggedright
\hspace{0pt}\sffamily\tiny{\sc \textcolor{blue}{todo:}}\\ \textcolor{blue}{#1}}}



%% \pgffigure: create a pgf figure
% parameters: {caption}{label}{filename}{width in pixels}{height in pixels}

% pgf documentation:
% http://mirror.aarnet.edu.au/pub/CTAN/graphics/pgf/pgfuserguide.pdf

% Because pgf cannot process png files anymore in dvi mode (neither can includegraphics),
% the image is not loaded when in dvi mode.

\newlength{\pixelsize}
\setlength{\pixelsize}{0.017cm}

\newcommand{\pgffigure}[5]{%
\begin{figure}
\begin{center}
\begin{center}
\begin{pgfpicture}{0cm}{0cm}{#4\pixelsize}{#5\pixelsize}
\ifpdf
\pgfputat{\pgfxy(0,0)}{\pgfbox[left,base]{\pgfimage[interpolate=true,height=#5\pixelsize]{#3}}}
\else
\pgfrect[stroke]{\pgfpoint{0cm}{0cm}}{\pgfpoint{#4\pixelsize}{#5\pixelsize}}
\pgfputat{\pgfxy(0.01cm,0.01cm)}{\pgfbox[left,bottom]{#3}}
\fi
\end{pgfpicture}
\end{center}\caption{#1}\label{#2} 
\end{center}
\end{figure}}

\newcommand{\pgffigureWide}[5]{%
\begin{figure*}
\begin{center}
\begin{center}
\begin{pgfpicture}{0cm}{0cm}{#4\pixelsize}{#5\pixelsize}
\ifpdf
\pgfputat{\pgfxy(0,0)}{\pgfbox[left,base]{\pgfimage[interpolate=true,height=#5\pixelsize]{#3}}}
\else
\pgfrect[stroke]{\pgfpoint{0cm}{0cm}}{\pgfpoint{#4\pixelsize}{#5\pixelsize}}
\pgfputat{\pgfxy(0.01cm,0.01cm)}{\pgfbox[left,bottom]{#3}}
\end{pgfpicture}
\end{center}\caption{#1}\label{#2} 
\end{center}
\end{figure*}}

%% kopje met skip ervoor en geen pagebreak erna
\newcommand{\head}[1]{\bigskip\noindent{\sffamily\bfseries #1}\nopagebreak[4]}


%% commands to fiddle with pagelength, for getting rid of orphans
\newcommand{\finallongpage}{\enlargethispage{\baselineskip}}
\newcommand{\finalshortpage}{\enlargethispage{-\baselineskip}}


