# How can make fancy title box in header or contact info in footer?

I'm working on a single page research proposal ads/template. I want to include contact info and logo in the footer and topic in fancy rectangular/boxes or using between text box (one with a bit transparent color) in the header as a title if it is possible. So far, the output & expected form are as follows:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[left=0.5in,right=0.5in,top=0.05cm,bottom=2cm]{geometry}
\usepackage{crop,graphicx,amsmath,array,color,amssymb,flushend,stfloats,amsthm,chngpage,times,fancyhdr,lipsum,lastpage}

\pagestyle{fancy}

\fancypagestyle{plain}{%
\fancyhf{}%
\fancyfoot[R]{Page \bf\thepage\ \rm of \bf\pageref{LastPage}}%
}

%%%% Customise Titles and Headers: %%%%
\title{Title}
\date{\today}

\fancyhf{}
\fancyfoot[R]{Page \bf\thepage\ \rm of \bf\pageref{LastPage}}

\begin{document}

%%%%%%%%%%%% Make Title and Format Lines %%%%%%%%%%%%
\maketitle                                          %
\vspace{-112px}                                     %
\noindent\rule{\linewidth}{1pt} \par                %
\vspace{100px}                                      %
\vspace{-20px}                                      %
\noindent\rule{\linewidth}{1pt} \par                %
\vspace{10px}                                       %
%%%%%%%%%%%%%%%%%%% Insert Logos %%%%%%%%%%%%%%%%%%%%
\vspace{-85px}                                      %
\noindent                                           %
\begin{minipage}{0.5\textwidth}\begin{flushleft}    %
\hspace{20px}                                       %
%\includegraphics[scale = 0.06]{Resources/UoB}      %
\end{flushleft}\end{minipage}                       %
\begin{minipage}{0.5\textwidth}\begin{flushright}   %
\includegraphics[scale = 0.06]{Resources/UoB}       %
\hspace*{20px}                                      %
\end{flushright}\end{minipage}                      %
\vspace{20px}                                       %

%Insert Body Text Here

\section{Background}

\lipsum[10]

\section{Objectives}

\lipsum[10]

\section{Deliverables}

\lipsum[10]

\section{Requirements}

\lipsum[10]

\section{Contacts}

\lipsum[10]

\end{document}



I checked this post and this post but sadly wasn't my case.

I was wondering if there is an elegant way to fix it. Any helps will be appreciated.

Is this what you expect ?

Only one page

More than one page, Contact info only in the last page.

You requested a template and gave some guidelines, with a graphic example. That means it will be used multiple times, with different content.

Therefore, the designer must allow changes to the content data provided, in addition to some minor changes to the graphic design, and desirably empower the end user to perform the final fine-tuning without further consulting with experts.

I found that xcoffin is the best option for these cases. It emulates a graphic design program: it puts the stuff (text, tables, figures, etc) into specials boxes and then join the boxes using predefined points of the boxes like [l,t] (left top corner and so on) plus adding X and Y offsets as needed.

The important points are that (1) the assembly is done using the relative positions of the boxes with respect each other and (2) the graphic design its separated from the content, thus changes in one does not alter the other.

xcoffin itself was design with simplicity in mind. There are few commands and it is easy to learn. Just follow the example. https://ctan.org/pkg/xcoffins?lang=en

The header is composed by five boxes: 2 lines, two rectangles and the title. All will collected by a frame using their relative positions

The footer uses four boxes, a rule, a figure, the contact data and the address data. Again they will collected in a frame.

The first task is filling the boxes with the content. The text part it is done like any LaTeX paragraph. Other boxes include figures or more complex objects.

I choose to add the rectangles using tcolorbox because it is easy to set up the rectangles or comment or change some specs by the end user, and also because it provides the transparency required.

To allow for maximum use of the pages I included geometry. Note that the header and the footer extend 10mm towards the margins while the text is narrower and centered.

Instead of typing the content of the proposal into the template it will be best write it in a separate file, from Background to Requirements, and then input the file with, lets say, \input{proposal2021.tex}.

This is the code

\documentclass[11pt]{article}

\usepackage{graphicx}

\usepackage{kantlipsum} % dummy text
%\usepackage{showframe}  %added for testing page geometry

\usepackage[many]{tcolorbox}

\NewCoffin\Hframex
\NewCoffin\Hthickrulex
\NewCoffin\Hthinrulex
\NewCoffin\HDarkGreenx
\NewCoffin\HLightGreenx
\NewCoffin\HTextx

\NewCoffin\Fframex
\NewCoffin\Flogox
\NewCoffin\Fleftx
\NewCoffin\Fcenterx

