%
% kg, 24/08/95
%
% mathPAD.cls -- the LaTeX2e document class for mathPAD articles
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mathPAD}[1995/08/24 The mathPAD document class]
%
% use 'textures' option to control font naming
%
\newif\iftextures
\texturesfalse
\DeclareOption{textures}{\texturestrue}
%
% use 'pdf' option do define \ifpdf
%
\newif\ifpdf
\pdffalse
\DeclareOption{pdf}{\pdftrue}
%
% use PostScript fonts with 'final' option and CM fonts with 'draft' 
% option (in order to allow for previewing with xview)
%
% default is to use PostScript fonts
%
\newif\ifpsfonts
\psfontstrue
\DeclareOption{draft}{\setlength\overfullrule{5pt}\psfontsfalse}
\DeclareOption{final}{\setlength\overfullrule{0pt}\psfontstrue}
%
% an article may be part of a series which is to be noticed in 
% the title
%
\def\series#1{\gdef\@series{#1}}
\gdef\@series{}
%
% an article may have a different title in the toc
%
\def\toctitle#1{\gdef\@toctitle{#1}}
\gdef\@toctitle{}
%
% some options we dont't want to allow:
%
\DeclareOption{a5paper}{\OptionNotUsed}
\DeclareOption{b5paper}{\OptionNotUsed}
\DeclareOption{letterpaper}{\OptionNotUsed}
\DeclareOption{legalpaper}{\OptionNotUsed}
\DeclareOption{executivepaper}{\OptionNotUsed}
\DeclareOption{landscape}{\OptionNotUsed}
\DeclareOption{11pt}{\OptionNotUsed}
\DeclareOption{12pt}{\OptionNotUsed}
\DeclareOption{oneside}{\OptionNotUsed}
\DeclareOption{titlepage}{\OptionNotUsed}
\DeclareOption{leqno}{\OptionNotUsed}
\DeclareOption{fleqn}{\OptionNotUsed}
%
% pass options to article.cls
%
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[a4paper,10pt,twoside,notitlepage]{article}
%
% some paragraph measures
%
\raggedbottom
\parskip2ex
\parindent0em
%
% page layout
%
\topmargin 0pt
\headheight 11pt
\headsep 12mm
\textheight 220mm
\footskip 15mm
\evensidemargin -6mm
\oddsidemargin 4mm
\textwidth 160mm
%
% the actual volume, number and its date
%
\def\volume#1{\gdef\@volume{#1}}
\gdef\@volume{Vol n No m Date}
%
% new header/footer layout
%
\renewcommand\ps@myheadings{%
    \def\@evenhead{%
        \Large\sffamily\bfseries mathPAD\hfill}%
    \def\@oddhead{%
        \hfill\Large\sffamily\rightmark}%
    \def\@evenfoot{%
        \sffamily{\bfseries\thepage\ \ \ \ }%
        \footnotesize\itshape mathPAD \leftmark\hfill}%
    \def\@oddfoot{%
        \hfill\sffamily\bfseries\thepage}%
    \let\@mkboth\@gobbletwo
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
    }
\pagestyle{myheadings}
%
% insert only own entries into toc
%
\setcounter{tocdepth}{0}
\renewcommand\tableofcontents{%
    {\Huge\sffamily\bfseries mathPAD\par}%
    {\large\bfseries \@volume\par}%
    \vspace*{6mm}%
    {\hspace*{56mm}\LARGE\sffamily\bfseries In diesem Heft\par}%
    \vspace*{6mm}%
    \@starttoc{toc}%
    \vfill%
%added by frankp
%>>>
    \newpage
%<<<
    \parbox[t]{90mm}{%
    \raggedright%
    Redaktion: \\ {\bfseries %
    Benno Fuchssteiner \\ Frank Postel \\ Gerald R\"uscher \\%
    Universit\"at-GH Paderborn \\ D-33095 Paderborn \\ e-mail:} %
    \ttfamily \{benno,frankp,jerry\}@mupad.de}%
    \hspace{6mm}%
    \parbox[t]{60mm}{\raggedright%
    ISSN 0941-9187 \\ V.\/i.\/S.\/d.\/P.: Benno Fuchssteiner \\%
    Nachdruck gegen Belegexemplar erlaubt}%
    \thispagestyle{empty}%
    }
%
% change \maketitle to allow for several titles
%
\renewcommand\maketitle{\par
  \begingroup
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}
  \endgroup
  \setcounter{footnote}{0}%
  \ifx\@toctitle\empty\gdef\@toctitle{\@title}\else\fi%
  \addtocontents{toc}{\protect\tocline{\@toctitle}{\@author}{\thepage}}%
  \markboth{\@volume}{\@toctitle}%
  \gdef\@thanks{}\gdef\@addr{}\gdef\@author{}\gdef\@title{}\gdef\@series{}%
  \gdef\@toctitle{}%
  }
