\documentclass[a4paper]{article}

\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{authblk}

\usepackage{listings}

\usepackage{color}

\lstset{
    frameround=tttt,
    framerule=0pt,
    aboveskip=0.5cm,
    framextopmargin=3pt,
    framexbottommargin=3pt,
    framexleftmargin=-0.1cm,
    framesep=0pt,
    rulesep=.4pt,
    tabsize=2,
    rulecolor=,
    columns=fixed,
    showstringspaces=false,
    extendedchars=true,
    breaklines=true,
    prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},  
    %backgroundcolor=\color{gray97},
    rulesepcolor=\color{black},
    showstringspaces = false,
    basicstyle=\tt\tiny,
      keywordstyle=\bfseries \color{keywordcolor},
      commentstyle=\color{commentcolor},
    identifierstyle=,
    numbers=left, 
    numberstyle=\tiny \color{gray75}, 
    rangebeginprefix=//\ \ begin\{jml_clause:,
    rangebeginsuffix=\},
    rangeendprefix=//\ \ end\{jml_clause:,
    rangeendsuffix=\},
    includerangemarker=false,
    language=Java,
    morecomment=[s][\color{jml_green}]{/*@}{@*/},
    morecomment=[l][\color{jml_green}]{//@} ,
    morecomment=[l][\color{white}]{//\ \ begin\{jml_clause:} ,
    morecomment=[l][\color{white}]{//\ \ end\{jml_clause:} ,
    %morecomment=[s][\color{javadoc_comment_color}]{/**}{@*/},
}

% minimizar fragmentado de listados
\lstnewenvironment{listing}[1][]
   {\lstset{#1}\pagebreak[0]}{\pagebreak[0]}

\lstdefinestyle{script}{basicstyle=\scriptsize\tt} 

\lstdefinestyle{console}
   {basicstyle=\scriptsize\bf\ttfamily,
    backgroundcolor=\color{gray75},
   }

   % some user defined colors
\definecolor{gray97}{gray}{.97}
\definecolor{gray85}{gray}{.85}
\definecolor{gray75}{gray}{.75}
\definecolor{gray45}{gray}{.45}
\definecolor{gray35}{gray}{.35}
\definecolor{gray20}{gray}{.20}
\definecolor{jml_green}{rgb}{0.090,0.500,0.110}
%\definecolor{javadoc_comment_color}{rgb}{0.10,0.40,0.90}
\definecolor{commentcolor}{rgb}{0.1,0.7,0.1}
\definecolor{keywordcolor}{rgb}{0.05,0.09,0.45}

\usepackage{amssymb}
\usepackage{graphicx}

% \bibliographystyle{apalike}  

\pagestyle{plain}

\author{}

% \affil{
% Babel Group\\
% Facultad de Inform\'atica\\
% Universidad Politécnica de Madrid\\
% 28660 Boadilla del Monte, Madrid, SPAIN \\
% {\tt\{rnnalborodo, aherranz, jmarino\}@fi.upm.es}
% }
\begin{document}

\begin{titlepage}
  \begin{center}
    \huge \sc
    \noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
    Shared Resource Code Generation
    \noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
    \global\let\newpagegood\newpage
    \global\let\newpage\relax
  \end{center}
\end{titlepage}
\global\let\newpage\newpagegood


\section{ JCSP Code Templates}

\subsection{OnDemand\label{app:ondemand_template}}

\input{ondemand_complete}

\subsection{Deferred Request\label{app:deferred_requests_template}}
\input{deferred_requests_complete}

\end{document}  

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% TeX-PDF-mode: t
%%% ispell-local-dictionary: "american"
%%% End: 
% 