Page Layoutfancyheadings | Table in Header

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
MickiTEX
Posts: 3
Joined: Sat Jun 23, 2012 10:52 am

fancyheadings | Table in Header

Post by MickiTEX »

Hello everybody,

I've read a lot of stuff about headers and footers now but I just can't get rid of my problem. I want to have a header which is actually a table. Please look at the PDF which displays how it should look like and tell me how to do this in LaTeX.

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{upgreek}
\usepackage[scale=12pt]{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage{geometry}
\geometry{a4paper,left=10mm,right=5mm,top=5mm,bottom=15mm}
\usepackage{fancyheadings}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{
\begin{tabular}{|c|}
\hline
\bf{Bericht über die Sachkundigenprüfung bühnentechnische Einrichtung}\\ Gefahrenanalyse - Arbeitssicherheit - Sachschutz\\
\bf{Barbara - Künkelin - Halle Schorndorf}\\
\bf{12.5.09 - 13.5.09}\\
Prüfgrundlage: GUV - VC1 / BGV C1 in Verbindung mit DIN 56950\\ \hline \end{tabular}}
\begin{document}
...
\end{document}
Thanks for your attention.
Attachments
LikeThisPlease.pdf
That's how the header should look like.
(3.92 KiB) Downloaded 253 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

fancyheadings | Table in Header

Post by localghost »

There are several issues with your code.
  • The fancyheadings package is obsolete. Its direct successor is fancyhdr.
  • The option for the helvet font package is wrong. See the package manual for details. You should get a corresponding error message in the log file (*.log).
  • The length \headheight is too small in this case and needs to be adjusted. There is a corresponding warning in the log file along with a suggestion for adjustment.
  • The header needs to be included into the type area in order to make it visible in the output.
All these issues are corrected in the below code.

Code: Select all

\documentclass[12pt,a4paper,ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  adieresis={ä},
  germandbls={ß},
  Euro={€}
}
\usepackage{babel}

\usepackage[scaled=0.92]{helvet}
\renewcommand*\familydefault{\sfdefault}

\usepackage{geometry}
\geometry{
  left=10mm,
  right=5mm,
  top=5mm,
  bottom=15mm,
  includehead,        % Kopfzeile in Satzspiegel einbeziehen
  headheight=74pt     % Angepasste Höhe der Kopfzeile
}

\usepackage{fancyhdr}
\fancyhf{}
\chead{%
  \begin{tabular}{|c|}\hline
    \textbf{Bericht über die Sachkundigenprüfung bühnentechnische Einrichtung}\\
    Gefahrenanalyse -- Arbeitssicherheit -- Sachschutz\\
    \textbf{Barbara -- Künkelin -- Halle Schorndorf}\\
    \textbf{12.5.09 - 13.5.09}\\
    Prüfgrundlage: GUV - VC1 / BGV C1 in Verbindung mit DIN 56950\\ \hline
  \end{tabular}%
}
\renewcommand*{\headrulewidth}{0pt}
\pagestyle{fancy}

\begin{document}
  \null   % Generates an empty page here
\end{document}
For a deeper understanding of the purpose and capabilities of the involved packages please have a look at their respective mauals.

Alternative packages for page styles:

Thorsten
Attachments
The resulting output of the provided code.
The resulting output of the provided code.
TableHeader.png (12.49 KiB) Viewed 2461 times
Post Reply