%%
%% This is file `skb.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% skb.dtx  (with options: `skbpackage')
%% 
%% 
%% skb.sty
%% Copyright (c) 2011 Sven van der Meer <sven@vandermeer.de>
%%
%% This work may be distributed  and/or modified under the conditions  of the
%% LaTeX Project Public  License, either version  1.3 of this  license or (at
%% your option) any later version.
%% The latest version of this license is in
%%    <http://www.latex-project.org/lppl.txt>
%% and version 1.3  or later is  part of all  distributions of LaTeX  version
%% 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% The Current Maintainer of this work is
%%    Sven van der Meer <sven@vandermeer.de>
%%
%% This software is  provided 'as is',  without warranty of  any kind, either
%% expressed  or  implied,  including,  but  not  limited  to,  the   implied
%% warranties of merchantability and fitness for a particular purpose.
%%
%% This work consists of all files listed in MANIFEST.TXT.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{skb}[2011/06/03 Sven's Knowledge Base - SKB for LaTeX v0.52]
\newif\if@skbBeamerAnim
\@skbBeamerAnimfalse
\DeclareOption{beameranim}{\@skbBeamerAnimtrue}
\DeclareOption{beamernoanim}{\@skbBeamerAnimfalse}
\ProcessOptions\relax
\RequirePackage{keyval}
\RequirePackage{listings}
\RequirePackage{dirtree}
\RequirePackage{ifpdf}
\RequirePackage{datetime}
\RequirePackage{versions}
\def\skb@cfg@memoir{}
\newif\ifSkbMemoirLoaded
\@ifclassloaded{memoir}
  {\SkbMemoirLoadedtrue
   \includeversion{skbmodememoir}
   \def\skb@cfg@memoir{,memoir}}
  {\SkbMemoirLoadedfalse
   \excludeversion{skbmodememoir}
   \RequirePackage{booktabs}}
\newif\ifSkbBeamerArticleLoaded
\SkbBeamerArticleLoadedfalse
\@ifpackageloaded{beamerarticle}{\SkbBeamerArticleLoadedtrue}{}
\newif\ifSkbBeamerLoaded
\SkbBeamerLoadedfalse
\@ifclassloaded{beamer}{\SkbBeamerLoadedtrue}{}
\def\skb@cfg@beameranim{}
\if@skbBeamerAnim
  \def\skb@cfg@beameranim{,anim}
  \excludeversion{skbmodenoanim}
  \includeversion{skbmodeanim}
\else
  \def\skb@cfg@beameranim{,noanim}
  \excludeversion{skbmodeanim}
  \includeversion{skbmodenoanim}
\fi
\ifSkbBeamerLoaded
  \excludeversion{skbmodetext}
  \excludeversion{skbmodenote}
  \includeversion{skbmodeslide}
  \RequirePackage[slide\skb@cfg@memoir\skb@cfg@beameranim]{optional}
\else\ifSkbBeamerArticleLoaded
  \excludeversion{skbmodetext}
  \includeversion{skbmodenote}
  \excludeversion{skbmodeslide}
  \RequirePackage[note\skb@cfg@memoir\skb@cfg@beameranim]{optional}
\else
  \includeversion{skbmodetext}
  \excludeversion{skbmodenote}
  \excludeversion{skbmodeslide}
  \RequirePackage[text\skb@cfg@memoir\skb@cfg@beameranim]{optional}
\fi\fi
\providecommand{\BibTeX}{{\scshape Bib}\TeX}
\providecommand{\DescribeMacro}[1]{\relax}
\providecommand{\cmdprint}[1]{\texttt{\string#1}}
\providecommand{\cmd}[1]{\cmdprint{#1}}%
\renewcommand*\DTstylecomment{\itshape\sffamily\color{blue}\small}
\renewcommand*\DTstyle{\ttfamily\textcolor{black}}
\AtEndDocument{
  \skbpdfinfo
  \skboptionsused
}
\newcommand{\skb@tmp}{}
\newcommand{\skb@cfg@origlast}{skb.sty}
\newcommand{\skb@defCfgVars}[2]{
  \@namedef{skb@cfg@var@#1}{#2}
  \@namedef{skb@cfg@orig@#1}{skb.sty}
}
\newcommand{\skb@setCfgVars}[2]{
  \@namedef{skb@cfg@var@#1}{#2}
  \expandafter\protected@edef\csname skb@cfg@orig@#1\endcsname%
    {\csname skb@cfg@orig@#1\endcsname,\space \skb@cfg@origlast}%
}
\newcommand{\skb@getCfgVars}[1]{%
  \csname skb@cfg@var@#1\endcsname%
}%
\skb@defCfgVars{root}{/doc}
\skb@defCfgVars{acr}{database/latex}
\skb@defCfgVars{acrfile}{acronyms}
\skb@defCfgVars{bib}{database/bibtex}
\skb@defCfgVars{bibfile}{bibliography.tex}
\skb@defCfgVars{rep}{repository}
\skb@defCfgVars{pub}{publish}
\skb@defCfgVars{fig}{figures}
\skb@defCfgVars{sli}{transparencies}
\newcommand{\skb@input@doife}[4]{%
  \def\filearg{#2}
  \ifx\filearg\empty%
    \edef\intfile{\csname #1\endcsname}%
  \else%
    \edef\intfile{\csname #1\endcsname{#2}#3}%
  \fi%
  \InputIfFileExists{\intfile}{}%
    {\PackageError{skb}%
      {file not found: \intfile}%
      {I did not find the requested file #4,%
       \MessageBreak please check: \intfile%
       \MessageBreak <return> to continue, no file loaded}%
    }%
}
\def\skb@input@var@rep{rep}
\def\skb@input@var@pub{pub}
\def\skb@input@var@fig{fig}
\def\skb@input@var@sli{sli}
\newcommand{\skb@input@doroot}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfileroot}{\intarg}{.tex}{in given location}
}
\newcommand{\skb@input@dorep}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfilerep}{\intarg}{.tex}{in the repository}
}
\newcommand{\skb@input@dopub}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfilepub}{\intarg}{.tex}{in the published document folder}
}
\newcommand{\skb@input@dofig}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfilefig}{\intarg}{.tex}{in the figure folder}
}
\newcommand{\skb@input@dosli}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfilesli}{\intarg}{.tex}{in the slide folder}
}
\def\skb@input@call{}
\newcommand\skb@input@set{%
  \gdef\skb@input@call{\skb@input@doroot}
}
\define@key{skbconfig}{root}[]{\skb@setCfgVars{root}{#1}}
\define@key{skbconfig}{acr}[]{\skb@setCfgVars{acr}{#1}}
\define@key{skbconfig}{acrfile}[]{\skb@setCfgVars{acrfile}{#1}}
\define@key{skbconfig}{bib}[]{\skb@setCfgVars{bib}{#1}}
\define@key{skbconfig}{bibfile}[]{\skb@setCfgVars{bibfile}{#1}}
\define@key{skbconfig}{rep}[]{\skb@setCfgVars{rep}{#1}}
\define@key{skbconfig}{pub}[]{\skb@setCfgVars{pub}{#1}}
\define@key{skbconfig}{fig}[]{\skb@setCfgVars{fig}{#1}}
\define@key{skbconfig}{sli}[]{\skb@setCfgVars{sli}{#1}}
\newcommand{\skbconfig}[2][]{
  \def\intarg{#2}
  \ifx\intarg\empty
    \renewcommand{\skb@cfg@origlast}{skbconfig}
    \PackageWarning{skb}{load options overwritten by skbconfig}
  \else
    \renewcommand{\skb@cfg@origlast}{#2}
    \PackageWarning{skb}{load options overwritten by #2}
  \fi
  \setkeys{skbconfig}{#1}
}
\InputIfFileExists{skb.cfg}{%
  \PackageWarning{skb}{load options from skb.cfg}
}{}
\InputIfFileExists{skblocal.cfg}{%
  \PackageWarning{skb}{load options from skblocal.cfg}
}{}
\newcommand{\skboptionsused}{
  \PackageWarningNoLine{skb}{%
    Options last changed by: \skb@cfg@origlast \MessageBreak
    Change log: \MessageBreak
    - root = \skb@cfg@orig@root \MessageBreak
    - acr = \skb@cfg@orig@acr \MessageBreak
    - acrfile = \skb@cfg@orig@acrfile \MessageBreak
    - bib = \skb@cfg@orig@bib \MessageBreak
    - bibfile = \skb@cfg@orig@bibfile \MessageBreak
    - rep = \skb@cfg@orig@rep \MessageBreak
    - pub = \skb@cfg@orig@pub \MessageBreak
    - fig = \skb@cfg@orig@fig \MessageBreak
    - sli = \skb@cfg@orig@sli \MessageBreak
    Last set Path/File Options: \MessageBreak
    - file root = \skbfileroot{} \MessageBreak
    - path root = \skbpathroot \MessageBreak
    - file acr = \skbfileacr \MessageBreak
    - file bib = \skbfilebib \MessageBreak
    - path bib = \skbpathbib \MessageBreak
    - path rep = \skbfilerep{} \MessageBreak
    - path pub = \skbfilepub{} \MessageBreak
    - path fig = \skbfilefig{} \MessageBreak
    - path sli = \skbfilesli{}
  }
}
\newcommand{\skbheading}[1]{
  \ifx\empty\skb@inputLevel
    #1
  \else%
    \skb@inputLevel{#1}%
  \fi
}
\define@key{skbinput}{from}[]{%
  \def\intarg{#1}
  \ifx\skb@input@var@rep\intarg
    \gdef\skb@input@call{\skb@input@dorep}
  \else\ifx\skb@input@var@pub\intarg
    \gdef\skb@input@call{\skb@input@dopub}
  \else\ifx\skb@input@var@fig\intarg
    \gdef\skb@input@call{\skb@input@dofig}
  \else\ifx\skb@input@var@sli\intarg
    \gdef\skb@input@call{\skb@input@dosli}
  \else
    \PackageError{skb}%
      {Value for option \@tempa\space not supported: \intarg}%
      {I do not know the value \intarg\space for the option \@tempa.%
       \MessageBreak Please use either "rep", "pub", "fig" or "sli".%
       \MessageBreak <return> to continue, no file will be loaded}
  \fi\fi\fi\fi
}
\def\skb@inputLevelBook{book}
\def\skb@inputLevelPart{part}
\def\skb@inputLevelTitle{title}
\def\skb@inputLevelChapter{chapter}
\def\skb@inputLevelSection{section}
\def\skb@inputLevelSubSection{subsection}
\def\skb@inputLevelSubSubSection{subsubsection}
\def\skb@inputLevel{}
\newcommand\skb@SetInputLevel{\gdef\skb@inputLevel{}}
\define@key{skbinput}{level}[]{%
  \def\intarg{#1}
  \ifx\skb@inputLevelBook\intarg
    \let\skb@inputLevel=\book
  \else\ifx\skb@inputLevelPart\intarg
    \let\skb@inputLevel=\part
  \else\ifx\skb@inputLevelTitle\intarg
    \let\skb@inputLevel=\title
  \else\ifx\skb@inputLevelChapter\intarg
    \let\skb@inputLevel=\chapter
  \else\ifx\skb@inputLevelSection\intarg
    \let\skb@inputLevel=\section
  \else\ifx\skb@inputLevelSubSection\intarg
    \let\skb@inputLevel=\subsection
  \else\ifx\skb@inputLevelSubSubSection\intarg
    \let\skb@inputLevel=\subsubsection
  \else
    \PackageError{skb}%
      {Value for option \@tempa\space not supported: \intarg}%
      {I do not know the value \intarg\space for the option \@tempa.%
       \MessageBreak Please use only: book, part, title, chapter,%
       \MessageBreak section, subsection or subsubsection.%
       \MessageBreak <return> to continue, no level will be set and heading is ignored}
   \fi\fi\fi\fi\fi\fi\fi
}
\newcommand\skbinput[2][]{%
  \skb@input@set
  \skb@SetInputLevel
  \setkeys{skbinput}{#1}
  \skb@input@call{#2}
}
\def\skb@FigureOptWidth{}
\def\skb@FigureOptHeight{}
\def\skb@FigureOptCenter{}
\def\skb@FigureOptFigure{}
\def\skb@FigureOptPosition{}
\def\skb@FigureOptCaption{}
\def\skb@FigureOptLabel{}
\def\skb@FigureOptMultiinclide{}
\newcommand{\skb@figureOptReset}{
  \gdef\skb@FigureOptWidth{}
  \gdef\skb@FigureOptHeight{}
  \gdef\skb@FigureOptCenter{}
  \gdef\skb@FigureOptFigure{}
  \gdef\skb@FigureOptPosition{}
  \gdef\skb@FigureOptCaption{}
  \gdef\skb@FigureOptLabel{}
  \gdef\skb@FigureOptMultiinclide{}
}
\define@key{skbfigures}{width}[]{%
  \gdef\skb@FigureOptWidth{#1}
}
\define@key{skbfigures}{height}[]{%
  \gdef\skb@FigureOptHeight{#1}
}
\define@key{skbfigures}{center}[true]{%
  \gdef\skb@FigureOptCenter{true}
}
\define@key{skbfigures}{figure}[true]{%
  \gdef\skb@FigureOptFigure{true}
}
\define@key{skbfigures}{position}[]{%
  \gdef\skb@FigureOptPosition{\begin{figure}[#1]}
}
\define@key{skbfigures}{caption}[]{%
  \gdef\skb@FigureOptCaption{\caption{#1}}
}
\define@key{skbfigures}{label}[]{%
  \gdef\skb@FigureOptLabel{\label{fig:#1}}
}
\define@key{skbfigures}{multiinclude}[]{%
  \gdef\skb@FigureOptMultiinclide{#1}
}
\newcommand{\skbfigure}[2][]{
  \skb@figureOptReset
  \setkeys{skbfigures}{#1}%

  \ifx\skb@FigureOptFigure\empty\else
    \ifx\skb@FigureOptPosition\empty
      \begin{figure}
    \else
      \skb@FigureOptPosition
    \fi
  \fi
  \ifx\skb@FigureOptCenter\empty\else\begin{center}\fi

  \ifx\skb@FigureOptMultiinclide\empty
    \ifx\skb@FigureOptWidth\empty
      \ifx\skb@FigureOptHeight\empty
        \resizebox{!}{!}%
        {\includegraphics[]%
        {\skbfilefig{#2}}}
      \else
        \resizebox{!}{\skb@FigureOptHeight}%
        {\includegraphics[height=\skb@FigureOptHeight]%
        {\skbfilefig{#2}}}
      \fi
    \else
      \ifx\skb@FigureOptHeight\empty
        \resizebox{\skb@FigureOptWidth}{!}%
        {\includegraphics[width=\skb@FigureOptWidth]%
        {\skbfilefig{#2}}}
      \else
        \resizebox{\skb@FigureOptWidth}%
                  {\skb@FigureOptHeight}%
        {\includegraphics[%
            width=\skb@FigureOptWidth,%
            height=\skb@FigureOptHeight%]%
        {\skbfilefig{#2}}}
      \fi
    \fi
  \else
    \resizebox{\textwidth}{!}%
    {\multiinclude[<\skb@FigureOptMultiinclide>]%
    [start=0,format=pdf,graphics={width=\textwidth}]%
    {\skbfilefig{#2}}}
  \fi

  \ifx\skb@FigureOptFigure\empty\else%
    \skb@FigureOptCaption
    \skb@FigureOptLabel
  \fi%

  \ifx\skb@FigureOptCenter\empty\else\end{center}\fi
  \ifx\skb@FigureOptFigure\empty\else\end{figure}\fi
}
\def\skb@slides@callpath{}
\newcommand{\skb@slides@doslinote}[1]{%
  \def\intarg{#1}
  \skb@input@doife{skbfilesli}{\intarg}{.tex}{in the slides folder}
}
\define@key{skbslide}{slidefrom}[]{%
  \def\intarg{#1}
  \ifx\skb@input@var@sli\intarg
    \let\skb@slides@callpath=\skbfilesli
  \else\ifx\skb@input@var@pub\intarg
    \let\skb@slides@callpath=\skbfilepub
  \else\ifx\skb@input@var@rep\intarg
    \let\skb@slides@callpath=\skbfilerep
  \else
    \PackageError{skb}%
      {Value for option \@tempa\space not supported: \intarg}%
      {I do not know the value \intarg\space for the option \@tempa.%
       \MessageBreak Please use either "pub", "rep" or "sli".%
       \MessageBreak <return> to continue, no file will be loaded}
  \fi\fi\fi
}
\define@key{skbslide}{notefrom}[]{%
  \def\intarg{#1}
  \ifx\skb@input@var@sli\intarg
    \gdef\skb@input@call{\skb@slides@doslinote}
  \else\ifx\skb@input@var@pub\intarg
    \gdef\skb@input@call{\skb@input@dopub}
  \else\ifx\skb@input@var@rep\intarg
    \gdef\skb@input@call{\skb@input@dorep}
  \else
    \PackageError{skb}%
      {Value for option \@tempa\space not supported: \intarg}%
      {I do not know the value \intarg\space for the option \@tempa.%
       \MessageBreak Please use either "pub", "rep" or "sli".%
       \MessageBreak <return> to continue, no file will be loaded}
  \fi\fi\fi
}
\def\skb@slides@loadnote{}
\define@key{skbslide}{annotate}[true]{%
  \gdef\skb@slides@loadnote{true}
}
\newcommand\skbslide[3][]{%
  \gdef\skb@slides@loadnote{}
  \gdef\skb@input@call{\skb@slides@doslinote}
  \let\skb@slides@callpath=\skbfilesli
  \setkeys{skbslide}{#1}

  \def\sl{#2}
  \def\an{#3}

  \ifx\sl\empty\else
    \begin{figure}[!bh]
      \resizebox{\textwidth}{!}{\includegraphics[width=\textwidth]{\skb@slides@callpath{#2}}}
    \end{figure}
  \fi

  \ifx\skb@slides@loadnote\empty\else
    \ifx\an\empty
      \skb@input@call{#2}
      \clearpage
    \else
      \skb@input@call{#3}
      \clearpage
    \fi
  \fi
}
\newcommand{\skbslidecite}[2]{\small Source \textit{#2}: \textit{#1} \normalsize}
\newcommand{\skbpathroot}{\skb@getCfgVars{root}}
\newcommand{\skbfileroot}[1]{\skb@getCfgVars{root}/#1}
\newcommand{\skbfileacr}{\skb@getCfgVars{root}/\skb@getCfgVars{acr}/\skb@getCfgVars{acrfile}}
\newcommand{\skbpathbib}{\skb@getCfgVars{root}/\skb@getCfgVars{bib}}
\newcommand{\skbfilebib}{\skb@getCfgVars{root}/\skb@getCfgVars{bib}/\skb@getCfgVars{bibfile}}
\newcommand{\skbfilerep}[1]{\skb@getCfgVars{root}/\skb@getCfgVars{rep}/#1}
\newcommand{\skbfilepub}[1]{\skb@getCfgVars{root}/\skb@getCfgVars{pub}/#1}
\newcommand{\skbfilefig}[1]{\skb@getCfgVars{root}/\skb@getCfgVars{fig}/#1}
\newcommand{\skbfilesli}[1]{\skb@getCfgVars{root}/\skb@getCfgVars{sli}/#1}
\newcommand{\skbacronyms}{%
  \skb@input@doife{skbfileacr}{}{}{for acronym database}
}
\newcommand{\skbbibtex}{%
  \skb@input@doife{skbfilebib}{}{}{for bibtex database}
}
\def\skb@emCmd{}
\define@key{skbem}{italic}[true]{%
  \gdef\skb@emCmd{\textit}%
}%
\define@key{skbem}{bold}[true]{%
  \gdef\skb@emCmd{\textbf}%
}%
\define@key{skbem}{code}[true]{%
  \gdef\skb@emCmd{\skbcode}%
}%
\newcommand{\skbem}[2][]{%
  \gdef\skb@emCmd{}%
  \setkeys{skbem}{#1}%
  \skb@emCmd{#2}%
}%
\newcommand{\skbcode}[1]{%
  \lstinline[basicstyle=\ttfamily]{#1}%
}%
\newenvironment{skbnotelist}
  {\begin{itemize}
   \ifSkbMemoirLoaded\else
     \setlength{\parskip}{0cm}\setlength{\itemsep}{0cm}
   \fi
  }
  {\end{itemize}}
\newenvironment{skbnoteenum}%
  {\begin{enumerate}
   \ifSkbMemoirLoaded\else
     \setlength{\parskip}{0cm}\setlength{\itemsep}{0cm}
   \fi
  }
  {\end{enumerate}}
\newcommand{\skbacft}[1]{%
  \ifAC@dua
     \ifAC@starred\acl*{#1}\else\acl{#1}\fi%
  \else
  \expandafter\ifx\csname ac@#1\endcsname\AC@used%
    \acs{#1}%
  \else
    \acs{#1}\footnote{\acf{#1}}%
    \fi
  \fi}
\def\skb@TitleText{}
\newcommand{\skbtitle}[1]{\gdef\skb@TitleText{#1}}
\def\skb@AuthorText{}
\newcommand{\skbauthor}[1]{\gdef\skb@AuthorText{#1}}
\def\skb@SubjectText{}
\newcommand{\skbsubject}[1]{\gdef\skb@SubjectText{#1}}
\def\skb@KeywordsText{}
\newcommand{\skbkeywords}[1]{\gdef\skb@KeywordsText{#1}}
\newcommand{\skbpdfinfo}{%
  \ifpdf
    \pdfinfo{
       /Author (\skb@AuthorText)
       /Title  (\skb@TitleText)
       /ModDate (D:\pdfdate)
       /Subject (\skb@SubjectText)
       /Keywords (\skb@KeywordsText)
    }
  \fi
}
\lstdefinestyle{generic}
     {basicstyle=\scriptsize\ttfamily, backgroundcolor=\color[gray]{.9},
      frame=single, framerule=.5pt, numbers=none,
      linewidth=0.99\textwidth, xleftmargin=3pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{gentab}
     {basicstyle=\scriptsize\ttfamily, backgroundcolor=\color[gray]{.9},
      framerule=0pt,
      linewidth=.86\textwidth, xleftmargin=3pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{genericLN}
     {basicstyle=\scriptsize\ttfamily, backgroundcolor=\color[gray]{.9},
      frame=single, framerule=.5pt, numbers=left,
      linewidth=0.99\textwidth, xleftmargin=20pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{genericLNspecial}
     {basicstyle=\small\ttfamily, backgroundcolor=\color[gray]{.97},
      frame=single, framerule=.5pt, numbers=left,
      linewidth=0.99\textwidth, xleftmargin=20pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{beamer-example}
     {basicstyle=\scriptsize\ttfamily,
      frame=single, framerule=0pt, numbers=none,
      linewidth=0.99\textwidth, xleftmargin=3pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{beamer-exampleLN}
     {basicstyle=\scriptsize\ttfamily,
      frame=single, framerule=0pt, numbers=left,
      linewidth=0.99\textwidth, xleftmargin=20pt,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=\bfseries}
\lstdefinestyle{javaCode}
     {basicstyle=\scriptsize\ttfamily, backgroundcolor=\color[gray]{.9},
      frame=single, framerule=0pt, language=JAVA,
      numbers=none,
      keywordstyle=\bfseries\color{Blue4},
      identifierstyle=,
      linewidth=0.99\columnwidth}
\lstdefinestyle{inText}
     {basicstyle=\ttfamily}
\def\skb@newHeading{}
\define@key{skbheadings}{down}[true]{%
  \ifx\skb@inputLevel\part
    \let\skb@newHeading=\chapter
    \let\skb@inputLevel=\chapter
  \else\ifx\skb@inputLevel\chapter
    \let\skb@newHeading=\section
    \let\skb@inputLevel=\section
  \else\ifx\skb@inputLevel\section
    \let\skb@newHeading=\subsection
    \let\skb@inputLevel=\subsection
  \else\ifx\skb@inputLevel\subsection
    \let\skb@newHeading=\subsubsection
    \let\skb@inputLevel=\subsubsection
  \else
    \KV@err{Invalid current level for SkbNewHeading(down),
            please use: part, chapter, section or subsection}
   \fi\fi\fi\fi
}
\define@key{skbheadings}{up}[true]{%
  \ifx\skb@inputLevel\chapter
    \let\skb@newHeading=\part
    \let\skb@inputLevel=\part
  \else\ifx\skb@inputLevel\section
    \let\skb@newHeading=\chapter
    \let\skb@inputLevel=\chapter
  \else\ifx\skb@inputLevel\subsection
    \let\skb@newHeading=\section
    \let\skb@inputLevel=\section
  \else\ifx\skb@inputLevel\subsubsection
    \let\skb@newHeading=\subsection
    \let\skb@inputLevel=\subsection
  \else
    \KV@err{Invalid current level for SkbNewHeading(up),
            please use: chapter, section, subsection or subsubsection}
   \fi\fi\fi\fi
}
\define@key{skbheadings}{last}[true]{%
  \let\skb@newHeading=\skb@inputLevel%
}
\newcommand{\skbheadingudc}[2][]{%
  \gdef\skb@newHeading{}
  \setkeys{skbheadings}{#1}%
  \ifx\empty\skb@newHeading\else%
    \skb@newHeading{#2}%
  \fi
}
\endinput
%%
%% End of file `skb.sty'.
