0

I'm trying to insert the contact information in the top-left position of the page (article class) and above the title. Here my example code.

\documentclass[a4paper,oneside,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr, graphicx}
\usepackage{geometry}
\geometry{a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm,heightrounded,bindingoffset=5mm,headheight=5cm, voffset=1cm}
\usepackage[english]{babel}

\begin{document}

\fancyhead[R]{\includegraphics[width=4cm]{Images/logo.png}}

\pagestyle{plain}


\vspace{9cm}
\title{\textbf{Title}}

\maketitle

\thispagestyle{fancy}

Bla bla bla.

\end{document}

The result is this one: enter image description here

And this is what I would like to achieve:

enter image description here

Thank you all for any kind of help!

2 Answers 2

1

A possible solution modifying the \@maketitle command via the etoolbox package:

\documentclass[a4paper,oneside,12pt,notitlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm,heightrounded,bindingoffset=5mm,headheight=5cm, voffset=1cm}
\usepackage[english]{babel}

\fancyhead[R]{\includegraphics[width=4cm]{Images/logo.png}}

\newcommand{\contactinfo}{%
  \noindent 
  Contact informations:\\
  Lorem ipsum 345-443-2342\\
  [email protected]\\
  tel. 345/1234567}

\title{The Title}
\author{Lorem Ipsum}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@maketitle}
  {\vskip 2em}
  {\vskip-1cm{\raggedright\contactinfo\vspace{1cm}}}
  {}
  {}
\makeatother

\begin{document}

\maketitle
\thispagestyle{fancy}
  
\lipsum
  
\end{document}

Without etoolbox you need this:

\makeatletter
\def\@maketitle{%
  \newpage
  \null
\vskip-1cm
{\raggedright\contactinfo}
\vspace{1cm}
  \begin{center}%
    \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\makeatother

enter image description here

2

A solution with tikz. You can play with lengths to fit your needs.

\documentclass[a4paper,oneside,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr, graphicx}
\usepackage{geometry}
\geometry{a4paper,top=3cm,bottom=3cm,left=1.5cm,right=1.5cm,heightrounded,bindingoffset=5mm,headheight=5cm, voffset=1cm}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\begin{document}
    
    \fancyhead[R]{\includegraphics[height=1cm]{example-image-a}}
    
    \pagestyle{plain}
    
%   \vspace{9cm}
    \title{\textbf{Title}}
    
    \maketitle
    
    \begin{tikzpicture}[overlay, remember picture, outer sep=0pt, inner sep=1ex]
    \node [draw, thick, anchor=north west] at ($(current page.north)-(.5*\textwidth-1ex, \headheight)$){\parbox{3cm}{Nom:\\ Prénom:\\Mél:}};
    \end{tikzpicture}
    
    \thispagestyle{fancy}
    
    Bla bla bla.
    
\end{document}

enter image description here

3
  • 1
    Check out tikspagenodes and (current page text area.north west). Commented Jan 28, 2021 at 13:37
  • @JohnKormylo Thanks: another usefull package! However, with the given preamble, the node (current page text area.north west) is above the headrule. How can I fix that? (Maybe another question?)
    – NBur
    Commented Jan 28, 2021 at 15:18
  • I find: it's due to the voffset option
    – NBur
    Commented Jan 28, 2021 at 15:55

You must log in to answer this question.

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