\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{otmixmodDocumentation}

\RequirePackage[latin1]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{color}
\RequirePackage{graphics}
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage{framed}
\RequirePackage{fancyhdr}
\RequirePackage{graphicx}
\RequirePackage{ifpdf}

% For listings for python scripts
\RequirePackage{listings}

% For mathematics notations
\RequirePackage{Math_Notations}

% For index
\RequirePackage{makeidx}
\RequirePackage{index}

% For graphics
% \RequirePackage{mdwtab}
\RequirePackage{hhline}


% For hyper references
\RequirePackage[pdftex, bookmarks, colorlinks=true, urlcolor=green, linkcolor=red, filecolor=blue, citecolor=magenta]{hyperref}

\ifpdf
 \RequirePackage{longtable}
\else
\fi
\setlength{\textwidth}{18.5cm}
\setlength{\textheight}{23cm}
\setlength{\hoffset}{-1.04cm}
\setlength{\voffset}{-1.54cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\topmargin}{0cm}
\setlength{\headheight}{1cm}
\setlength{\headsep}{0.5cm}
\setlength{\marginparsep}{0cm}
\setlength{\marginparwidth}{0cm}
\setlength{\footskip}{1cm}
\setlength{\parindent}{0cm}

\newcommand{\filename}{?}
\newcommand{\filetitle}{?}
\newcommand{\entreprise}{EDF-EADS-Phimeca}
\pagestyle{fancy}
\fancyhf{} \rhead{\bfseries \thepage} \lhead{\bfseries \nouppercase otmixmod  -- Documentation}
\rfoot{\bfseries \copyright 2009-2013 \entreprise} \lfoot{}

% Links between files
\newcommand{\otrefext}[2]{
  {
    \!\!\!\![\href{#1.pdf}{\underline{#2}}]\!\!\!\!
  }
}
\newcommand{\otref}[2]
{
  {
    \!\!\!\![\hyperlink{#1}{\underline{#2}}]\!\!\!\!
  }
}



% Head for Use Cases files at third level
\newcommand{\HeaderIIILevel}{
  {
    \subsubsection{\filetitle} \hypertarget{\filename}{} \label{\filename}
  } % protection
} % Header

% Head for Use Cases files at second level
\newcommand{\HeaderIILevel}{
  {
    \subsection{\filetitle} \hypertarget{\filename}{} \label{\filename}
  } % protection
} % Header

% Head for Use Cases files at not numbered second level
\newcommand{\HeaderNNIILevel}{
  {
    \subsection*{
      \filetitle
    } \hypertarget{\filename}{} \label{\filename}
    \addcontentsline{toc}{subsection}{\filetitle}
  } % protection
} % Header

% To create space after python script
\newcommand{\espace}{{\strut\\}}

% To describe requirements of each Use Case
\newcommand{\requirements}[2]{{
    \noindent%
    \begin{tabular}{||p{2.3cm}||p{12.7cm}||}
      \ifpdf
      \hhline{|t:=:t:=:t|}
      \else
      \hline
      \fi
      Requirements\vfill &
      \parbox{12cm}{{#1}}
      \\
      \ifpdf
      \hhline{|:=::=:|}
      \else
      \hline
      \fi
      Results\vfill &
      \parbox{12cm}{{#2}}
      \\
      \ifpdf
      \hhline{|b:=:b:=:b|}
      \else
      \hline
      \fi
    \end{tabular}
  }}

\newcommand{\longrequirements}[2]{{
    \noindent%
    \ifpdf
    \begin{longtable}{||p{2.3cm}||p{12.7cm}||}
      \hhline{|t:=:t:=:t|}
      Requirements\vfill &
      \parbox{12cm}{{#1}}
      \\
      \hhline{|:=::=:|}
      Results\vfill      &
      \parbox{12cm}{{#2}}
      \\
      \hhline{|b:=:b:=:b|}
    \end{longtable}
    \else
    \requirements{{#1}, {#2}}
    \fi
  }}

\newcommand{\Block}[1]{
  {
\begin{framed}
  #1\strut
\end{framed}
  } % protection
} % Block

% Description mathématique
\newcommand{\MathematicalDescription}[2]{
  {
    \Block{
      \textbf{\large Mathematical description}\\[1em]
        #1\strut\\[1em]
      \textbf{\textit{\large Other notations}}\\[1em]
        #2\strut
    } % Block
  } % protection
} % MathematicalDescription

% Méthodologie OpenTURNS
\newcommand{\Methodology}[2]{
  {
    \Block{
      \textbf{\large Link with OpenTURNS methodology}\\[1em]
        #1\strut\\[1em]
      \textbf{\textit{\large References and theoretical basics}}\\[1em]
        #2\strut
    } % Block
  } % protection
} % Syntax

