\documentclass[12pt,a4paper,ngerman]{book}

\usepackage[ngerman]{babel}
\usepackage{ucs}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
%\usepackage[latin1]{inputenc}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{makeidx}
\usepackage{ulem}
\usepackage{xcolor}
\usepackage{moreverb}

%using serif-less Font
\renewcommand{\familydefault}{\sfdefault}

% european A4 paper format--------->
\setlength{\textwidth}{15.8cm}     % width of main text
\setlength{\textheight}{23.5cm}    % height of main text
\setlength{\topmargin}{-1in}     % Subtract default offset
\addtolength{\topmargin}{2.2cm}    % Topmargin
\setlength{\topskip}{30pt}        % between header and text
%%\setlength{\headheight}{0.0in}   % no header
%%\setlength{\headsep}{0.0in}      %
\setlength{\hoffset}{-1in}   % Subtract default offset
\addtolength{\hoffset}{2.2cm}
\setlength{\evensidemargin}{\paperwidth}
\addtolength{\evensidemargin}{-\textwidth}
\addtolength{\evensidemargin}{-\oddsidemargin}
\addtolength{\evensidemargin}{-2in}
\addtolength{\evensidemargin}{-\hoffset}
\addtolength{\evensidemargin}{-\hoffset}
\addtolength{\oddsidemargin}{-1.5mm}
% <end european A4 paper format-----

%own commands
\newcommand{\graybox}[1]{\colorbox{gray}{\makebox[10cm][l]{\color{white}{\bf{#1}}}}}
%\newcommand{\graybox}[1]{\colorbox{mygray}{\color{white}{\bf{#1}}}}

%header styling-------------------->

\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\setlength{\fboxsep}{3mm}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{\marginparwidth}
%\renewcommand{\chaptermark}[1]%
%                  {\markboth{#1}{}}
%\renewcommand{\sectionmark}[1]%
%                  {\markright{\thesection\ #1}}

%define pagenumberbox
\newcommand{\mylthepage}{\colorbox{gray}{\makebox[1.8cm][r]{\color{white}{\bf{\thepage}}}}}
\newcommand{\myrthepage}{\colorbox{gray}{\makebox[1.8cm][l]{\color{white}{\bf{\thepage}}}}}

%set pagenumber and  chapter information
\lhead[\mylthepage]{\bf{\color{gray}{\rightmark}}}
\rhead[\bf{\color{gray}{\leftmark}}]{\myrthepage}
\cfoot{}
\pagestyle{fancy}
\fancypagestyle{plain}{
\renewcommand{\headrulewidth}{0pt}
\setlength{\fboxsep}{3mm}
%\addtolength{\headwidth}{\marginparsep}
%\addtolength{\headwidth}{\marginparwidth}
%\lhead[\mylthepage]{ }
%\rhead[ ]{\myrthepage}
\cfoot{}
}
%<end header styling----------------

% Bildunterschr.
\usepackage[bf]{caption2}
\renewcommand{\captionfont}{\small}
\renewcommand{\figurename}{Abb.}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
%no leading chapter----------------->
\makeatletter
\renewcommand\thechapter{\arabic{chapter}}
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \par\nobreak
        \vskip 20\p@
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries \thechapter\ #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother
%<no leading chapter------------------


\usepackage[
  pdftex,
  pdfpagelabels,
  plainpages=false,
  colorlinks,
  urlcolor=blue,
  linkcolor=black,
  citecolor=black,
  pdfauthor={Dirk von Suchodoletz, ..., ...},
%  pdftitle={PVS Dokumentation}
  pdftitle={GZ:if expand("\%") == ""|browse confirm w|else|confirm w|endif}
]{hyperref}

\usepackage{multirow}