%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ups/univ-defaults.clo
%% NOVA thesis configuration file
%%
%% Customization for UNIVERSIDADE POLITÉCNICA DE SETÚBAL (strings and cover)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\typeout{NT FILE ups/univ-defaults.clo}%


% All LaTeX engines (pdfLaTeX, XeLaTeX, LuaLaTeX) are accepted
\AddValidProcessor{ups}{pdf,lua,xe}


%%=======================================================================
%% STRINGS (UNIVERSITY & SCHOOL)
%%=======================================================================

% University
\SetUniversity*(pt)={Universidade Politécnica de Setúbal}
\SetUniversity*(en)={Polytechnic University of Setúbal}

% Department
\SetDepartmentOfString*(pt)={Área Departamental de}

\SetCopyrightTextString(pt)={A \GetSchool(\@LANG@COVER)\ e o \GetUniversity(\@LANG@COVER)\ têm o direito, perpétuo e sem limites geográficos, de arquivar e publicar esta dissertação através de exemplares impressos reproduzidos em papel ou de forma digital, ou por qualquer outro meio conhecido ou que venha a ser inventado, e de a divulgar através de repositórios científicos e de admitir a sua cópia e distribuição com objetivos educacionais ou de investigação, não comerciais, desde que seja dado crédito ao autor e editor.}

\SetCopyrightTextString(en)={The \GetSchool(\@LANG@COVER)\ and the \GetUniversity(\@LANG@COVER)\ have the right, perpetual and without geographical boundaries, to file and publish this dissertation through printed copies reproduced on paper or on digital form, or by any other means known or that may be invented, and to disseminate through scientific repositories and admit its copying and distribution for non-commercial, educational or research purposes, as long as credit is given to the author and editor.}


%%=======================================================================
%% COMMITTEE
%%=======================================================================

\SetCommitteeOrder*()={c,r,a,m}%


%%=======================================================================
%% FONTS
%%=======================================================================


%%=======================================================================
%% LAYOUT (MARGINS)
%%=======================================================================

% Set margins for "normal" pages
\SetMargin*(screen,top)={3.5cm}
\SetMargin*(screen,bottom)={2.5cm}
\SetMargin*(screen,left)={3.0cm}
\SetMargin*(screen,right)={3.0cm}
\SetMargin*(paper,top)={3.5cm}
\SetMargin*(paper,bottom)={2.5cm}
\SetMargin*(paper,left)={3.0cm}
\SetMargin*(paper,right)={3.0cm}

% Set margins for cover pages
\SetMargin*(cover,top)={2.0cm}
\SetMargin*(cover,bottom)={1.5cm}
\SetMargin*(cover,left)={3.0cm}
\SetMargin*(cover,right)={2.0cm}


%%=======================================================================
%% SPINE
%%=======================================================================

\SetSpine(logo)={ups-logo}


%%=======================================================================
%% UTILITIES & HOOKS
%%=======================================================================

\newcommand{\@leftcol}{0.37\linewidth}
\newcommand{\@rightcol}{0.55\linewidth}

\SetThesisCover(textfont)={\sffamily}
% \NTAddToHook{cover/text/pre}{%
%   \sffamily%
% }
% LOGO
\ntaddtocover[vspace=0cm]{1-1}{%
  \includegraphics[height=4.6cm]{\expanded{\GetSchool(logo)}}%
}

% Author name and Title
\ntaddtocover[halign=l, vspace=5cm]{1-1}{%
  % Author name
  \begin{minipage}[t]{\@leftcol}%
    \fontsize{16}{16}\selectfont\raggedleft%
    \GetDocAuthor(name)%
  \end{minipage}%
  \hfill%
  % Title of Dissertation
  \begin{minipage}[t]{\@rightcol}%
    \fontsize{16}{16}\selectfont\raggedright%
    \textbf{\GetDocTitle(\@LANG@COVER,main)}%
  \end{minipage}%
}

% Photo
\ntaddtocover[halign=l, vfill=1]{1-1}{%
  \hfill%
  \begin{minipage}[t]{\@rightcol}%
    \includegraphics[height=5.3cm]{\GetFrontPageImage()}%
  \end{minipage}%
}

% Degree
\ntaddtocover[halign=l, vfill=1]{1-1}{%
  \hfill%
  \begin{minipage}[t]{\@rightcol}%
    \fontsize{11}{11}\selectfont\raggedright%
    \thepresentationtext%
  \end{minipage}%
}

% Advisers
\ntaddtocover[vfill=1]{1-1}{%
  \hfill%
  \begin{minipage}[t]{\@rightcol}%
    \MemSet{adviserstringfont}{a}{\bfseries}%
    \MemSet{adviserstringfont}{c}{\bfseries}%
    \fontsize{11}{11}\selectfont%
    \ntprintpersons{1}{2}{adviser}{a,c}%
  \end{minipage}%
}

% Date
\ntaddtocover[vfill=2]{1-1}{%
  \hfill%
  \begin{minipage}[t]{\@rightcol}%
    \fontsize{10}{10}\selectfont%
    \PrintDateISO{\GetDocDate(submission,year)-\GetDocDate(submission,month)}%
  \end{minipage}%
}


%%=======================================================================
%% COVER 2 ELEMENTS
%%=======================================================================

\ntaddtocover[vspace=0cm]{2-1}{%
  \rule{0cm}{4.6cm}%
}

% Author name and Title
\ntaddtocover[halign=l, vspace=5cm]{2-1}{%
  % Author name
  \begin{minipage}[t]{\@leftcol}%
    \fontsize{16}{16}\selectfont\raggedleft%
    \GetDocAuthor(name)%
  \end{minipage}%
  \hfill%
  % Title of Dissertation
  \begin{minipage}[t]{\@rightcol}%
    \fontsize{16}{16}\selectfont\raggedright%
    \textbf{\GetDocTitle(\@LANG@COVER,main)}%
  \end{minipage}%
}

\ntaddtocover[vfill=1]{2-1}{%
  \hfill%
  \begin{minipage}[t]{0.75\textwidth}%
    \ifmaindoc{%
      \MemSet{committeetitlestringfont}{}{\fontsize{14}{14}\selectfont\bfseries}%
      \MemSet{committeestringfont}{}{\bfseries}%
      \fontsize{12}{12}\selectfont\ntprintpersons{1}{2}{committee}{\GetCommitteeOrder()}%
    }{}%
  \end{minipage}%
}

% Date
\ntaddtocover[vfill=2]{2-1}{%
  \hfill%
  \begin{minipage}[t]{\@rightcol}%
    \fontsize{10}{10}\selectfont%
    \PrintDateISO{\GetDocDate(submission,year)-\GetDocDate(submission,month)}%
  \end{minipage}%
}
