\ProvidesPackage{spc}

\usepackage[a4paper,left=2cm,right=1.5cm,top=1in,bottom=1.5cm,asymmetric]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx} %Font.
\usepackage[fleqn]{amsmath} %Equations.
\usepackage[table]{xcolor} %Colored table.
\usepackage{authblk} %Authors' block.
\usepackage{fancyhdr} %Headers and footers.
\usepackage{enumitem} %Custom list labels.
\usepackage{microtype} %Better spacing.
\usepackage[compact]{titlesec} %Custom sectioning. 'compact' shrinks all the whitespace around section headings.
\usepackage[font=small,labelfont=bf]{caption} %Custom captions.
\usepackage{xcolor} %Colors.
\usepackage{multirow} %Cells that span multiples columns.
\usepackage{graphicx} %For images.
\usepackage{textcomp} %Copyright and registered symbols.
\usepackage{booktabs} %Better tables.
\usepackage{xifthen} %IF/ELSE commands
\usepackage{cuted} %Span figures and equations onto two columns.
\usepackage{enumitem}
	\setlist{noitemsep} % Reduce lists' line spacing.
% Other packages
\usepackage{amsthm, amscd, amsfonts, amssymb}
\usepackage [displaymath, mathlines]{lineno}
\usepackage{hyperref}
	\hypersetup{colorlinks, linkcolor=blue, urlcolor=blue, citecolor=blue}


% New paragraphs will not be indented
\setlength{\parindent}{0pt}

% Gap between columns
\setlength{\columnsep}{0.5cm}

