I'm trying to make my personal code for a report template. I would have the logo of the company only in the first page and maintain the header and footer in the rest of the document.


\setlength\headheight{33pt} %% just to make warning go away. Adjust the value after looking into the warning.
\usepackage{fancyhdr, lastpage}


\rhead{\footnotesize\bfseries{\pbox[b]{\textwidth}{\color{gray}xxx\\ xxx}}}


   to\headwidth{\color{red}\leaders\hrule height 


I can't understand where I'm wrong. Please help me!

  • 1
    Welcome to TeX.SE! Please -- as usual here -- make your given code snippet compilable. Then we can simply copy your code and test it on our own computer. As it stands now we have to guess what you are doing ... – Mensch Oct 11 '18 at 16:07
  • 1
    I shared it in the brackets. It is not visible? – Lorenzo D'Eleuterio Oct 12 '18 at 6:18
  • 1
    You missunderstood me: the given code is not complete, for example \begin{document} is missing. To be able to test what you are doing with guessing we need an complete, compilable TeX code, called MWE (minimal working example) ... – Mensch Oct 12 '18 at 12:12

For a single page, I use tikzpagenodes. Actually, I avoid fancyhdr as much as possible. It has some nasty habits.

Remember to run this twice.

\usepackage[T1]{fontenc}% why do people use XeLaTeX fonts in MWEs?


\usepackage{lipsum}% MWE only

\begin{tikzpicture}[remember picture,overlay]
  \node[above right, inner sep=0pt] at (current page header area.south west)
  \node[above left, inner sep=0pt] at (current page header area.south east)
    {\footnotesize\bfseries{\pbox[b]{\textwidth}{\color{gray}xxx\\ xxx}}};

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.