\ProvidesClass{smintreport}

% Base class for smintreport is article
\LoadClass[12pt,landscape]{article}


% load useful packages
% --------------------

\RequirePackage[usenames,dvipsnames]{color}
\RequirePackage{colortbl}
\RequirePackage{graphicx}
\RequirePackage{multirow}
\RequirePackage{fancyhdr}
\RequirePackage{hyperref}
\RequirePackage{titlesec}


%\RequirePackage{pgf,pgfautomata,pgfheaps,pgfshade}
%\RequirePackage{amsmath,amssymb}
%\RequirePackage[latin1]{inputenc}


% commands for defining SM number, experts, duration etc.
% -------------------------------------------------------

\newcommand\thelayer{}
\newcommand\theexperts{}
\newcommand\thecrew{}
\newcommand\thestart{}
\newcommand\theend{}

\newcommand\layer    [1]{\renewcommand\thelayer{#1}}
\newcommand\experts  [1]{\renewcommand\theexperts{#1}}
\newcommand\crew     [1]{\renewcommand\thecrew{#1}}
\newcommand\started  [1]{\renewcommand\thestart{#1}}
\newcommand\finished [1]{\renewcommand\theend{#1}}

\newcommand\makesminttitle{
  \thispagestyle{empty}
  \begin{center}
    \setlength{\fboxsep}{4mm}
    \colorbox{blue}{\makebox[0.95\textwidth][c]
    {\color{white}\normalfont\bf\Huge\thelayer}}
  \end{center}
  
  \vspace{15mm}

  

  \begin{minipage}{0.48\textwidth}
    \large

    \newcommand{\oldarraystretch}{\arraystretch}
    \renewcommand{\arraystretch}{2}


    \begin{tabular}{rl}
      Experts:  & \parbox[t]{0.4\textwidth}{\bfseries{\theexperts} } \\
      Crew:     & \parbox[t]{0.4\textwidth}{\bfseries{\thecrew}  } \\
      Started:  & \parbox[t]{0.4\textwidth}{\bfseries{\thestart} } \\
      Finished: & \parbox[t]{0.4\textwidth}{\bfseries{\theend}  } \\
    \end{tabular}

    \renewcommand{\arraystretch}{\oldarraystretch}

  \end{minipage} 
  \hfill
  \begin{minipage}{0.48\textwidth}
    \setcounter{tocdepth}{1}
    \tableofcontents
  \end{minipage}

  \clearpage
}

%\newcommand\bla{\colorbox{black}{\parbox{\textwidth}
%  { \color{white}\vspace{2mm}
%    \centering\normalfont\bf\Huge\thelayer
%    \vspace{2mm}}}
%\parbox{0.5\textwidth}{
%\begin{tabular}{ll}
%Experts: & \bfseries{\theexperts}
%\end{tabular}
%}
%\@starttoc{toc}
%}


% Page setup
% ----------

\setlength{\textheight}{190mm}
\setlength{\voffset}{-25.4mm}
\setlength{\topmargin}{-5mm}

\setlength{\textwidth}{257mm}
\setlength{\hoffset}{-25.4mm}
\setlength{\oddsidemargin}{10mm}


\setlength{\parindent}{0mm}
\setlength{\parskip}{3mm} 


% font selection
% --------------

\renewcommand{\familydefault}{cmss}



% section headings redefined
% --------------------------

\titleformat{\section}[block]
  {\normalfont\Large\bfseries \titlerule \vspace{0.8ex}}
  {\thesection}
  {8pt}
  {}
  [\vspace{0.4ex}\titlerule]


% page headers (using fancyhdr)
% -----------------------------

\lhead{}
\chead{}
\rhead{}
\lfoot{\thelayer}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}

\pagestyle{fancy}
