\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{refcard}[2008/07/28 DBLaTeX Refcard Style]
\RequirePackageWithOptions{db2latex}
\RequirePackage{ifthen}

\def\title#1{
  \def\DBKtitle{#1}
  \stdtitle{\bfseries #1}} % no subtitle, we need real estate

\sloppy
\makeatletter
\parindent=0mm
\def\maketitle{
  \thispagestyle{empty}
  \begin{center}
    \href{\REFcorpauthorurl}{%
      \includegraphics[height=1cm]{\REFcorpauthorimage}} \\
         {\large{\@title}} \\
         \REFversion~\REFrevnumber~\REFdate \\
         \url{\REFcorpauthorurl}
\end{center}
}

\pagestyle{empty}
\def\frontmatter{}
\def\tableofcontents{}
\def\mainmatter{}
\def\backmatter{}

\newcommand{\REFstdformat}{%
  \paperheight=210mm            % ISO A4 short side
  \paperwidth=99mm              % ISO A4 long side / 3
  \special{papersize=99mm,210mm}
  \textheight=200mm             % 210mm - 2 * 5mm
  \textwidth=89mm               %  99mm - 2 * 5mm
  \topmargin=-33mm
  \oddsidemargin=-20mm
}
\REFstdformat

\newcommand{\REFletterformat}{%
  \paperheight=216mm            % letter short side
  \paperwidth=93mm              % letter long side / 3
  \special{papersize=93mm,216mm}
  \textheight=206mm             % 216mm - 2 * 5mm
  \textwidth=83mm               %  93mm - 2 * 5mm
  \topmargin=-33mm
  \oddsidemargin=-20mm
}

% unfortunately this gotopage does conflict with minipage etc.
\newcounter{cnt}
\def\newPage{%
  \ifnum\value{page}<\value{cnt}\relax
    \null\newpage
    \null\vfill
    \newPage\vfill
  \fi
}
\newcommand{\gotopage}[1]{%
  \setcounter{cnt}{#1}
  \newPage\vfill
}

% so we use an ugly workaround
\newcommand{\newpages}[1]{%
  \setcounter{cnt}{0}
  \whiledo{\value{cnt}<#1}{%
    \stepcounter{cnt}
    \newpage
  }
}

\renewenvironment{quote}{\parskip=0pt}{\vspace{1em}}
