\documentclass[a4paper,12pt]{article}
\usepackage[compact]{titlesec}
\usepackage[hang,flushmargin,stable]{footmisc}
\usepackage[margin=24mm]{geometry}
\usepackage[nohyperlinks,nolist]{acronym}
\usepackage[T1]{fontenc}
\usepackage[usenames,dvipsnames,table]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{enumitem}
\usepackage{eurosym}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{lineno}
\usepackage{lmodern}
\usepackage{lscape}
\usepackage{makecell}
\usepackage{marginnote}
\usepackage{multirow}
\usepackage{pgfgantt}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepgfplotslibrary{polar}
\pgfplotsset{compat=1.12}
\usepackage{pifont}
\usepackage{sectsty}
\usepackage{sidecap}
\usepackage{soul} % for smarter (word-wrapping) underlining
\setul{1pt}{.4pt} % 1pt below contents
\usepackage{wrapfig}
\usepackage{xspace}
% HotFix from http://tex.stackexchange.com/a/300259/84485
% Version1 of titlesec is not compatible with the latest texlive.
% Either the titlesec package must be updated, or the following HotFix used:
\usepackage{etoolbox}
\makeatletter
\patchcmd{\ttlh@hang}{\parindent\z@}{\parindent\z@\leavevmode}{}{}
\patchcmd{\ttlh@hang}{\noindent}{}{}{}
\makeatother
% Fonts
\usepackage{libertine}
\usepackage[scaled=.875]{gillius2}
\usepackage[libertine]{newtxmath}
% Size
\headheight=14pt
\setlength{\parindent}{0pt}
\titleformat*{\section}{\large}
\titleformat*{\subsection}{\normalsize}
\titleformat*{\subsubsection}{\normalsize}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\baselinestretch}{1.0}
% Color
\definecolor{royalblue}{rgb}{0.0, 0.14, 0.4}
\allsectionsfont{\sffamily\bfseries\raggedright\color{royalblue}}
\let\oldfootnotesize\footnotesize
\newcommand{\highlight}[1]{\colorbox{gray!15}{\small{#1}}}
\newcommand{\marginLeft}[1]{\reversemarginpar\marginnote{\rotatebox{90}{\sffamily\bfseries\color{royalblue}\large{\phantom{j}#1}}}}
\newcommand{\marginRight}[1]{\normalmarginpar\hspace{0pt}\marginpar{\rotatebox{0}{\sffamily\color{gray}\normalsize{#1}}}}
\newcommand\colorrule{\vspace{4px}{\color{lightgray}\hrule}\vspace{4px}}
% Bibliography
%\bibliography{bibliography}
%\usepackage[style=chem-acs,doi=false]{biblatex}
% Headers and Footers
\renewcommand{\footnotesize}{\fontsize{8bp}{1em}\selectfont}
\renewcommand{\cite}{\autocite} % citations in footnotes
% Explicitly set footnote font size to match call (i.e., 8pt).
% Taken from http://tex.stackexchange.com/a/249422/84485
\makeatletter
\renewcommand\footnotesize{%
\@setfontsize\footnotesize\@ixpt{8}%
\abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
\abovedisplayshortskip \z@ \@plus\p@
\belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
\def\@listi{\leftmargin\leftmargini
\topsep 4\p@ \@plus2\p@ \@minus2\p@
\parsep 2\p@ \@plus\p@ \@minus\p@
\itemsep \parsep}%
\belowdisplayskip \abovedisplayskip
}
\makeatother
\hypersetup{
pdftitle={H2020-MSCA-IF-2020}, % title
pdfauthor={},
colorlinks=true,
citecolor=black,
linkcolor=black,
urlcolor=blue
}
% To correctly align fancy headers.
% Courtesy of: http://tex.stackexchange.com/a/88136/84485
\makeatletter
\newcommand{\resetHeadWidth}{\f@nch@setoffs}
\makeatother
% Headers and Footers - specify Abrr and ProjectCode
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[C]{\small \color{gray}{\sffamily Abrr}}
\fancyfoot[L]{\small \color{gray}{\sffamily Marie Sk\l{}odowska-Curie Postdoctoral Fellowship -- ProjectCode}}
\fancyfoot[R]{\small \color{gray}{\sffamily \thepage~of \pageref*{sec:textend} [B-1]}}
\resetHeadWidth
\begin{document}
\include{B1}
\end{document}