1

I am having trouble creating a header that is a full page stretched figure with text overlaid. Coupling this too with a title that is single column, followed by double column (the latter I have found a solution for, but not the general required format that follows it).

I would basically like to make the following front page template in latex:

enter image description here

It further requires the other pages to just have the full spanned header image (no text) and the page numbers as on the first page. I am hoping there are more savvy tex users that could easily produce the template above.

Please assist.

My attempt at doing this fails terribly - I cannot get the image in the header to span the entire page (noindent fails), nor can I get the Investment Strategy part to be on the right. I am also not getting the toprule ratio neat on the second page - it is too low.

See the code below:

%---------------------------------------------------------------

\documentclass[DIV=calc, paper=a4, twoside, twocolumn]{article}  % A4 paper and 11pt font size

        % Following packages allow huxtable to work:
        \usepackage{titling}
        \usepackage{lipsum}
        \usepackage{siunitx}
        \usepackage{multirow}
        \usepackage{hhline}
        \usepackage{calc}
        \usepackage{tabularx}
        \usepackage{xparse}
        \usepackage{longtable,booktabs}

        \usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
        \usepackage[english]{babel} % English language/hyphenation
        \usepackage[protrusion=true,expansion=true]{microtype} % Better typography
        \usepackage{amsmath,amsfonts,amsthm} % Math packages
        \usepackage{sectsty} % Enables custom section titles
        \usepackage[svgnames, table]{xcolor} % Enabling colors by their 'svgnames'
        \usepackage[hang, normalsize,labelfont=bf,up,textfont=it,up]{caption} % Custom captions under/above floats in tables or figures
        \captionsetup{justification = raggedright, singlelinecheck = false}
        \usepackage{booktabs} % Horizontal rules in tables
        \usepackage{mdframed}
            \usepackage{float}
        \let\origfigure\figure
        \let\endorigfigure\endfigure
        \renewenvironment{figure}[1][2] {
            \expandafter\origfigure\expandafter[H]
        } {
            \endorigfigure
        }

        \let\origtable\table
        \let\endorigtable\endtable
        \renewenvironment{table}[1][2] {
            \expandafter\origtable\expandafter[H]
        } {
            \endorigtable
        }

        \usepackage{multicol}
        \usepackage{adjmulticol}
        %Psec Idios: Adjusted margins...
        \usepackage[margin=2.25cm,bottom=1.05cm,top=-0.18cm, headheight=3.5cm, headsep = 5pt, includefoot, includeheadfoot]{geometry}  
        %\usepackage[margin=2cm,bottom=4cm,top=3cm, includefoot]{geometry}
        \usepackage[none]{hyphenat}
        \usepackage{fancyvrb} % Added for disclaimer text file to be added later
        \usepackage[some]{background}
        \usepackage[round]{natbib}
        \usepackage{hyperref}
        \hypersetup{breaklinks=true,
        bookmarks=true,
        colorlinks=true,
        citecolor=Colorslink,
        urlcolor=Colorslink,
        linkcolor=Colorslink,
        pdfborder={0 0 0}}

        \urlstyle{same} 

        \definecolor{ColorsTitleFlag}{RGB}{25,62,107}
        \definecolor{ColorsSubTitleFlag}{RGB}{191,191,191}
        \definecolor{ColorsTitleBar}{RGB}{238,238,238}
        \definecolor{FrontPageHeader1}{RGB}{242,242,242}
        \definecolor{FrontPageHeader2}{RGB}{0,0,0}
        \definecolor{FrontPageHeader3}{RGB}{25,62,107}
        \definecolor{FrontPageHeaderSide}{RGB}{25,62,107}
        \definecolor{ColorsSection}{RGB}{0,71,107}
        \definecolor{ColorsSubSection}{RGB}{0,71,107}
        \definecolor{ColorsSubSubSection}{RGB}{0,71,107}
        \definecolor{ColorCaptionFont}{RGB}{0,71,107}
        \definecolor{Colorslink}{RGB}{0,71,107}

        \sectionfont{\color{ColorsSection}}
        \subsectionfont{\color{ColorsSubSection}}
        \subsubsectionfont{\color{ColorsSubSubSection}}

        \usepackage{fancyhdr} % Needed to define custom headers/footers
        \pagestyle{fancy} % Enables the custom headers/footers
        \usepackage{lastpage} % Used to determine the number of pages in the document (for "Page X of Total")
        \usepackage[bottom, hang, flushmargin]{footmisc}
        \usepackage{graphicx}
        \usepackage{lipsum}
            \usepackage{setspace}
        \setstretch{1.6}
            \fancypagestyle{firststyle}
        {
        \fancyhead[L]{
        Title 1 \\
        Subtitle
            \vspace{1.7cm}
        }
        \noindent \fancyhead[C]{\includegraphics[width=\paperwidth, height=2cm]{example-image-a} }

        \fancyhead[L]{
        Company Name \\
        Name
            \vspace{1.7cm}
        }

        }

        \fancyhead[C]{
         \noindent \includegraphics[width=\paperwidth, height = 3cm]{example-image-a}cm
            \vspace{1.7cm}
        }
        \fancyhead[L]{
            \bfseries
            \large \color{ColorsTitleFlag}{ Macro Strategy \\ August 2018}
            \vspace{2.25cm}
        }

        \fancyfoot[C]{}
        \fancyfoot[LE,RO]{\color{ColorsSubTitleFlag} \normalsize Page \thepage\ of \pageref{LastPage}} % Left side on Even pages; Right side on Odd pages

        \renewcommand{\headrulewidth}{0.2pt} 
        \renewcommand{\footrulewidth}{0.4pt} % Thin footer rule

        \IfFileExists{upquote.sty}{\usepackage{upquote}}{}


        % ========== HEADERS AND FOOTNOTES

        \setlength{\parskip}{0.8ex plus 1.5ex minus 2.5ex}

        %%% Use protect on footnotes to avoid problems with footnotes in titles
        \let\rmarkdownfootnote\footnote%
        \def\footnote{\protect\rmarkdownfootnote}

        \setcounter{secnumdepth}{3}   % 



        \NewDocumentCommand{\Colorbox}{O{\dimexpr\linewidth-2\fboxsep} m m}{%
            \colorbox{#2}{\makebox[#1][l]{#3}}}

                %----------------------------------------------------------------------------------------
                    % Adding raggedbottom avoids stretching across page if using twopage (as is done by default). See here: https://tex.stackexchange.com/a/10747/79853
                \raggedbottom
                %----------------------------------------------------------------------------------------


                    %----------------------------------------------------------------------------------------
                    %   Declaring figure caption fonts, color and positioning
                %----------------------------------------------------------------------------------------
                    \DeclareCaptionFont{Fnt}{\color{ColorCaptionFont}}

                \captionsetup{
                    position=below,
                    labelfont={bf,Fnt},
                    textfont={normal,Fnt},  % size, then color. Can sub normal for small, e.g.
                    justification=raggedright
                }


                \captionsetup{justification=raggedright,singlelinecheck=false} %    Set size in caption package argument above


                %%% Hard setting column skips for reports - this ensures greater consistency and control over the length settings in the document.

                %% page layout
                %% paragraphs
                \setlength{\baselineskip}{14pt plus 0pt minus 0pt}
                \setlength{\parskip}{12pt plus 0pt minus 0pt}
                \setlength{\parindent}{0pt plus 0pt minus 0pt}
                %% floats
                \setlength{\floatsep}{12pt plus 0 pt minus 0pt}
                \setlength{\textfloatsep}{20pt plus 0pt minus 0pt}
                \setlength{\intextsep}{14pt plus 0pt minus 0pt}
                \setlength{\dbltextfloatsep}{20pt plus 0pt minus 0pt}
                \setlength{\dblfloatsep}{14pt plus 0pt minus 0pt}
                %% maths
                \setlength{\abovedisplayskip}{12pt plus 0pt minus 0pt}
                \setlength{\belowdisplayskip}{12pt plus 0pt minus 0pt}
                %% lists
                \setlength{\topsep}{10pt plus 0pt minus 0pt}
                \setlength{\partopsep}{3pt plus 0pt minus 0pt}
                \setlength{\itemsep}{5pt plus 0pt minus 0pt}
                \setlength{\labelsep}{8mm plus 0mm minus 0mm}
                \setlength{\parsep}{\the\parskip}
                \setlength{\listparindent}{\the\parindent}

                \setlength{\fboxsep}{5pt plus 0pt minus 0pt}

                \usepackage{helvet}
                \renewcommand{\familydefault}{\sfdefault}



        \begin{document}


        \begin{minipage}{\textwidth}{%

        \thispagestyle{firststyle}
        \flushleft
                \fontsize{22pt}{10pt}
                \selectfont{John Doe}\\[2mm]
                \Large\textsc{\textit{Masters in Commerce, Phd}}\\[2mm]
                \fontsize{22pt}{10pt}
                \selectfont{Jane Doe}\\[2mm]
                \Large\textsc{\textit{Masters in Commerce}}\\[2mm]

                \flushright
                \fontsize{22pt}{10pt}
                \selectfont{Investment Strategy}}\\[2mm]
                \normalsize{\today}\\

                \hrule
                \newpage
        \end{minipage}\hfill



                                        %\twocolumn

                        \section*{Introduction} \label{summary}

                        \lipsum
                        \lipsum

                        \end{document}
2
  • 2
    Bounty or not: Could you maybe provide at least some first coding steps from your side? It is general custom on this side that the OP provides a minimal (non-)working example that others can use to provide their answers. Commented Sep 24, 2018 at 19:08
  • 1
    Hi @JasperHabicht, I've now added my code template in the question above. Was hoping someone could provide a fresh take on this problem and not work from my mistakes, but I suppose if that is the convention I am happy to oblige.
    – Nick
    Commented Sep 25, 2018 at 7:13

1 Answer 1

4
+50

Thanks for providing more details! One possible way to put whatever wherever is to use tikz.

\documentclass{article}
\usepackage[margin=1.23in]{geometry}
\usepackage{multicol}
\usepackage{tikz,tikzpagenodes}
\usepackage{eso-pic}
\usetikzlibrary{positioning,calc}
\usepackage{lipsum}
\AddToShipoutPictureBG*{
\begin{tikzpicture}[overlay,remember picture,text=white]
\path let \p1=($(current page.north east)-(current page.north west)$),
\p2=($(current page.north)-(current page text area.north)$)
in node at  ($(current page.north)+(0,-\y2/2)$)
{\includegraphics[width=\x1,height=\y2]{example-image-a}};
\path 
(current page text area.west |- current page.north) coordinate (tl)
rectangle (current page text area.north east) coordinate (br);
\node[font=\huge\bfseries\sffamily,anchor=north west] (mtitle1) 
at ([xshift=5mm,yshift=-5mm]tl){Title};
\node[font=\huge\bfseries\sffamily,anchor=north west] (subtitle)
at ([xshift=5mm,yshift=-15mm]tl){Subtitle};
\node[font=\huge\bfseries\sffamily,anchor=north east] (company) 
at ([xshift=-5mm,yshift=-5mm]tl-|br){Company};
\node[font=\huge\bfseries\sffamily,anchor=north east] (name)
at ([xshift=-5mm,yshift=-15mm]tl-|br){Name};
\end{tikzpicture}%
}
\begin{document}
\noindent
\begin{tikzpicture}
\node[anchor=west,font=\Large\sffamily] (author1){John Doe};
\node[anchor=west,below=1mm of author1,font=\large\sffamily] (desc1){Master in \dots};
\node[anchor=west,below=2mm of desc1,font=\Large\sffamily] (author2){Jane Doe};
\node[anchor=west,below=1mm of author2,font=\large\sffamily] (desc2){Master in \dots};
\node[anchor=east,font=\large\sffamily]
(title1)at([xshift=\linewidth-2mm]author1.west) {Investment strategy};
\node[anchor=east,below=1mm of title1,font=\large\sffamily](date){\today};
\path ([yshift=-3mm]desc2.south);
\end{tikzpicture}

\begin{multicols}{2}
\AddToShipoutPictureBG{
\begin{tikzpicture}[overlay,remember picture,text=white]
\path let \p1=($(current page.north east)-(current page.north west)$),
\p2=($(current page.north)-(current page text area.north)$)
in node at  ($(current page.north)+(0,-\y2/2)$)
{\includegraphics[width=\x1,height=\y2]{example-image-a}};
\end{tikzpicture}%
}
\section{Introduction}
\lipsum[1-12]
\end{multicols}
\end{document}

enter image description here

enter image description here

And here is a version using the twocolumn option of article (rather than using multicol to produce two columns). It took me a while to understand that the tikzpicture needs to go into a group. The output is almost identical to the one above.

\documentclass[DIV=calc, paper=a4, twoside, twocolumn]{article} 
\usepackage[margin=1.23in]{geometry}
\usepackage{tikz,tikzpagenodes}
\usepackage{eso-pic}
\usetikzlibrary{positioning,calc}
\usepackage{lipsum}
\AddToShipoutPictureBG*{
\begin{tikzpicture}[overlay,remember picture,text=white]
\path let \p1=($(current page.north east)-(current page.north west)$),
\p2=($(current page.north)-(current page text area.north)$)
in node at  ($(current page.north)+(0,-\y2/2)$)
{\includegraphics[width=\x1,height=\y2]{example-image-a}};
\path 
(current page text area.west |- current page.north) coordinate (tl)
rectangle (current page text area.north east) coordinate (br);
\node[font=\huge\bfseries\sffamily,anchor=north west] (mtitle1) 
at ([xshift=5mm,yshift=-5mm]tl){Title};
\node[font=\huge\bfseries\sffamily,anchor=north west] (subtitle)
at ([xshift=5mm,yshift=-15mm]tl){Subtitle};
\node[font=\huge\bfseries\sffamily,anchor=north east] (company) 
at ([xshift=-5mm,yshift=-5mm]tl-|br){Company};
\node[font=\huge\bfseries\sffamily,anchor=north east] (name)
at ([xshift=-5mm,yshift=-15mm]tl-|br){Name};
\end{tikzpicture}%
}
\begin{document}
\noindent
\twocolumn[{
\begin{tikzpicture}
\node[anchor=west,font=\Large\sffamily] (author1){John Doe};
\node[anchor=west,below=1mm of author1,font=\large\sffamily] (desc1){Master in \dots};
\node[anchor=west,below=2mm of desc1,font=\Large\sffamily] (author2){Jane Doe};
\node[anchor=west,below=1mm of author2,font=\large\sffamily] (desc2){Master in \dots};
\node[anchor=east,font=\large\sffamily]
(title1)at([xshift=\linewidth-2mm]author1.west) {Investment strategy};
\node[anchor=east,below=1mm of title1,font=\large\sffamily](date){\today};
\end{tikzpicture}}]
\AddToShipoutPictureBG{
\begin{tikzpicture}[overlay,remember picture,text=white]
\path let \p1=($(current page.north east)-(current page.north west)$),
\p2=($(current page.north)-(current page text area.north)$)
in node at  ($(current page.north)+(0,-\y2/2)$)
{\includegraphics[width=\x1,height=\y2]{example-image-a}};
\end{tikzpicture}%
}
\section{Introduction}
\lipsum[1-12]
\end{document}
16
  • Hi @marmot, your example is not sufficient - the title does not span across the full page - and it is a color bar not a figure. Also there is no example of having subsequent pages be in the correct format either. I've now attached my flawed example in the question perhaps as a start for someone able to give a generic example that works.
    – Nick
    Commented Sep 25, 2018 at 7:15
  • @Nick Could you please add the \documentclass to your code?
    – user121799
    Commented Sep 25, 2018 at 12:45
  • I see now when I pasted it, it put document class as part of the comment section (did not create a space). Sorted now! Thanks.
    – Nick
    Commented Sep 25, 2018 at 13:03
  • 1
    @Nick Done. I added \path ([yshift=-3mm]desc2.south);, which adds 3mm of space. If you want to increase the space, just increase this distance.
    – user121799
    Commented Sep 26, 2018 at 11:35
  • 1
    You are a machine. My thanks and my bounty goes to you :)
    – Nick
    Commented Sep 26, 2018 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .