% simiode.cls for LaTeX2e
% Version 21-November-2016.
% Fixed caption formatting to apply to multiple lines of text.

% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{simiode-spanish}[2013/03/11]

% Bring in the regular article class
\LoadClass[twoside]{article}

% Set the page dimensions
\setlength{\textheight}{21.cm} 
\advance\textheight by \topskip
\setlength{\textwidth}{15.2 cm}
\setlength{\oddsidemargin}{0.63 cm}
\setlength{\evensidemargin}{0.63 cm}
\setlength{\topmargin}{0.0 cm}
\setlength{\headsep}{0.5 cm }


% Do the page numbers in boldface
\renewcommand{\thepage}{\bf\arabic{page}}

% Here is the information supplied in the header which is not
% part of the normal LaTeX topmatter.
\newcommand{\keywords}[1]{\renewcommand{\key@words}{#1}}
\newcommand{\key@words}{\null}

\newcommand{\tagwords}[1]{\renewcommand{\tag@words}{#1}}
\newcommand{\tag@words}{\null}

% Change the myheadings option to boldface.
\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\bfseries\leftmark}%
    \def\@oddhead{{\bfseries\rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\sectionmark\@gobble
    \let\subsectionmark\@gobble
    }


\newcommand{\makeSimiodeHeader}{
\thispagestyle{empty}
{\null}\vskip 0.75in
\begin{center}
{\Large\bfseries \@title \par}
  {\large
    \lineskip .75em%
      \vskip 0.8 cm
    \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
\end{center}
\bigskip
}
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% No Simiode Logo. Original Style                              
% Place title, author, abstract, keywords/tags on page 1. 
\newcommand{\makeStitle}{ \thispagestyle{empty} {\null}\vskip 
0.75in \begin{center} {\Large\bfseries \@title \par} 
  {\large
    \lineskip .75em%
      \vskip 0.8 cm
    \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
\end{center} \bigskip } 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% With Simiode Logo (for PDFLatex)                               
% Place jpg logo, title, author, abstract, keywords/tags on    
% page 1. Use PDFLaTex to compile 
\newcommand{\makeStitlePDFLaTex}{ \thispagestyle{empty} 
\begin{figure} 
  % Requires \usepackage{graphicx} % Compile with PDFLatex
\centering{\includegraphics[width=15 cm]{SimiodeLogo.jpg}} 
\end{figure}   
 {\null}\vspace*{-1 true cm} %was 0.75in 
\begin{center} {\Large\bfseries \@title \par} 
  {\large
    \lineskip .75em%
      \vskip 0.8 cm
    \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
\end{center} \bigskip } 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% With Simiode Logo (for Latex)                                
% Place eps logo, title, author, abstract, keywords/tags on    
% page 1. Use LaTex to compile           
\newcommand{\makeStitleLaTex}{ \thispagestyle{empty} 
\begin{figure} 
\begin{center}
  % Requires \usepackage{graphicx} % Compile with PDFLatex
  \includegraphics[width=15 cm]{SimiodeLogoEPS.eps}
\end{center}
\end{figure}  
 {\null}\vspace*{-1 true cm} %was 0.75in 
\begin{center} {\Large\bfseries \@title \par} 
  {\large
    \lineskip .75em%
      \vskip 0.8 cm
    \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
\end{center} \bigskip } 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

% Redefine the abstract environment.
\renewenvironment{abstract}{%
\noindent\small
{\normalsize\bfseries Resumen:}
} 

% List the keywords.
\newcommand{\listkeywords}{
\bigskip
{\noindent
{\small\bfseries Palabras Clave:} \key@words}
\vskip 0.3in
}


% List the tags
\newcommand{\listtags}{
\bigskip
{\noindent
{\small\bfseries Etiquetas:} \tag@words}
\vskip 0.3in
}
% Make the section and subsection fonts smaller.
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\normalsize\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
                                     
 % Reduce \belowcaptionskip.
 \setlength\belowcaptionskip{5pt}
                                                                       
% Modify the "Figure X" font in figure captions.
\renewcommand{\@makecaption}[2]{
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\small {\bfseries #1.} #2}%
  \ifdim \wd\@tempboxa >\hsize
    {\small {\bfseries #1.} #2}\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
  
% Set the \footnoterule width to zero.
\renewcommand\footnoterule{%
  \kern0\p@
  \hrule\@width0\p@
  \kern0\p@}
  
% Make "REFERENCES" in all caps.
\renewcommand\refname{REFERENCIAS}

% Always want author on left and title on right.
\pagestyle{myheadings}

% Re-format quotes and quotations
\renewenvironment{quotation}{\begin{list}{}{\leftmargin=15pt%
\rightmargin=15pt%
\listparindent=0pt}\item\relax}%
{\end{list}}
\renewenvironment{quote}{\begin{list}{}{\leftmargin=15pt%
\rightmargin=15pt%
\listparindent=0pt}\item\relax}%
{\end{list}}

%%%  tweaklist.sty  %%%
\def\enumhook{}
\def\enumhooki{}
\def\enumhookii{}
\def\enumhookiii{}
\def\enumhookiv{}
\def\itemhook{}
\def\itemhooki{}
\def\itemhookii{}
\def\itemhookiii{}
\def\itemhookiv{}
\def\descripthook{}
\def\enumerate{%
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname
        {\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}%
          \enumhook \csname enumhook\romannumeral\the\@enumdepth\endcsname}%
  \fi}
\def\itemize{%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list
      \csname\@itemitem\endcsname
      {\def\makelabel##1{\hss\llap{##1}}%
        \itemhook \csname itemhook\romannumeral\the\@itemdepth\endcsname}%
  \fi}
\renewenvironment{description}
                 {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                          \let\makelabel\descriptionlabel\descripthook}}
                 {\endlist}
                 
% Use code from tweaklist.sty
% to reduce \itemsep
\renewcommand{\enumhook}
{
\setlength{\parsep}{0pt}
\setlength{\itemsep}{2pt}
\setlength{\listparindent}{1.5em}
\setlength{\leftmargin}{2em}
}
%
\renewcommand{\itemhook}
{
\setlength{\parsep}{0pt}
\setlength{\itemsep}{2pt}
\setlength{\listparindent}{1.5em}
\setlength{\leftmargin}{2em}
}
%
\renewcommand{\descripthook}
{
\setlength{\parsep}{0pt}
\setlength{\itemsep}{2pt}
\setlength{\listparindent}{1.5em}
\setlength{\leftmargin}{2em}
}