\begin{document}

\SetHorizontalCoffin\Hframex{\rule{\textwidth+20mm}{0mm}}  % collector frame for header

\SetVerticalCoffin\HTextx{\textwidth}{% Title
\color{white}\fontsize{20pt}{24pt}\selectfont
\centering\bfseries\sffamily\noindent
Research Project title \medskip\\
\fontsize{14pt}{18pt}\selectfont
(Proposal for a master Project) \medskip \\
WS2020/21
}

\SetHorizontalCoffin\HDarkGreenx{% Back darker green rectangle
\begin{tcolorbox}[
width=\textwidth+10mm,
arc=4pt,
height=9em,
boxsep=0cm,
toprule=0.2pt,
leftrule=0.2pt,
bottomrule=0.2pt,
rightrule=0.2pt,
colback=green!55!blue!70,
colframe=green]
\end{tcolorbox}%
}

\SetHorizontalCoffin\HLightGreenx{% light green transparent rectangle
\begin{tcolorbox}[
width=\textwidth+10mm,
arc=1mm,
height=9em,
boxsep=0cm,
toprule=0.2pt,
leftrule=0.2pt,
bottomrule=0.2pt,
rightrule=0.2pt,
colback=green!45,
colframe=green,
breakable,
enhanced jigsaw,
%       opacityframe=0.4,
opacityback=0.2,]
\end{tcolorbox}
}

% Filling the footer boxes
\SetHorizontalCoffin\Flogox{% a figure, logo , etc
\includegraphics[height=70pt,width=70pt]{example-grid-100x100pt}
}

\SetHorizontalCoffin\Fframex{\rule{\textwidth+10mm}{0pt}}  % collector frame for footer

\SetVerticalCoffin\Fleftx{0.3\textwidth}{% Contact left side
\sffamily\fontsize{8pt}{10pt}\selectfont\noindent
\textbf{\large Contact}\smallskip\\
\textbf{RESEARCH GROUP IT--ENTREPRENEURSHIP}\\
Prof. Dr.   \\
\\
\begin{tabular}{@{}ll}
\textbf{Email}   & rsgit@gmail.com   \\
\textbf{Website }& www.rsgit.com     \\
\textbf{Phone}   & +49 (0) 4236 0927 \\
\end{tabular}
}

