I'd like to reproduce something similar to the Title, Authors/affliation and Date look, position and size of the cpi report as in https://www.overleaf.com/latex/templates/climate-policy-initiative-report-template/kjfjzrcjgtqg

But the cpi.sty is missing from overleaf.

1- How do they modify the title size/font/position and that of the Authors? 2- What about the background rectangles (in orange and gray on the side)

Thank you

  • For the 1st question (position and font sizes), you should take a look at the titling package, which provides a number of tools for that. – Bernard May 16 '19 at 8:38

The cpi.sty file can be downloaded from overleaf, it is in the cpistuff folder:

enter image description here

\usepackage{color} %include colors
\usepackage[T1]{fontenc} %include font support
\usepackage{lmodern} %make fonts look better
%\usepackage{garamond} %include garamond
\usepackage{helvet} %include helvetica
%\usepackage{xcolor,mdframed,caption} %for the box


\renewcommand{\rmdefault}{ggm} %Set default serif (roman) font
\renewcommand{\sfdefault}{phv} %Set default sans serif font
\renewcommand{\familydefault}{\sfdefault} %Set default font to sans serif - must specify where roman is used

\newgeometry{margin = 1in}
\renewcommand{\frame}[1]{\begin{framed} {\color{black} #1} \end{framed}}

\setlength{\parskip}{1.2ex plus 0.5ex minus 0.2ex}

\lhead{\rmfamily \Title}
\rhead{\rmfamily \Date}
\lfoot{\rmfamily \cpiType}
\rfoot{\rmfamily Page \thepage}

\newgeometry{margin = 0in}
\hfill \colorbox{cpiGray}{\makebox[3.22in][r]{\shortstack[r]{\vspace{2.75in}}}}%
%\hfill \colorbox{cpiGray}{\hspace{.25in} \parbox{2.97in}{\vspace{2.75in}}}%
\colorbox{cpiOrange}{\makebox[8.25in][l]{\hfill \shortstack[r]{\fontsize{36}{36}\rmfamily\color{white} \@title\\%
\fontsize{24}{24}\rmfamily\color{white} \cpiType}}}%
%\hfill \colorbox{cpiGray}{\makebox[3.22in][r]{\shortstack[r]{\vspace{4in} \color{white} \textbf{\@author \\ \\ Climate Policy Initiative San Francisco \\ \\ \today \vspace{2.3in}}}}%
%\hfill \colorbox{cpiGray}{\hfill \begin{minipage}{3.22in} \vspace{3in} \color{white} turtleface \end{minipage}}%
\hfill \colorbox{cpiGray}{\hspace{.25in} \parbox{2.97in}{\vspace{4in} \color{white} \textbf{\@author \\ \\ Climate Policy Initiative San Francisco \\ \\   \today \vspace{2.3in} \vfill}}}%

\lhead{\rmfamily \Title}
\rhead{\rmfamily \Date}
\lfoot{\rmfamily \cpiType}
\rfoot{\rmfamily Page \thepage}
{\Large \color{cpiOrange} Executive Summary}\\ \vspace{12pt}}

  {\parindent \z@ \raggedright \sffamily
    \ifnum \c@secnumdepth >\m@ne
        \large \bfseries \@chapapp\space \thechapter
        \vskip 10\p@
    \Huge \bfseries #1\par\nobreak
    \vskip 20\p@

  {\parindent \z@ \raggedright
    \Huge\bfseries  #1\par\nobreak
    \vskip 20\p@


\@startsection {section}{1}{\z@}%
    {-3.5ex \@plus -0.1ex \@minus -.2ex}%
    {1.2ex \@plus.01ex}%
    {-3.25ex\@plus -0.1ex \@minus -.2ex}%
    {1.2ex \@plus .01ex}%
    {-3.25ex\@plus -0.1ex \@minus -.2ex}%
    {0.2ex \@plus .01ex}%


\newenvironment{framed}% using default \FrameCommand
  {\color{cpiOrange} \MakeFramed {\advance\hsize-\width \FrameRestore}}%

\chardef\FrameRestore=\catcode`\| % for debug
\catcode`\|=\catcode`\% % (debug: insert space after backslash)

 % measure added width and height; call result \width and \height
 \let\width\fb@frw \let\height\fb@frh
 % insert pre-penalties and skips
    \penalty9999 % updates \page parameters
    \ifdim\pagefilstretch=\z@ \ifdim\pagefillstretch=\z@
       % not infinitely stretchable, so encourage a page break here
       \ifx\@tempa\zero@glue \penalty-30
       \else \vskip-\skip@ \penalty-30 \vskip\skip@
    % Give a stretchy breakpoint that will always be taken in preference
    % to the \penalty 9999 used to update page parameters.  The cube root
    % of 10000/100 indicates a multiplier of 0.21545, but the maximum 
    % calculated badness is really 8192, not 10000, so the multiplier
    % is 0.2301. 
    \advance\skip@ \z@ plus-.5\baselineskip
    \advance\skip@ \z@ plus-.231\height
    \advance\skip@ \z@ plus-.231\skip@
    \advance\skip@ \z@ plus-.231\topsep
    \vskip-\skip@ \penalty 1800 \vskip\skip@
 % clear out pending page break
 \penalty\@M \vskip 2\baselineskip \vskip\height
 \penalty9999 \vskip -2\baselineskip \vskip-\height
 \penalty9999 % updates \pagetotal
|\message{After clearout, \pagetotal=\the\pagetotal, \pagegoal=\the\pagegoal. }%
   #1% Modifications to \hsize (can use \width and \height)
   \textwidth\hsize \columnwidth\hsize

     \penalty-100 % put depth into height
  % {\showoutput\showbox\@tempboxa}%

% \fb@put@frame takes the contents of \@tempboxa and puts all, or a piece,
% of it on the page with a frame (\FrameCommand, \FirstFrameCommand,
% \MidFrameCommand, or \LastFrameCommand).  It recurses until all of 
% \@tempboxa has been used up. (\@tempboxa must have zero depth.)
% #1 = attempted framing command, if no split
% #2 = framing command if split
% First iteration: Try to fit with \FrameCommand. If it does not fit,
% split for \FirstFrameCommand.
% Later iteration: Try to fit with \LastFrameCommand. If it does not
% fit, split for \MidFrameCommand.
 \ifdim\pagegoal=\maxdimen \pagegoal\vsize \fi
|   \message{=============== Entering putframe ====================^^J
|     \pagegoal=\the\pagegoal,  \pagetotal=\the\pagetotal. }%
  \dimen@\pagegoal \advance\dimen@-\pagetotal % natural space left on page
  \ifdim\dimen@<2\baselineskip % Too little room on page
|   \message{Page has only \the\dimen@\space room left; eject. }%
    \eject \fb@adjheight \fb@put@frame#1#2%
  \else % there's appreciable room left on the page
|    \message{\string\pagetotal=\the\pagetotal,
|        \string\pagegoal=\the\pagegoal,
|        \string\pagestretch=\the\pagestretch,
|        \string\pageshrink=\the\pageshrink,
|        \string\fb@frh=\fb@frh. \space}
|    \message{Box of size \the\ht\@tempboxa\space + \fb@frh}%
     \begingroup % temporarily set \dimen@ to be...
     \advance\dimen@.8\pageshrink  % maximum space available on page
     \advance\dimen@-\fb@frh\relax % space available for frame's contents
     % expand \ifdim, then restore \dimen@ to real room left on page
     \ifdim\dimen@>\ht\@tempboxa % whole box does fit
|       \message{fits in \the\dimen@. }%
        % Use vsplit anyway to capture the marks
        % !!!???!!! MERGE THIS WITH THE else CLAUSE!!!
     \else % box must be split
|       \message{must be split to fit in \the\dimen@. }%
        % update frame measurement to use \FirstFrameCommand or \MidFrameCommand
        \setbox\@tempboxa\vbox{% simulate frame and flexiblity of the page:
           \vskip \fb@frh \@plus\pagestretch \@minus.8\pageshrink
        \boxmaxdepth\z@ \splittopskip\z@
|       \message{Padded box of size \the\ht\@tempboxa\space split to \the\dimen@}%
        % Split box here
        \setbox\tw@\vsplit\@tempboxa to\dimen@
|       \toks99\expandafter{\splitfirstmark}%
|       \toks98\expandafter{\splitbotmark}%
|       \message{Marks are: \the\toks99, \the\toks98. }%
        \setbox\tw@\vbox{\unvbox\tw@}% natural-sized
|       \message{Natural height of split box is \the\ht\tw@, leaving 
|          \the\ht\@tempboxa\space remainder. }%
        % If the split-to size > (\vsize-\topskip), then set box to full size
|         \message{Frame is big -- Use up the full column. }%
          \advance\dimen@ii -\topskip
          \advance\dimen@ii \FrameHeightAdjust\relax
        \else  % suspect this is wrong:
          % If the split-to size > feasible room_on_page, rebox it smaller.
|           \message{Box too tall; rebox it to \the\dimen@. }%
          \else % use natural size
        % Re-box contents to desired size \dimen@ii
        \advance\dimen@ii -\fb@frh
        \setbox\tw@\vbox to\dimen@ii \bgroup
        % remove simulated frame and page flexibility:
        \vskip -\fb@frh \@plus-\pagestretch \@minus-.8\pageshrink
        \unvbox\tw@ \unpenalty\unpenalty
        \ifdim\lastkern=-137sp % whole box went to next page
|          \message{box split at beginning! }%
           % need work here???
           \egroup \fb@resto@set \eject % (\vskip for frame size was discarded) 
           \fb@put@frame#1#2% INSERTED ???
        \else % Got material split off at the head
           \egroup \fb@resto@set
           \ifvoid\@tempboxa % it all fit after all
|             \message{box split at end! }%
           \else % it really did split
|             \message{box split as expected. Its reboxed height is \the\ht\tw@. }%
                \centerline{#2{\box\tw@}}%  ??? \centerline bad idea
|               \message{Zero width means likely blank. Don't frame it (guess)}%
              \hrule \@height\z@ \@width\hsize

    PackageWarning{framed}{Boxa is void -- discard it. }%
|   \message{Frame and place boxa. }%
|   %{\showoutput\showbox\@tempboxa}%

    \nointerlineskip \null %{\showoutput \showlists}
    \penalty-30 \vskip\topsep \relax

% measure width and height added by frame (#1 = frame command)
% call results \fb@frw and \fb@frh
 \setbox\z@\vbox{\vskip-5in \hbox{\hskip-5in 
   #1{\hbox{\vrule \@height 4.7in \@depth.3in \@width 5in}}}%
|  \message{Measuring frame addition for \string#1 in \@currenvir\space 
|    gives ht \the\ht\z@\space and wd \the\wd\z@. }%
 \global\fb@frw\wd\z@ \global\fb@frh\ht\z@

  \vbox to\FrameHeightAdjust{}% get proper baseline skip from above.
  \penalty\@M \nointerlineskip
  \penalty\@M} % useful for tops of pages



% Provide configuration commands:
\@ifundefined{FrameRule}{\newdimen\FrameRule \FrameRule=\fboxrule}{}
\@ifundefined{FrameSep} {\newdimen\FrameSep  \FrameSep =3\fboxsep}{}

% Height of frame above first baseline when frame starts a page:

% \FrameRestore has parts of \@parboxrestore, performing a similar but 
% less complete restoration of a default layouy.  See how it is used in the 
% "settings" argument of \MakeFrame.  Though not a parameter, \hsize 
% should be set to the desired total line width available inside the
% frame before invoking \FrameRestore.  
   %  \message{FrameRestore:
   %    \@totalleftmargin=\the \@totalleftmargin,
   %    \rightmargin=\the\rightmargin, 
   %    \@listdepth=\the\@listdepth.  }%
   % Test if we are in a list (or list-like paragraph)
   \ifnum \ifdim\@totalleftmargin>\z@ 1\fi  
          \ifdim\rightmargin>\z@ 1\fi
          \ifnum\@listdepth>0 1\fi 0>\z@
     %     \message{In a list: \linewidth=\the\linewidth, \@totalleftmargin=\the\@totalleftmargin,
     %       \parshape=\the\parshape, \columnwidth=\the\columnwidth, \hsize=\the\hsize, 
     %       \labelwidth=\the\labelwidth. }%
     \@setminipage % snug fit around the item
     % Now try to propageate changes of width from \hsize to list parameters.
     % This is deficient, but a more advanced way to indicate modification to text 
     % dimensions is not (yet) provided; in particular, no separate left/right
     % adjustment.
     \advance\linewidth-\columnwidth \advance\linewidth\hsize
     \parshape\@ne \@totalleftmargin \linewidth
   \else % Not in list
     %\message{No list, set \string\linewidth=\the\hsize. }%

Try for example this project: https://www.overleaf.com/project/5cdd2dbc4451c46fe92bb1ed

| improve this answer | |
  • ah, it seems i have no access to it/firewall issues. is it too much to ask to copy it in here? Thank you :) – Courvoisier May 16 '19 at 10:06
  • @Courvoisier Done :) – user189040 May 16 '19 at 14:09
  • brilliant thank you! – Courvoisier May 20 '19 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.