Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I aim to create a reporting template for other TeX users to use at our work. My objective is creating an .sty file. The specifications are fairly simple but one is causing grief: that is including our logo in the upper left for a header. I've used the fancyhdr program to create a fancyhead like the following:

\RequirePackage{fancyhdr}
\fancypagestyle{everypage}{
    \fancyhf{}
    \fancyhead[R]{\includegraphics{LOGO.JPG}}
  \fancyhead[L]{\huge{Report name} \\ \normalsize{\today}}

  \fancyfoot[L]{XXX}
  \fancyfoot[C]{YYY}
  \fancyfoot[R]{ZZZ}

  \renewcommand{\headheight}{.5in}
  \renewcommand{\textheight}{6in}
}
\pagestyle{everypage}
\AtBeginDocument{\thispagestyle{everypage}}

But when compiling a tex document with this, I get the following error:

[Loading MPS to PDF converter (version 2006.09.02).]
) <LOGO.JPG, id=1, 154.6578pt x 51.0708pt> <use LOGO.JPG>
! You can't use `the character .' after \the.

Any idea what's going on here?

share|improve this question
1  
Werner's answer is good, of course; but also don't set the two lengths as part of everypage; just put the (correct) declarations after the closing brace or use geometry. Your \AtBeginDocument does nothing. –  egreg Sep 24 '12 at 20:37

1 Answer 1

When modifying lengths, use

\setlength{\headheight}{.5in}

not \renewcommand. Also, consider setting document elements affecting the page margins/size via geometry.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.