
\renewcommand{\topfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.75}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Chapter thumbs with scrpage2
%

% Safty first
\@ifundefined{chapter}{\let\chapter\undefined
  \chapter must be defined to use chapter thumbs!}{%

\newcommand*{\putoddnumbers}{%
\begin{tikzpicture}[remember picture, overlay]
    \node [shift={(-1.4cm,-3.6cm)}] at (current page.north east)
        {%
            \begin{tikzpicture}[remember picture, overlay] 
                \fill[fill=gray] (0,0) rectangle (1.4cm,1.2cm);
                \node [shift={(0.7cm,0.55cm)}] {
                    \textcolor{white}{%
                    \strut\thepage%
                    }%
                };
            \end{tikzpicture}
        };
\end{tikzpicture}
}

\newcommand*{\putevennumbers}{%
\begin{tikzpicture}[remember picture, overlay]
    \node [shift={(0cm,-3.6cm)}] at (current page.north west)
        {%
            \begin{tikzpicture}[remember picture, overlay] 
                \fill[fill=gray] (0,0) rectangle (1.4cm,1.2cm);
                \node [shift={(0.7cm,0.55cm)}] {
                    \textcolor{white}{%
                    \strut\thepage%
                    }%
                };
            \end{tikzpicture}
        };
\end{tikzpicture}
}

\newcommand*{\fancypagenumbers}[2][]{%
  \rohead[\putoddnumbers#1]{\putoddnumbers#2}%
  \lehead[\putevennumbers#1]{\putevennumbers#2}%
}


% initial use
\fancypagenumbers{}
\pagestyle{scrheadings}

}
%
%  End of chapter thumbs with scrpage2
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother

\pagestyle{scrheadings}
\setkomafont{pageheadfoot}{\normalfont\large\sffamily\bfseries\scshape}
%% für ältere Versionen des Komascripts folgenden Aufruf benutzen:
%%\setkomafont{pagehead}{\normalfont\large\sffamily\bfseries\scshape}
%%\setkomafont{pagefoot}{\normalfont\large\sffamily\bfseries\scshape}
\setkomafont{pagenumber}{\normalfont\large\sffamily\bfseries}


% beidseitig innen
\ihead[]{\textcolor{gray}{\headmark}}

% beidseitig aussen
%\ohead[\textcolor{gray}{\pagemark}]{%
%\fcolorbox{gray}{gray}{%
%\rule[-1mm]{0mm}{6mm}%
%\hspace{1cm}%
%\textcolor{white}{\pagemark}}%
%\rule{3mm}{0mm}%
%}

% lösche Inhalt restlicher Felder
% header Mitte
\chead[]{}

% footer
\ofoot[]{}
\cfoot[]{}
\ifoot[]{}

