I'm currently writing a latex code generator to make invoices and I have a problem with my headers. I'm using fancy headers to make my headers and I'm using the output of the compiler to set the height of the header and the text. My problem is that my header is not at the same position on the first and the second page. It is higher on the first page and I don't find any solution to this problem.
Here is the code :
\documentclass[a4paper]{article}
% setting language
\usepackage[frenchb]{babel}
% geometry --> margin ++
\usepackage[includeheadfoot]{geometry}
\geometry{a4paper,margin=1cm}
\usepackage{tabularx}
\usepackage{booktabs}
%\usepackage[absolute,overlay]{textpos}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\usepackage{lipsum}
\fancyhead[L]{
\renewcommand{\arraystretch}{1}
\raisebox{0\height}{
\begin{tabular}{p{4.99cm}l}
Left part
&
Right part
\\
\end{tabular}
}}
\fancyhead[R]{ \vtop{\begin{tabular}{l} \textbf{Devis n° 5}\\\textbf{Original}\\Page \end{tabular}}}
\fancyfoot[C]{\textbf{Masidaso Consulting - N° TVA :BE0834757576}\\}
\setlength{\headheight}{64pt}
% début du corps
\begin{document}
\parskip=0pt\parindent=0pt
\renewcommand{\arraystretch}{1.4}
\begin{tabularx}{\linewidth}{!{\VRule[2pt]}X!{\VRule[2pt]}X!{\VRule[2pt]}X!{\VRule[2pt]}} \specialrule{2pt}{0pt}{0pt} Client & Intelocuteur & Page \\ \specialrule{2pt}{0pt}{0pt} 2 - Minou Chat & Mr le vendeur & page \\ \specialrule{2pt}{0pt}{0pt} \end{tabularx}
\lipsum
\lipsum
\renewcommand{\arraystretch}{1}
\end{document}
\thispagestyle{fancy}after\begin{document}but before anything else is set. – barbara beeton Jan 13 '12 at 15:28lipsumpackage. – doncherry Jan 13 '12 at 17:27