\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{natposterII}[2006/05/17 v0.02 Basic class for Natura posters]
\RequirePackage{calc,ifthen,fancyhdr,graphicx,framed,pstricks}
\RequirePackage{cabin,tikz,xcolor}

\definecolor{mygrey}{HTML}{eeeeee}

\usepackage[hidealllines=true,roundcorner=20pt,backgroundcolor=mygrey,leftmargin=20,rightmargin=20,usetwoside=false,skipabove=5,framemethod=TikZ]{mdframed}

\definecolor{DarkGrey}{rgb}{.4, .4, .4}
\definecolor{Branco}{rgb}{1, 1, 1}
\definecolor{BrightGray}{rgb}{.9, .9, .9}

\newcommand{\dgrey}[1]{\textcolor{DarkGrey}{#1}}

\newenvironment{orangebg}{\begin{mdframed}[hidealllines=true,roundcorner=15pt,backgroundcolor=DarkOrange,leftmargin=20,rightmargin=20,usetwoside=false,skipabove=5]}{
\end{mdframed} }

\def\shadedVerbatim{0}
\DeclareOption{shaded}{\def\shadedVerbatim{1}}
\DeclareOption{ruled}{\def\sectionstyle{1}}
\DeclareOption{boxed}{\def\sectionstyle{2}}
\DeclareOption{twocolumns}{\def\ncols{2}}
\DeclareOption{threecolumns}{\def\ncols{3}}

\def\ncols{2}
\def\sectionstyle{3}
\ProcessOptions

\usepackage{multicol}
\usepackage[left=20mm,right=20mm,top=20mm,bottom=20mm]{geometry}
\newenvironment{poster}%
   {\maketitle \begin{multicols}{\ncols}}%
   {\end{multicols} \vfill
   \hrule
   \begin{tikzpicture}
     \node[anchor=south west] (myfirstpic) at (0.5,0.5) {\includegraphics[scale=.75]{eeng.pdf}};
     \node[anchor=west] at (6.5, 2) { \Large \bfseries \orange{Universidade do Minho}};
     \node[anchor=east] at (\linewidth, 2) { \Large \bfseries \orange{\thefooter}};
   \end{tikzpicture}
}

\newrgbcolor{DarkOrange}{.8 .3 0}
\newrgbcolor{LightOrange}{1 .95 .85}
\newrgbcolor{Red}{1 0 0}
\newrgbcolor{DarkRed}{.6 0 0}
\newrgbcolor{Green}{0 1 0}
\newrgbcolor{DarkGreen}{0 .6 0}
\newrgbcolor{Blue}{0 0 1}
\newrgbcolor{DarkBlue}{0 0 .6}
\newrgbcolor{DarkGrey}{.3 .3 .3}
\newcommand{\DarkGray}[1]{\DarkGrey{#1}}

\renewcommand{\emph}[1]{\orange{#1}}

\setlength{\columnsep}{15mm}

\newcommand{\subtitle}[1]{\def\thesubtitle{#1}}
\newcommand{\footer}[1]{\def\thefooter{#1}}
\renewcommand{\title}[1]{\def\thetitle{#1}}
\renewcommand{\author}[1]{\def\theauthor{#1}}

\renewcommand\maketitle{\par
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hb@xt@1.8em{%
                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \thispagestyle{empty}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}

\def\@maketitle{\vskip -40mm
\begin{mdframed}[backgroundcolor=LightOrange,hidealllines=false,roundcorner=20pt,leftmargin=0,rightmargin=0,usetwoside=false,skipabove=0,linewidth=3pt,linecolor=DarkOrange]
\begin{center}
  \DarkOrange \huge{\textsf{\textbf{\thetitle}}}\\
  \DarkGrey \Large{\textsf{\textbf{\thesubtitle}}}\\[3mm]
  \DarkOrange \large 
  \textsf{\theauthor}
\end{center}
\end{mdframed}
\vskip 3mm
}

\newcommand{\orange}[1]{{\DarkOrange\bfseries #1}}

\renewcommand\section{\@startsection{section}{1}{0pt}%
   {5mm}{1mm}{\DarkOrange\Large\sffamily\bfseries}}

\renewcommand\subsection{\@startsection{subsection}{2}{0pt}%
   {5mm}{1mm}{\DarkOrange\large\sffamily\bfseries}}

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{0pt}%
   {5mm}{1mm}{\DarkOrange\sffamily\bfseries}}


\newenvironment{block}[1]{
  \begin{framed}
    \subsection*{\vskip -1cm\noindent#1}
    \small\it
}{\end{framed}}

\newenvironment{blockaux}[1]{
  \begin{framed}
    \subsection*{\vskip -1cm\noindent#1}
%    \small\it
}{\end{framed}}

\newcommand{\ptitle}[2]{
  \begin{mdframed}[hidealllines=false,roundcorner=0pt,backgroundcolor=white,leftmargin=0,rightmargin=0,usetwoside=false,skipabove=0,linewidth=2pt,linecolor=DarkOrange]
    \begin{center}
      {\large\orange{#1}}\\[2mm]#2
    \end{center}
  \end{mdframed}
}

\newcommand{\psection}[2]{
  \begin{mdframed}[hidealllines=false,roundcorner=0pt,backgroundcolor=white,leftmargin=0,rightmargin=0,usetwoside=false,skipabove=0,linewidth=2pt,linecolor=DarkOrange]
    \begin{center}
      {\Large\DarkOrange\sffamily\bfseries{#1}}\\[3mm]#2
    \end{center}
  \end{mdframed}
}

\newcommand{\psubsection}[2]{\begin{framed}\begin{center}{\large\DarkOrange\sffamily\bfseries{#1}}\\[2mm]#2\end{center}\end{framed}}

\renewenvironment{abstract}{\begin{block}{\abstractname}}{\end{block}}

\newenvironment{sectionbox}[2][]{
\ifthenelse{\sectionstyle = 1}{
  \noindent\textcolor{DarkOrange}{\LARGE\bf #2 \rule{\columnwidth - \widthof{#2
}}{2mm}}
}{
\ifthenelse{\sectionstyle = 2}{
  \psection{#2}{#1}
}{
  \begin{blockaux}{#2}#1

}}}{
\ifthenelse{\sectionstyle = 1}{}{
\ifthenelse{\sectionstyle = 2}{}{
  \end{blockaux}
}}
\vskip 1cm}

\ifthenelse{\shadedVerbatim = 1}{\surroundwithmdframed{Verbatim}}{}

\endinput

\parindent 0pt
\parskip 6pt
