I am trying to draw some of the headers for a document with TikZ inside a fancy custom header, using the following code:
\documentclass[letter,11pt]{article}
\usepackage{tikz}
\usepackage{fancyhdr}
\usepackage{lastpage}
\fancypagestyle{aero450}
{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[C]{
\begin{tikzpicture}[remember picture]
\draw (current bounding box.center) node (__head_c)
[font=\scriptsize]
{HEADER HEADER HEADER};
\end{tikzpicture}
}
}
\pagestyle{aero450}
\begin{document}
TEST TEST TEST
\end{document}
However, either with xelatex, pdflatex or writelatex.com, I get the following error:
Runaway argument?
{ \begin {tikzpicture}[remember picture]
Paragraph ended before \f@ncyhf was complete. <to be read again>
\par l.23 \pagestyle{aero450}
What am I doing wrong? writelatex.com says that I might have forgotten a }, but I am pretty sure that I haven't...
tikzpicture
environment, which is causing the problem.