\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{PSSOH}[2021/06/16 PSSOH conference class]
% Author: Miloš Daković milos@ucg.ac.me

\RequirePackage{ifxetex}
\ifxetex
\else
	\ClassError{PSSOH}{XeTeX engine is required}{XeTeX je obavezan}
\fi

\LoadClass[12pt,a4paper]{article}

\RequirePackage[xetex,top=2cm,left=2cm,right=2cm,height=24.5cm]{geometry}

\RequirePackage{fontspec}
\RequirePackage{polyglossia}
\RequirePackage{microtype}
\RequirePackage{graphicx}
\RequirePackage{booktabs}
\RequirePackage{xcolor}
\RequirePackage{titlesec}
\RequirePackage[center]{caption}
\RequirePackage{hyperref}

\defaultfontfeatures{Ligatures=TeX}
\setsansfont{Liberation Sans}
\setmainfont{Liberation Serif}
\setmainlanguage[Script=Latin]{serbian}
\addto{\captionsserbian}{\renewcommand{\abstractname}{REZIME}}
\addto{\captionsserbian}{\renewcommand{\refname}{Literatura}}

\DeclareOption{eng}{
\setmainlanguage{english}
}
\DeclareOption{srlat}{
}
\DeclareOption{srcyr}{
\setmainlanguage[Script=Cyrillic]{serbian}
\addto{\captionsserbian}{\renewcommand{\abstractname}{РЕЗИМЕ}}
\addto{\captionsserbian}{\renewcommand{\refname}{Литература}}
}

\hypersetup{
    colorlinks = true,
    urlcolor = blue,
    linkcolor = black,
}


\titlelabel{\thetitle~}
\titleformat*{\section}{\sffamily\fontsize{16.1}{19.3}\selectfont\centering\bfseries}
\titleformat*{\subsection}{\sffamily\fontsize{14.1}{17}\selectfont\centering\bfseries}

\titlespacing*{\section}
{0pt}{0.35cm}{-0.1cm}
\titlespacing*{\subsection}
{0pt}{0.23cm}{0cm}

\setlength{\parskip}{0.254cm}
\setlength{\parindent}{0cm}

\let\OLDthebibliography\thebibliography
\renewcommand\thebibliography[1]{
  \OLDthebibliography{#1}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt}
  \fontsize{10}{12}\selectfont
}

\renewenvironment{abstract}
  { {\sffamily\fontsize{16.1}{19.3}\selectfont\centering\bfseries
  \bfseries\abstractname\vspace*{2mm}\par} }
  {}

\def\@Podnaslov{0}
\newcommand{\subtitle}[1]{\def\@Podnaslov{#1}}


\makeatletter
\def\@maketitle{%
  \newpage
  %\null
  \vspace*{-4mm}\par
  {\centering%
  \let \footnote \thanks
    {\sffamily\fontsize{28}{33.6}\selectfont\centering\bfseries\@title \par}%
	\if\@Podnaslov0    
	    \vskip 2mm%
	\else
	    {\sffamily\fontsize{18}{21.6}\selectfont\centering\bfseries\@Podnaslov \par}%
	    \vskip 2mm%    
	\fi
    { \@author \par}
    {\@date \par}
  }%
  \vspace*{4pt}
  \par
  }
\makeatother

\linespread{0.95}

\ProcessOptions\relax