%-------------------------------------------------------------------------------
% ipol.cls
% LaTeX class for IPOL articles
%
% rafael grompone von gioi - 2012.1.17
%-------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ipol}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[a4paper,12pt]{article}

% Margins
\RequirePackage[cm]{fullpage}

% Links package and colors definition
\RequirePackage{color}
\definecolor{link}{rgb}{0.,0.5,1}
\RequirePackage[colorlinks,
                linkcolor=link,
                anchorcolor=link,
                citecolor=link,
                filecolor=link,
                menucolor=link,
                pagecolor=link,
                urlcolor=link]{hyperref}

% IPOL environments
\newenvironment{ipolAbstract}{\small%
                              \begin{center}%
                              {\bf Abstract\vspace{-.5em}}%
                              \end{center}%
                              \begin{quote}%
                              \noindent\ignorespaces}{\end{quote}}
\newenvironment{ipolCode}{\small%
                          \begin{center}%
                          {\bf Source Code\vspace{-.5em}}%
                          \end{center}%
                          \begin{quote}%
                          \noindent\ignorespaces}{\end{quote}}
\newenvironment{ipolSupp}{\small%
                          \begin{center}%
                          {\bf Supplementary Material\vspace{-.5em}}%
                          \end{center}%
                          \begin{quote}%
                          \noindent\ignorespaces}{\end{quote}}

% IPOL data
\newcommand{\ipolTitle}{title}
\newcommand{\ipolAuthors}{authors}
\newcommand{\ipolYear}{YYYY}
\newcommand{\ipolMonth}{MM}
\newcommand{\ipolDay}{DD}
\newcommand{\ipolDOI}{xx.xxxx/ipol.xxxx.xxxxx}
\newcommand{\ipolLink}{http://dx.doi.org/10.5201/ipol.YYYY.XXXXXXXX}

% IPOL data set commands
\newcommand{\ipolSetTitle}[1]{\renewcommand{\ipolTitle}{#1}}
\newcommand{\ipolSetAuthors}[1]{\renewcommand{\ipolAuthors}{#1}}
\newcommand{\ipolSetYear}[1]{\renewcommand{\ipolYear}{#1}}
\newcommand{\ipolSetMonth}[1]{\renewcommand{\ipolMonth}{#1}}
\newcommand{\ipolSetDay}[1]{\renewcommand{\ipolDay}{#1}}
\newcommand{\ipolSetDOI}[1]{\renewcommand{\ipolDOI}{#1}}
\newcommand{\ipolSetLink}[1]{\renewcommand{\ipolLink}{#1}}

% Print IPOL Header and Title
\AtBeginDocument{%
\includegraphics[width=.27\linewidth]{ipol.pdf}
\hspace{1em}
\vbox{\scriptsize\sf\noindent%
Published in Image Processing On Line on \ipolYear--\ipolMonth--\ipolDay.\\
ISSN 2105--1232 \copyright\ \ipolYear\ IPOL CC--BY--NC--SA\\
This article is available online with supplement materials,\\
implementation, datasets and demonstration at\\
\url{\ipolLink}}
\bigskip
\begin{center}
\Large\textbf{\ipolTitle}\\
\bigskip
\large\ipolAuthors\\
\bigskip
\end{center}
}

%-------------------------------------------------------------------------------
