# How to make fancyhdr examples work

In the Train­ing slides, with ex­am­ples of the fancyhdr resources there's an example which unfortunately doesn't work or is poorly documented. According to http://mirrors.ctan.org/info/german/fancyhdr/fancyfolien+bsp.pdf (page after 17)

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\begin{tabular}[b]{l}
Beispielezu\texttt{fancyhdr}\\
HansFriedrichSteffani\\
LehrstuhlElektr.Masch.u.Antriebe
\end{tabular}
\includegraphics[height=3\baselineskip]{tulogo}
}
\includegraphics[height=3\baselineskip]{tulogo}
\begin{tabular}[b]{l}
Beispielezu\texttt{fancyhdr}\\
HansFriedrichSteffani\\
LehrstuhlElektr.Masch.u.Antriebe
\end{tabular}
}

\begin{document}
\maketitle
\begin{abstract}
\end{abstract}

\section{}

v
\end{document}


should work, but it only compiles with one text for one page on which the header is not displayed (picture tulogo is present), \lipsum[1-20] doesn't work neither.

• This is not a minimal working example. There's no \title command, no \author command, there's an \includegraphics command but by don't load the graphicx package. I'm afraid you won't find many people who're willing to fix this for you.
– user10274
May 17, 2014 at 12:59

It works OK here, as does \lipsum. Of course, as Marc van Dongen pointed out, you need to load graphicx. If you want to see the different headers, you also want twoside as a class option. I don't have tulogo so I used some images from mwe.

\documentclass[a4paper,10pt,twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr,graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\begin{tabular}[b]{l}
Beispielezu\texttt{fancyhdr}\\
HansFriedrichSteffani\\
LehrstuhlElektr.Masch.u.Antriebe
\end{tabular}
\includegraphics[height=3\baselineskip]{example-image-a}
}
\includegraphics[height=3\baselineskip]{example-image-b}
\begin{tabular}[b]{l}
Beispielezu\texttt{fancyhdr}\\
HansFriedrichSteffani\\
LehrstuhlElektr.Masch.u.Antriebe
\end{tabular}
}


Note that \maketitle will not use the standard page style on the page with the title. The assumption is that you will not want a header on the title page since you'll have, well, the title. And as Marc van Dongen also pointed out, \maketitle will cause errors if you have not specified anything for it to make the title with.
• @KarlRichter I agree that the errors were somewhat misleading in this case. The most obvious culprit seemed to be \lipsum when \maketitle was the real issue. Scrolling up the output in a console helped to clarify this. (If you are using an editor which doesn't show the console output, it is always worth trying the command line if you are getting weird errors which don't make sense. Kile, at least, which I use is useless in this respect.)