I'm trying to write a document class in which the header of the first page has a table. The header of the following pages should have another table.

Well, I solved this problem in the .tex file (user file). However, I would like to take this solution to a class file to avoid damages in the code by less experienced users.

Here is how I solved it in the .tex file.

    % Pagestyle for all pages but the first one
      \fancyhf{} % clear all headers and footers
     \headsep=25pt   %25pt normal
     \textheight=23.2cm %609pt normal
     \footskip=40pt  %30pt normal
      \chead{\begin{tabular}{|c|>{\centering\arraybackslash}m{10.8cm}|c|c|}                          \hline
     \multirow{4}{*}{\parbox[c]{4em}{\includegraphics[width=1.6 cm, height=1.6 cm]{logo.png}}}
     & \multirow{4}{*}{\small\textbf{NIT-\@divisao-\@nonorma}} &  &\\
     & & \multirow{2}{*}{\vspace{4em}\small\textbf{REV. N$^o$}} &
     & & \multirow{2}{*}{\small\textbf{\@nrevisao}} & 
     & & & \\


    % Pagestyle for the first page
      \fancyhf{} % clear all headers and footers
    \headheight=2cm  %12pt normal
    \headsep=25pt   %25pt normal
    \multirow{4}{*}{\parbox[c]{4em}{\includegraphics[width=1.6 cm, height=1.6 cm]{logo.png}}}
     & \multirow{4}{*}{\parbox[c]{8cm}{\small\textbf{\@titulonit}}} &     \textbf{Norma N$^o$} &
    \textbf{REV.N$^o$} \\ 
     & & \small\textbf{NIT-\@divisao-\@nonorma} & \small\textbf{xx} \\    \cline{3-4}
     & & \small\textbf{APROVADA} & \small\textbf{P\'AGINA} \\
     & & \small\textbf{EM \@dataaprov} &     \small\textbf{\thepage/\pageref{LastPage}}\\ \hline

I would appreciate if anyone could give me a hint on how to make it work on a header. Can I use the same code with \newcommand?

closed as unclear what you're asking by Joseph Wright Nov 1 '14 at 21:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    \pagestyle{fancy} does not take an argument: your code for normal pages appears in a group and so it's forgotten. You shouldn't be setting \headheight and \textheight as part of a page style: \headheight should have the same value for all pages. – egreg Sep 2 '13 at 13:18
  • Can you post the whole solution of your .tex-manuscript? – Ruben Sep 10 '13 at 12:57