%% LaTeX Template for D-papers with inclusion of author-generated manuscript PDF files
%% (c) Copernicus GmbH 2015
%% Version 1.0
%%
\documentclass{article}
\frenchspacing
\usepackage[utf8]{inputenc}
\usepackage[final]{pdfpages}
\usepackage{times}
\usepackage[T1]{fontenc}
\setlength\paperwidth{210mm}
\setlength\paperheight{277mm}
\pdfpagewidth\paperwidth
\pdfpageheight\paperheight
\setlength\textwidth{177mm}
\setlength\topmargin{\dimexpr15mm-1in}
\setlength\headheight{22mm}
\setlength\headsep{0mm}
\setlength\footskip{0mm}
\setlength\oddsidemargin{\dimexpr16.4mm-1in}
\parindent0mm
\pagestyle{empty}

\makeatletter
\def\ps@empty{%
  \let\@mkboth\@gobbletwo
  \def\@oddhead{%
    \parbox[b][\headheight][t]{\textwidth}{%
      Atmos. Chem. Phys. Discuss., doi:10.5194/acp-2016-943, 2016\hfill
      \setbox\z@\hbox{\includegraphics{ACPD_Logo.pdf}}%
      \@tempdima\dimexpr\ht\z@-8\p@\smash{\lower\@tempdima\box\z@}\break
      Manuscript under review for journal Atmos. Chem. Phys.\\
      Published: 24 November 2016\\
      \copyright\ Author(s) 2016. CC BY 3.0 License.\\[1mm]
      \includegraphics[width=1.5cm]{CreativeCommons_Attribution_License.png}}}%
  \let\@evenhead\@empty
  \let\@oddfoot\@empty
  \let\@evenfoot\@empty}
\makeatother

\begin{document}
\includepdf[pages=-,offset=0mm \dimexpr(-1in-\topmargin-\headheight)/2\relax,width=\paperwidth,height=240mm,keepaspectratio]{cp-2017-100-manuscript-version2}
\end{document}