%
% define authors address
%
\def\addr#1{\gdef\@addr{#1}}
\gdef\@addr{}
%
% change title layout
%
\renewcommand{\@maketitle}{%
  \newpage
  \null
  \begin{flushright}%
      \vskip -20mm%
      \ifx\@series\empty\else
          {\hrulefill\Large\rmfamily\mdseries\itshape \@series: \par}%
          \vskip 1em%
      \fi
      {\huge\sffamily\bfseries \@title \par}%
      \vskip 1.5em%
      \ifx\@author\empty\else%
	{\large \@author}%
        \ifx\@addr\empty \par \else \\ {\small \@addr} \par \fi%
      \fi%
  \end{flushright}%
  \vskip 1.5em%
  }
%
% change abstract layout
%
\renewenvironment{abstract}{%
    \begin{flushleft}\Large \itshape}{%
    \par \end{flushleft} \vskip 1.5em}
%
% no section numbering
%
\setcounter{secnumdepth}{0}
%
% change section layout
%
\renewcommand\section{\@startsection{section}{1}{\z@}%
	{-3.5ex \@plus -1ex \@minus -.2ex}%
	{2.3ex \@plus.2ex}%
	{\reset@font\Large\sffamily\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
	{-3.25ex\@plus -1ex \@minus -.2ex}%
	{1.5ex \@plus .2ex}%
	{\reset@font\large\sffamily\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
	{-3.25ex\@plus -1ex \@minus -.2ex}%
	{1.5ex \@plus .2ex}%
	{\reset@font\normalsize\sffamily\bfseries}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
	{3.25ex \@plus1ex \@minus.2ex}%
	{-1em}%
	{\reset@font\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
	{3.25ex \@plus1ex \@minus .2ex}%
	{-1em}%
	{\reset@font\normalsize\bfseries}}
%
% item lists layout
%
\setlength\leftmargini {1.2em}
\setlength\leftmarginii {1.2em}
\setlength\leftmarginiii {1.2em}
\setlength\leftmarginiv {1.0em}
\setlength\leftmarginv {1.0em}
\setlength\leftmarginvi {1.0em}
\setlength\leftmargin {\leftmargini}
\setlength\labelsep {.4em}
\setlength\labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\renewcommand\labelitemi{$\m@th\bullet$}
\renewcommand\labelitemii{$\m@th\circ$}
\renewcommand\labelitemiii{$\m@th\diamond$}
\renewcommand\labelitemiv{$\m@th\triangleright$}
%
% define PS fonts if needed
%
\ifpsfonts
    \iftextures

	\typeout{Loading \space Adobe\space Times Roman}%
	\DeclareFontFamily{OT1}{ptm}{}%

	\DeclareFontShape{OT1}{ptm}{m}{n}{<->Times}{}%
	\DeclareFontShape{OT1}{ptm}{m}{it}{<->TimesI}{}%
	\DeclareFontShape{OT1}{ptm}{b}{n}{<->TimesB}{}%
	\DeclareFontShape{OT1}{ptm}{b}{it}{<->TimesBI}{}%

	\DeclareFontShape{OT1}{ptm}{m}{sc}{<->sub * ptm/m/n}{}%
	\DeclareFontShape{OT1}{ptm}{m}{sl}{<->sub * ptm/m/it}{}%
	\DeclareFontShape{OT1}{ptm}{b}{sc}{<->sub * ptm/m/n}{}%
	\DeclareFontShape{OT1}{ptm}{b}{sl}{<->sub * ptm/b/it}{}%
	\DeclareFontShape{OT1}{ptm}{bx}{n}{<->sub * ptm/b/n}{}%
	\DeclareFontShape{OT1}{ptm}{bx}{it}{<->sub * ptm/b/it}{}%
	\DeclareFontShape{OT1}{ptm}{bx}{sc}{<->sub * ptm/b/n}{}%
	\DeclareFontShape{OT1}{ptm}{bx}{sl}{<->sub * ptm/b/it}{}%
	
	\typeout{Loading \space Adobe\space Helvetica}%
	\DeclareFontFamily{OT1}{phv}{}%
	\DeclareFontShape{OT1}{phv}{m}{n}{<->Helvetica}{}%
	\DeclareFontShape{OT1}{phv}{m}{it}{<->HelveticaI}{}%
	\DeclareFontShape{OT1}{phv}{b}{n}{<->HelveticaB}{}%
	\DeclareFontShape{OT1}{phv}{b}{it}{<->HelveticaBI}{}%
	\DeclareFontShape{OT1}{phv}{m}{sc}{<->sub * phv/m/n}{}%
	\DeclareFontShape{OT1}{phv}{m}{sl}{<->sub * phv/m/it}{}%
	\DeclareFontShape{OT1}{phv}{b}{sc}{<->sub * phv/m/n}{}%
	\DeclareFontShape{OT1}{phv}{b}{sl}{<->sub * phv/b/it}{}%
	\DeclareFontShape{OT1}{phv}{bx}{n}{<->sub * phv/b/n}{}%
	\DeclareFontShape{OT1}{phv}{bx}{it}{<->sub * phv/b/it}{}%
	\DeclareFontShape{OT1}{phv}{bx}{sc}{<->sub * phv/b/n}{}%
	\DeclareFontShape{OT1}{phv}{bx}{sl}{<->sub * phv/b/it}{}%
	
	\typeout{Loading \space Adobe\space Courier}%
	\DeclareFontFamily{OT1}{pcr}{}%
	\DeclareFontShape{OT1}{pcr}{m}{n}{<->Courier}{}%
	\DeclareFontShape{OT1}{pcr}{m}{it}{<->CourierI}{}%
	\DeclareFontShape{OT1}{pcr}{b}{n}{<->CourierB}{}%
	\DeclareFontShape{OT1}{pcr}{b}{it}{<->CourierBI}{}%
	\DeclareFontShape{OT1}{pcr}{m}{sc}{<->sub * pcr/m/n}{}%
	\DeclareFontShape{OT1}{pcr}{m}{sl}{<->sub * pcr/m/it}{}%
	\DeclareFontShape{OT1}{pcr}{b}{sc}{<->sub * pcr/m/n}{}%
	\DeclareFontShape{OT1}{pcr}{b}{sl}{<->sub * pcr/b/it}{}%
	\DeclareFontShape{OT1}{pcr}{bx}{n}{<->sub * pcr/b/n}{}%
	\DeclareFontShape{OT1}{pcr}{bx}{it}{<->sub * pcr/b/it}{}%
	\DeclareFontShape{OT1}{pcr}{bx}{sc}{<->sub * pcr/b/n}{}%
	\DeclareFontShape{OT1}{pcr}{bx}{sl}{<->sub * pcr/b/it}{}%
	
    \fi
    \def\rmfnt{ptm}
    \def\sffnt{phv}
    \def\ttfnt{pcr}

    \renewcommand{\sfdefault}{\sffnt}
    \renewcommand{\rmdefault}{\rmfnt}
    \renewcommand{\ttdefault}{\ttfnt}
    \renewcommand{\bfdefault}{b}
    % math alphabets
%   \DeclareMathAlphabet{\mathcal}{OT1}{\rmfnt}{m}{n}
    \DeclareMathAlphabet{\mathrm}{OT1}{\rmfnt}{m}{n}
    \DeclareMathAlphabet{\mathbf}{OT1}{\rmfnt}{b}{n}
    \DeclareMathAlphabet{\mathsf}{OT1}{\sffnt}{m}{n}
    \DeclareMathAlphabet{\mathtt}{OT1}{\ttfnt}{m}{n}
    \DeclareMathAlphabet{\mathnormal}{OT1}{\rmfnt}{m}{it}
    \DeclareMathAlphabet{\mathit}{OT1}{\rmfnt}{m}{it}
%   \SetMathAlphabet{\mathcal}{bold}{OT1}{\rmfnt}{b}{n}
    \SetMathAlphabet{\mathrm}{bold}{OT1}{\rmfnt}{b}{n}
    \SetMathAlphabet{\mathbf}{bold}{OT1}{\rmfnt}{b}{n}
    \SetMathAlphabet{\mathsf}{bold}{OT1}{\sffnt}{b}{n}
    \SetMathAlphabet{\mathtt}{bold}{OT1}{\ttfnt}{b}{n}
    \SetMathAlphabet{\mathnormal}{bold}{OT1}{\rmfnt}{b}{it}
    \SetMathAlphabet{\mathit}{bold}{OT1}{\rmfnt}{b}{it}
\fi
%
% ---------------- section for own macros --------------------
%
% frankp: changed [b] to [t], 100mm -> 90mm, Large -> large for #1
%
\newcommand{\MuPAD}{{\sffamily\itshape MuPAD\/}}
\newcommand{\mathPAD}{{\sffamily mathPAD}}
\newcommand{\tocline}[3]{%
\parbox[t]{50mm}{\raggedleft\large\itshape \ #2}%
\hspace{6mm}\parbox[t]{87mm}{\raggedright\large #1}%
\hspace{3mm}{\ #3}\par}
%
% end of mathPAD.cls