% No date
\date{}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% JOURNAL INFORMATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% If you pass an argument, it will be used, otherwise we use the default.
%\newcommand{\spcJournalName}[1]{%
%\ifthenelse{\isempty{#1}}{International Journal of Applied Mathematical Research}{#1}}

\newcommand{\spcJournalName}{International Journal of Applied Mathematical Research}

\newcommand{\spcJournalImage}{IJAMR-min.png}

\newcommand{\spcJournalNumber}{\textbf{\spcJournalName}, 5 (x) (2016) xxx-xxx}

\newcommand{\spcJournalSite}{Journal home page: www.sciencepubco.com/index.php/IJAMR}

\newcommand{\spcDoi}{doi:}

\newcommand{\spcJournalDesc}{Research paper, Short communication, Review, Technical paper}

\newcommand{\spcWarn}{\textcolor{red}{\it \textbf{Please keep only one of the types above and delete the others, including this phrase!}}}

\newcommand{\spcAbstract}[1]{
\long\gdef\absText{\fontsize{9pt}{10.8pt}\selectfont#1}
}

\newcommand{\spcKeywords}[1]{
\long\gdef\listKeywords{\it\fontsize{8pt}{9.6pt}\selectfont#1}
}

\newcommand{\spcCCauthors}{Authors}

\newcommand{\spcCC}{\includegraphics[width=0.65in,keepaspectratio]{image2.png}}

\newcommand{\spcCopyright}{\fontsize{7pt}{8.4pt}\selectfont\bf Copyright \textcopyright~2016 \spcCCauthors. This is an open access article distributed under the \textcolor{blue}{\underline{Creative Commons Attribution License}}, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.}

\newcommand{\startsAtpage}[1]{\setcounter{page}{#1}}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Custom Sectioning
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Section
\titleformat{\section}[block]%
{\normalfont\fontsize{12}{14.4}\bfseries}{\thesection.}{0.4em}%
{\normalfont\fontsize{12}{14.4}\bfseries\selectfont}

\titlespacing{\section}{0pt}{10pt}{10pt}

% Subsection
\titleformat{\subsection}[block]%
{\normalfont\fontsize{10}{12}\bfseries}{\thesubsection.}{0.4em}%
{\normalfont\fontsize{10}{12}\bfseries\selectfont}

\titlespacing{\subsection}{0pt}{10pt}{10pt}

% Subsubsection
\titleformat{\subsubsection}[block]%
{\normalfont\fontsize{9}{10.8}\bfseries}{\thesubsubsection.}{0.4em}%
{\normalfont\fontsize{9}{10.8}\bfseries\selectfont}

\titlespacing{\subsubsection}{0pt}{10pt}{10pt}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Table columns
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Headings' styles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancypagestyle{firstpage}{
	\fancyhf{}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0.5pt}
	\setlength{\headsep}{-0.25in}
	\fancyfoot[L]{%
		\begin{minipage}{0.09\textwidth}%
			\spcCC% CC Logo
		\end{minipage} \hfill%
		\begin{minipage}{0.885\textwidth}%
			\spcCopyright% Text
		\end{minipage}}
}

\fancypagestyle{followingpage}{
	\fancyhf{} % clear all six fields
	\fancyhead[LE,RO]{\fontsize{8pt}{9.6pt}\selectfont\thepage}
	\fancyhead[RE,LO]{\fontsize{8pt}{9.6pt}\selectfont\textit{\spcJournalName}}
	\renewcommand{\headrulewidth}{0.5pt}
}
% Default style
\pagestyle{followingpage}
% First page style
\AtBeginDocument{\thispagestyle{firstpage}}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Customizations for authors' affiliation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\Authfont{\bfseries}
\renewcommand\Affilfont{\normalfont\fontsize{9pt}{10.8pt}\itshape}
\renewcommand\Authands{ and }

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Special gray cell for Journal Header.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{gray}{HTML}{F2F2F2}
\newcommand{\specialcell}[2][c]{%
	\cellcolor{gray}
	\begin{tabular}{c}
	#2
	\end{tabular}
}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Group headers and abstract in one column.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\maketitle{

 \begingroup
 	\twocolumn[\spcMaketitle]
 \endgroup

}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Group headers and abstract in one column.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% All equations must be intirely aligned to the left.
\setlength{\mathindent}{0cm}

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


% Reduce line spacing and font for the bibliography.
\let\OLDthebibliography\thebibliography
\renewcommand\thebibliography[1]{
  \OLDthebibliography{#1}
  \fontsize{8}{0}\selectfont
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt plus 1ex}
}

%\setcounter{page}{0}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% First page header, author, abstract and keywords.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Thicker line
\newcommand{\thickhline}{%
    \noalign {\ifnum 0=`}\fi \hrule height 0.2em
    \futurelet \reserved@a \@xhline
}

% Cell spacing
\renewcommand{\arraystretch}{1}% Tighter

% The header
\def\spcMaketitle{
\vspace*{0.2cm}
		\begin{center}
		% @{} removes the cell padding.
		\begin{tabular}{@{}C{0.7in}C{5in}C{0.8in}@{}}
		\hline
		 \includegraphics[width=0.7in,keepaspectratio]{logo} &		
		\specialcell{
			{\fontsize{8pt}{9.6pt} \it \spcJournalNumber}\\\\
			{\fontsize{14pt}{16.8pt}\bf\spcJournalName}\\\\
			{\fontsize{8pt}{9.6pt} \it \spcJournalSite}\\
			{\fontsize{8pt}{9.6pt} \it \spcDoi}\\
			{\fontsize{8pt}{9.6pt} \it \textbf{\spcJournalDesc}}
		}
		& %\includegraphics[width=0.75in,keepaspectratio]{IJAMR-min.png}
		\includegraphics[width=0.75in,height=0.972in]{\spcJournalImage}
		\\
		\thickhline
		\end{tabular}
		
		% TITLE
		\vspace*{1.5cm}
		{\linespread{1.1}\fontsize{18pt}{21.6pt}\bf \@title\par}%
		
		% LIST OF AUTHORS
		\vspace*{0.5cm}
		{\fontsize{10pt}{12pt} \@author}		
				
		\end{center}
		
		\vspace*{0.3cm}
		
		% ABSTRACT
		\hrulefill\\
		{\fontsize{10pt}{12pt}\textbf{Abstract}\vspace*{12pt}}\\		
		\absText \\\\		
		{\fontsize{8pt}{10.8pt}\textit{\textbf{Keywords:}}}		
		\listKeywords\vspace*{0.05cm}
				
		\hrule
		\vspace*{0.5cm}
}

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



\endinput