%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% novathesisFiles/ChapStyles/vz43.sty
%% NOVA thesis configuration file
%%
%% Customization for the VZ43 chapter style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\typeout{NT FILE novathesisFiles/ChapStyles/vz43.sty}%


%%=======================================================================
%% FLAGS
%%=======================================================================

% Guard against double-loading (both vz34 and vz43 use this flag).
\@ifundefined{ifNoChapNumber}{\newif\ifNoChapNumber}{}


%%=======================================================================
%% HELPERS
%%=======================================================================

\providecommand\Vlines{%
  \def\VL{\rule[-2cm]{1pt}{5cm}\hspace{1mm}\relax}
  \VL\VL\VL\VL\VL\VL\VL
}


%%=======================================================================
%% CHAPTER STYLE
%%=======================================================================

\setlength\midchapskip{0pt}

\makechapterstyle{VZ43}{%
  \renewcommand\chapternamenum{}
  \renewcommand\printchaptername{}
  \renewcommand\printchapternum{}
  \renewcommand\chapnumfont{\Huge\bfseries\centering}
  \renewcommand\chaptitlefont{\Huge\bfseries\raggedright}
  \renewcommand\printchaptertitle[1]{%
    % The number box below is a narrow fixed .8cm -- "Appendix"/"Annex"
    % would never fit inside it, so print it as its own line above instead.
    \ifx\ntchapnumappendixname\@empty\else
      {\chapnumfont\ntchapnumappendixname\par}%
    \fi
    \Vlines\hspace*{-2em}%
    \begin{tabular}{@{}p{1cm} p{\textwidth-3cm}}%
      \ifNoChapNumber\relax\else%
      \colorbox{black}{\color{white}%
        \makebox[.8cm]{\chapnumfont\strut \thechapter}}
      \fi%
      & \chaptitlefont ##1%
    \end{tabular}%
    \NoChapNumberfalse%
  }
  \renewcommand\printchapternonum{\NoChapNumbertrue}
}

\chapterstyle{VZ43}
