General ⇒ Custom headers impossible ?
Custom headers impossible ?
I just started using Latex, thinking it could be a nice thing to do for my next report hand-in forgetting my classical WYSIWYG software. However, a few minutes into the task and I am already stuck on strange problem. Before even typing the content of report I tried to mimic the cool header I usually use in all my reports - a small box with my name, the name of the professor, the date and the page number.
This simple problem of having a custom header appear on the top of every page proved to be near impossible to solve. I searched the web, googled extensively, ended up reading all the documentation of the "fancyheaders" package only to conclude this would be of no use for my problem.
Fancyheaders gives a bit more freedom on the types of headers used but not at all enough to reproduce my usual header that I have attached as illustration.
Help greatly appreciated.
- Attachments
-
- NiceHeader.pdf
- An illustration of the usual header box I use.
- (150.56 KiB) Downloaded 331 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Custom headers impossible ?
the following could be a good starting point:
Code: Select all
\documentclass{article}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\setlength\headheight{4\baselineskip}
\fancyheadoffset{6em}
\let\headrule\relax
\chead{
\begin{tabular}{|p{7cm}|p{5cm}@{}p{2cm}|}
\hline
\textbf{Student:} Bob Smith \newline
\textbf{Professor:} Pierre Muller \newline
Life Sciences Faculty &
\textbf{Homework hand-in} \newline
7 november 2008 \newline
Page \thepage\ of \pageref{LastPage} &
LOGO \\
\hline
\end{tabular}
}
\begin{document}
\lipsum[1-10]
\end{document}
Custom headers impossible ?
Although I do have a little problem when adding the logo. When replacing the line "LOGO //" with the includegraphics commands as is shown here:
Code: Select all
\chead{
\begin{tabular}{|p{7cm}|p{5cm}@{}p{3.5cm}|}
\hline
\textbf{Student:} Bob Smith \newline
\textbf{Professor:} Pierre Muller \newline
Life Sciences Faculty &
\textbf{Homework hand-in} \newline
7 november 2008 \newline
Page \thepage\ of \pageref{LastPage} &
\includegraphics[height=15mm]{epfl.png} \\
\hline
\end{tabular}
}
(See attachement)
Any ideas ? Thanks.
- Attachments
-
- Before after replacing the "LOGO" line
- AddingLogo.png (124.56 KiB) Viewed 4198 times
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Custom headers impossible ?
Stefan
Custom headers impossible ?
In the log file, up to now, you surely have a warning like this:
Code: Select all
Package Fancyhdr Warning: \headheight is too small (48.0pt):
Make it at least 71.94328pt.
Re: Custom headers impossible ?
You made be feel like pursuing LaTeX and making more reports using it !
Cheers !