\SetVerticalCoffin\Fcenterx{0.3\textwidth}{% {% Contact centre
\sffamily\fontsize{8pt}{10pt}\selectfont\noindent
\textbf{Institute}\\
Digital Engineering Department, \\
University of  \\ Research Group IT--Entrepreneurship\\
Campus III  Building G-1 \\
Rodolf Str. 162--184 \\
Germany
}

% Asembly of the header five boxes to \Hframex
\JoinCoffins*\Hframex[l,t]\Hthickrulex[l,t](-5mm,14mm)  % (X, Y) offsets
\JoinCoffins*\Hframex[l,t]\HDarkGreenx[l,t](5mm,10mm)
\JoinCoffins*\Hframex[l,t]\HLightGreenx[l,t](-5mm,3mm)
\JoinCoffins*\Hframex[l,t]\HTextx[l,t](0mm,-1mm)
\JoinCoffins*\Hframex[l,t]\Hthinrulex[l,t](-5mm,-34mm)

% Assemply of the footer four boxes to \Fframex
\JoinCoffins*\Fframex[l,t]\Hthinrulex[l,t](-5mm,3mm)    % (X, Y) offsets
\JoinCoffins\Fframex[l,t]\Fleftx[l,t](-5mm,0mm)
\JoinCoffins\Fframex[hc,t]\Fcenterx[l,t](-10mm,0mm)
\JoinCoffins\Fframex[r,t]\Flogox[r,t](5mm,0mm)

%  Put the assembled header on the top of the page, typeset and add space
\noindent\TypesetCoffin\Hframex(-5mm,0mm)\vspace*{35mm}

%%%%%%%%%%%%%%%%%%%%
%%% Document starts here <<<<
%
%%% Perhaps input the data from another file with \input{proposal2021.tex}
%
\section{Background}
1.2 \kant[1-2]
\section{Objetives}
4.7 \kant[4-7]
\section{Deliverables}
7.11 \kant[7-11]
\section{Requirements}
12.14 \kant[12-14]

%% Document ends here <<<<

%%%%%%%%%%%%%%%%%%%%

%  Put the assembled footer at the bottom and typeset
\vfill
\noindent\TypesetCoffin\Fframex(-10mm,0mm)
\end{document}

• Looks promising! The last method fulfils my expectation. Nevertheless @Ivan also designed core task in 2 ways. I appreciate it so +1. Jan 9 at 20:37

Something similar can be achieved in at least two ways.

-1- Since the document is single page, there is no need for a headers or footers.

\documentclass[a4paper]{article}
\usepackage[left=0.5in,right=0.5in,top=0.5cm,bottom=1cm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{lipsum}

\begin{document}

% In a single page document you do not neet page number
\thispagestyle{empty}

\noindent
\begin{tikzpicture}%[overlay,remember picture]
\edef\mylengthA{\dimexpr\textwidth-.5cm\relax}
\draw[fill=teal,draw=none,xshift=5mm,yshift=5mm] (0,0) rectangle (\mylengthA,3);
\draw[fill=teal!50,draw=none,opacity=0.5] (0,0) rectangle (\mylengthA,3)
node[anchor=south west,text width=.8\mylengthA,opacity=1,text=white] at (.9,.9)
{{\bfseries\huge Research Project Title}\\[1ex]
{\Large Proposal for a Master Project}\\
W14937438247};
\end{tikzpicture}

\section{Background} \lipsum[10]
\section{Objectives} \lipsum[10]
\section{Deliverables} \lipsum[10]
\section{Requirements} \lipsum[10]
\section{Contacts} \lipsum[10]

% This will push everything to the bottom
\vfill

\begin{footnotesize}
\begin{minipage}[valign=t]{.35\textwidth}
\textbf{Contact}\\[2ex]
\textbf{xxxxxxxxxxxxxxxxxxxxx}\\
xxxxxxxxxxxxxxxxxxxx\\[3ex]
\end{minipage}\hfill
\begin{minipage}[valign=t]{.35\textwidth}
\textbf{xxxxxxxxxxxxx}\\
xxxxxxxxxxxxxxxxxxxx\\[3ex]
xxxxx\\
xxxxx\\
xxxxx\\
xxxxx\\
\end{minipage}\hfill
\begin{minipage}[valign=t]{.2\textwidth}
\includegraphics[width=3cm,height=3cm]{logo}
\end{minipage}
\end{footnotesize}

\end{document}


-2- If you want to use headers and footers instead, you will need to use something similar to this.

\documentclass[a4paper]{article}
\usepackage[left=0.5in,right=0.5in,top=5.5cm,bottom=4.5cm,
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{lipsum}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\begin{tikzpicture}[overlay,remember picture]
\edef\mylengthA{\dimexpr\textwidth-.5cm\relax}
\draw[fill=teal,draw=none,xshift=5mm,yshift=5mm] (0,0) rectangle (\mylengthA,3);
\draw[fill=teal!50,draw=none,opacity=0.5] (0,0) rectangle (\mylengthA,3)
node[anchor=south west,text width=.8\mylengthA,opacity=1,text=white] at (.9,.9)
{{\bfseries\huge Research Project Title}\\[1ex]
{\Large Proposal for a Master Project}\\
W14937438247};
\end{tikzpicture}
}

\fancyfoot[L]{
\begin{footnotesize}
\begin{minipage}[valign=t]{.35\textwidth}
\textbf{Contact}\\[2ex]
\textbf{xxxxxxxxxxxxxxxxxxxxx}\\
xxxxxxxxxxxxxxxxxxxx\\[3ex]
\end{minipage}\hfill
\begin{minipage}[valign=t]{.35\textwidth}
\textbf{xxxxxxxxxxxxx}\\
xxxxxxxxxxxxxxxxxxxx\\[3ex]
xxxxx\\
xxxxx\\
xxxxx\\
xxxxx\\
\end{minipage}\hfill
\begin{minipage}[valign=t]{.2\textwidth}
\includegraphics[width=3cm,height=3cm]{logo}
\end{minipage}
\end{footnotesize}}

\begin{document}

\section{Background} \lipsum[10]
\section{Objectives} \lipsum[10]
\section{Deliverables} \lipsum[10]
\section{Requirements} \lipsum[10]
\section{Contacts} \lipsum[10-12]

\end{document}


In this latter case, you will have the same header and footer on every page. Therefore you can also use it for multipage documents.

• Thanks for your input. Title part is exactly what I was looking for. It could be better if the title text starts in middle. In the case of multiple pages, is it possible to keep the title section on top of the first page and contact section at the end of the last page? Also for multipage case number of the page should be added. Is it possible to include a horizontal line before starting the contact section? Jan 9 at 17:14
• @Mario Please add /correct your requirements to your question: multiple pages and page numbers where not included not obvious. I would say it was just the opposite Do not worry, it is common to have new ideas while seeing preliminary designs. Just inform the audience. :-) Jan 9 at 20:13