%% General paper's style settings.
%%
%% This preamble can be completely ignored when including this TeX file in
%% another style. This is done because this LaTeX build is meant to be an
%% initial/internal phase or part of a larger effort, so it has a basic
%% style defined here as a preamble. To ignore it, uncomment or delete the
%% respective line in `paper.tex'.
%%
%% Copyright (C) 2019 Mohammad Akhlaghi <mohammad@akhlaghi.org>
%
%% This template is free software: you can redistribute it and/or modify it
%% under the terms of the GNU General Public License as published by the
%% Free Software Foundation, either version 3 of the License, or (at your
%% option) any later version.
%
%% This template is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%% General Public License for more details.
%
%% You should have received a copy of the GNU General Public License along
%% with this template. If not, see <http://www.gnu.org/licenses/>.





%% Font.
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage{newtxmath}





%% Print size
\usepackage[a4paper, includeheadfoot, body={18.7cm, 24.5cm}]{geometry}





%% Set the distance between the columns if two columns:
\setlength{\columnsep}{0.75cm}





% To allow figures to take up more space on the top of the page:
\renewcommand{\topfraction}{.99}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.05}
\renewcommand{\floatpagefraction}{.99}
\renewcommand{\dbltopfraction}{.99}
\renewcommand{\dblfloatpagefraction}{.99}
\setcounter{topnumber}{1}
\setcounter{bottomnumber}{0}
\setcounter{totalnumber}{2}
\setcounter{dbltopnumber}{1}





%% Color related settings:
\usepackage{xcolor}
\color{black}                   % Text color
\definecolor{DarkBlue}{RGB}{0,0,90}






% figure and figure* ordering correction:
\usepackage{fixltx2e}





%% For editing the caption appearence. The `setspace' package defines
%% the `stretch' variable. `abovecaptionskip' is the distance between
%% the figure and the caption.
\usepackage{setspace, caption}
\captionsetup{font=footnotesize, labelfont={color=DarkBlue,bf}, skip=1pt}
\captionsetup[figure]{font={stretch=1, small}}
\setlength{\abovecaptionskip}{3pt plus 1pt minus 1pt}
\setlength{\belowcaptionskip}{-1.25em}






%% To make the footnotes align:
\usepackage[hang]{footmisc}
\setlength\footnotemargin{10pt}





%For including time in the title:
\usepackage{datetime}





%To make links to webpages and include document information in the
%properties of the PDF
\usepackage[
  colorlinks,
  urlcolor=blue,
  citecolor=blue,
  linkcolor=blue,
  linktocpage]{hyperref}
\renewcommand\UrlFont{\rmfamily}





%% Define the abstract environment
\renewenvironment{abstract}
 {\vspace{-0.5cm}\small%
  \list{}{%
    \setlength{\leftmargin}{2cm}%
    \setlength{\rightmargin}{\leftmargin}%
  }%
  \item\relax}
 {\endlist}





%% To keep the main page's code clean.
\newcommand{\includeabstract}[1]{%
\twocolumn[%
  \begin{@twocolumnfalse}%
    \maketitle%
    \begin{abstract}%
    #1%
    \end{abstract}%
    \vspace{1cm}%
  \end{@twocolumnfalse}%
  ]%
}