%%   $Id: dtk.clo 26 2011-10-27 13:02:03Z herbert $

\ProvidesFile{dtk.clo}[2011/04/23 v0.4 dtk class option (RN,hv)]

\newcommand\CoverArt[3]{%
  \ifx\CoverTitleFont\@undefined
    %\newfont\CoverTitleFont{ecrm1700 scaled \magstep 5}
    %\newfont\CoverTitleFont{lmr12 scaled 2938}
    \DeclareFixedFont\CoverTitleFont{\encodingdefault}{\rmdefault}{m}{n}{41.26}%
  \fi
  \ifx\CoverNumberFont\@undefined
    %\newfont\CoverNumberFont{ecrm1700 scaled 2986}
    \DeclareFixedFont\CoverNumberFont{\encodingdefault}{\rmdefault}{m}{n}{51.66}%
  \fi
  \newsavebox\dtk@titlebox
  \sbox\dtk@titlebox{\parbox{\textheight}{%
    \null\hfill\CoverTitleFont\fontsize{41.26}{42}\selectfont\journalname\hfill\null}}
%  \hspace*{5pt}
  \rotatebox{90}{\usebox\dtk@titlebox}\ 
  \rule{\CoverArt@barwidth}{\textheight}
  \hfill
%   
  \begin{minipage}[b]{.7\textwidth}\raggedright
    \rule{1em}{0pt}%
    \dimen2=\textwidth\advance\dimen2-1em
    \parbox{\dimen2}{\CoverArt@font
      {\Huge\DANTE}\\
      Deutschsprachige\\
      Anwendervereinigung
      \TeX\ \eV}\\[1ex]
    \dimen3=\textwidth\advance\dimen3-\CoverArt@gap
    \hfill\rule{\dimen3}{\CoverArt@linewidth}\\[-\baselineskip]
    \null\hspace{1em}%
    {\CoverArt@small\cover@sub{#1}{#2}{#3}}\\[-\baselineskip]
    \rule{0pt}{.617647\textheight}%
    \CoverNumberFont
    \null\hfill
    \makebox(0,0)[br]{%
      \textcolor{CoverArt@grey}{%
        \CoverArt@strip@no #1;\hspace{1pt}%
      }}% Warum verwendet `\CoverArt@strip@no' \CoverTitleFont? RN
  \end{minipage}%
}

%\PassOptionsToPackage{ngerman}{babel}
%\RequirePackage[ngerman]{babel}

\iffalse
\declare@shorthand{ngerman}{"`}{\frqq}%
\declare@shorthand{ngerman}{"'}{\flqq}%
%\def@dqmacro{`}{\frqq}{\frqq}
%\def@dqmacro{'}{\flqq}{\flqq}
\else
  \@ifpackageloaded{babel}{%
    \defineshorthand{"`}{\guillemotright}
    \defineshorthand{"'}{\guillemotleft}
  }{%
    \@ifpackageloaded{ngerman}{%
      \def@dqmacro{`}{\frqq}{\frqq}
      \def@dqmacro{'}{\flqq}{\flqq}
    }{}%
  }
\fi

\newif\ifDTKcolor \DTKcolorfalse

\RequirePackage{xcolor}
\RequirePackage{longtable}
\RequirePackage{caption}

\ifDTKcolor
  \definecolor{DTKlstBackground}{rgb}{1,1,0.95}
  \definecolor{DTKlstKeys}{rgb}{0,0,1}
  \definecolor{DTKlstIdentifiers}{rgb}{0,0,0}
  \definecolor{DTKlstComments}{rgb}{1,0,0}
  \definecolor{DTKlstStrings}{rgb}{0,0.5,0}
\else
  \colorlet{DTKlstBackground}{black!5}
  \colorlet{DTKlstKeys}{black}
  \colorlet{DTKlstIdentifiers}{black}
  \colorlet{DTKlstComments}{black}
  \colorlet{DTKlstStrings}{black}
\fi

\RequirePackage[final]{listings}

\newcommand*\DTK@lst@colorbox[2]{%
  \fboxsep=.16em\relax
  \settowidth\@ovxx{#2}\settoheight\@ovyy{#2}%
  \makebox[\@ovxx][c]{\colorbox{#1}{\raisebox{0pt}[\@ovyy][0pt]{#2}}}%
}
\newcommand\Small{\fontsize{9}{9.2}\selectfont}

%\ifluatex
%\newcommand*\DTKlstfont{\Small\ttfamily}%\lsstyle}
%\else
\newcommand*\DTKlstfont{\Small\ttfamily\SetTracking{encoding=*}{-60}\lsstyle}
%\fi
\lstdefinestyle{DTKlstBase}{%
     basicstyle=\DTKlstfont,
     basewidth=0.55em,
     keepspaces,
     identifierstyle=\color{DTKlstIdentifiers},
     keywordstyle=\color{DTKlstKeys},
     stringstyle=\itshape\color{DTKlstStrings},
     commentstyle=\itshape\color{DTKlstComments},
     columns=fullflexible,
     tabsize=2,
     frame=single,
     extendedchars=true,
     showspaces=false,
     showstringspaces=false,
     breaklines=true,
     breakindent=0.5em,
     backgroundcolor=\color{DTKlstBackground},
     breakautoindent=true,
     captionpos=t,
     aboveskip=\medskipamount,
     belowskip=\medskipamount,
     xrightmargin=\fboxsep,
     emphstyle=\DTK@lst@colorbox{lightgray},
     prebreak=,
     postbreak=\mbox{$\hookrightarrow$},
     literate={ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
       {Ä}{{\"A}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {ß}{\ss}1
}

\lstdefinestyle{DTKlstNumber}{%
     style=DTKlstBase,
     numbers=left,
     numberstyle=\tiny\ttfamily,
     numbersep=1em,
     xleftmargin=1.5em,
}

\lstdefinestyle{DTKlstNoNumber}{%
     style=DTKlstBase,
     numbers=none,
     xleftmargin=\fboxsep,
}

\lst@AddToHookExe{DeInit}{%
  \@tempdima=\lst@belowskip \advance\@tempdima-.65\baselineskip
  \edef\lst@belowskip{\the\@tempdima}%
}

\let\verbatim=\relax
\lstnewenvironment{verbatim}
{\lstset{language={},style=DTKlstNoNumber}}
{}

\AtBeginDocument{%
  \belowcaptionskip=\abovecaptionskip
}

\lstset{style=DTKlstNoNumber}

\def\ctanurl#1{\url{CTAN:#1}}%
\let\CTANurl\ctanurl

\newcommand\fboxlinewidth[1][\textwidth]{\dimexpr#1-2\fboxsep-2\fboxrule\relax}
\newcommand\tabcolwidth[2][\columnwidth]{\dimexpr#1-#2\tabcolsep\relax}

\endinput

