%\documentclass[11pt,a4paper]{report}
\documentclass[11pt,a4paper,titlepage]{article}
%\documentclass[11pt,a4paper]{amsart}

% 1 inch margins
\usepackage{textcomp}
\usepackage{fullpage}
\usepackage{textcomp}  % \textgreater, \textless
\usepackage{framed}
\usepackage{listings}
  \usepackage{courier}
\usepackage{amsmath}
\usepackage{verbatim}
%\usepackage{graphicx}             % latex, eps
\usepackage[pdftex]{graphicx}    % pdflatex, png, jpg, pdf
%\usepackage[dvips,usenames,dvipsnames]{color}   % dvips here screws up graphicx png version, above
\usepackage[usenames]{color}   % dvips here screws up graphicx png version, above
\usepackage{hyperref}
%\usepackage{titletoc}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headheight}{14pt}
\renewcommand{\headsep}{10pt}
\lhead{\leftmark}
\rhead{\rightmark}
\lfoot{Copyright (C) 2008-2016 NIWA}
\rfoot{\thepage}

\usepackage{lmodern}
\renewcommand{\familydefault}{\rmdefault}


\usepackage{titlepic}  % off CTAN, held locally in cylc doc dir.

\usepackage{tocloft}
% prevent double digit sub-sections crowding the toc line
\addtolength\cftsubsecnumwidth{0.5em}  % see tocloft manual

%\definecolor{codeblock}{rgb}{0.98,0.93,0.85}
%\definecolor{codeblock}{rgb}{0.96,0.96,0.96}
%\definecolor{keywords}{rgb}{1.0,0.3,0.0}
\definecolor{keywords}{rgb}{0.8,0.4,0.0}
%\definecolor{comments}{rgb}{0.0,0.7,0.8}
\definecolor{comments}{rgb}{1.0,0.2,0.3}
\definecolor{identifiers}{rgb}{0.3,0.4,0.5}
\definecolor{strings}{rgb}{0.2,0.5,0.3}
\definecolor{basic}{rgb}{0.3,0.4,0.5}
\definecolor{command}{rgb}{0.0,0.2,0.1}
\definecolor{transcr}{rgb}{0.0,0.2,0.4}
\definecolor{level1}{rgb}{0.0,0.2,0.6}
\definecolor{level2}{rgb}{0.0,0.3,0.7}
\definecolor{level3}{rgb}{0.0,0.4,0.8}
\definecolor{jinja2}{rgb}{0.1,0.7,0.4}

% hyperlink color:
%\definecolor{linkc}{rgb}{0,0.2,0.68}
% colored hyperlink instead of boxed
%\hypersetup{colorlinks=true, linkcolor=linkc}
\hypersetup{colorlinks=true, linkcolor=blue}

%\definecolor{shadecolor}{rgb}{0.9,0.9,0.1}
\usepackage{lmodern}
\usepackage[T1]{fontenc}

\newcommand\mysmall{\fontsize{9}{9.2}\selectfont}

\lstset{
language=,
%xleftmargin=2em,
%frame=single,
%backgroundcolor=\color{codeblock},
%basicstyle=\color{basic}\footnotesize\ttfamily\bfseries,
%basicstyle=\color{basic}\scriptsize\ttfamily\bfseries,
%basicstyle=\color{basic}\small\ttfamily\bfseries,
%basicstyle=\color{basic}\normalsize\ttfamily\bfseries,
basicstyle=\color{basic}\mysmall\ttfamily,
identifierstyle=\color{identifiers},
keywordstyle=\color{keywords},
commentstyle=\color{comments},
stringstyle=\color{strings},
showstringspaces=false,
%numbers=left,
%numberstyle=\color{Gray}
}

\lstdefinelanguage{transcript}
{
string=[b]{"},
comment=[l][\color{comments}]{\#},
alsoletter={$},
morekeywords={shell$},
}

\lstdefinelanguage{suiterc}
{
string=[b]{"},
sensitive=true,
comment=[l]{\#},
morecomment=[s][\color{level1}]{[}{]},
morecomment=[s][\color{level2}]{[[}{]]},
morecomment=[s][\color{level3}]{[[[}{]]]},
morecomment=[s][\color{jinja2}]{\{\%}{\%\}},
morecomment=[s][\color{jinja2}]{\{\{}{\}\}},
}

\lstdefinelanguage{usage}
{
string=[b]{"},
sensitive=false,
morecomment=[l]{Usage:},
morecomment=[l]{USAGE:},
morecomment=[l]{usage:},
morecomment=[l]{HELP:},
morecomment=[l]{CATEGORY:},
morecomment=[l]{COMMANDs:},
morecomment=[l]{Arguments:},
morecomment=[l]{Options:},
morecomment=[l]{arguments:},
morecomment=[l]{command-options:},
morecomment=[l]{COMMANDS:},
morecomment=[l]{options:},
%morecomment=[l]{\#},
numbers=none,
morekeywords={shell$},
}

% allow \paragraph as subsubsubsection
% and \subparagraph as subsubsubsubsection
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

% the follow makes \paragraph{} be followed
% by a newline, as for section headings.
\makeatletter
\renewcommand\paragraph{%
   \@startsection{paragraph}{4}{0mm}%
      {-\baselineskip}%
      {.5\baselineskip}%
      {\normalfont\normalsize\bfseries}}
\makeatother
% and similarly for \subparagraph{}
\makeatletter
\renewcommand\subparagraph{%
   \@startsection{subparagraph}{4}{0mm}%
      {-\baselineskip}%
      {.5\baselineskip}%
      {\normalfont\normalsize\bfseries}}
\makeatother

\title{The Cylc Suite Engine\linebreak
User Guide \linebreak
{\em \small
\input{cylc-version.txt} % generated each time by doc/process
} \linebreak
{\em \small Released Under the GNU GPL v3.0 Software License} \linebreak
{\small Copyright (C) 2008-2016 NIWA}}

\author{Hilary Oliver}

\titlepic{\includegraphics[width=0.5\textwidth]{graphics/png/orig/niwa-colour.png}}

% define a more compact itemized list environment
\newenvironment{myitemize} {
\begin{itemize}
    \setlength{\itemsep}{1pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}
    \setlength{\topsep}{0pt}
    }{\end{itemize}}

% define a more compact enumerate list environment
\newenvironment{myenumerate} {
\begin{enumerate}
    \setlength{\itemsep}{1pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}
    \setlength{\topsep}{0pt}
    }{\end{enumerate}}

\usepackage{color}
\definecolor{hilight}{rgb}{0.5,1.0,0.8}
\newcommand{\hilight}[1]{\colorbox{hilight}{#1}}

\begin{document}

\maketitle

\pagebreak

\input{abstract.tex}

\pagebreak
\tableofcontents
\listoffigures
%\listoftables

\pagebreak
\input{cug.tex}

\end{document}
