4

For various reasons, I need to put my name and title in the header of a LaTeX document. The reason is I have a page limit and need the extra space which is taken up by \maketitle. Does anyone know how to do this? For reference, I am using the standard amsart document class.

What I have tried so far is to use the package fancyhdr and then writing

\pagestyle{fancy}
\headheight=14pt

\fancyhf{}

\lhead{name}
\rhead{title}

in the preamble, but I cannot get the header to appear on the first page (the desired header appears on subsequent pages). Does anyone have any suggestions?

3

Including \thispagestyle{fancy} adds the title to the first page:

enter image description here

Notes:

  • The lipsum package was used just to provide dummy text. It is not needed in your document.

Code:

\documentclass{amsart}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
\headheight=14pt

\fancyhf{}

\lhead{name}
\rhead{title}
\thispagestyle{fancy}

\begin{document}
\lipsum[1-10]
\end{document}
  • Thank you very much, this worked! May I ask what the purpose of \thispagestyle{fancy} is? – student555 Nov 6 '12 at 1:48
  • That'll teach me not to guess at solutions!! :-) I don't know for sure, but would guess (opps, here I go again) that the page style is set to plain initially so that the header/footer does not show up on the title page (which is normally the desired behavior). – Peter Grill Nov 6 '12 at 1:59
  • Thank you. But I found my page numbers are correspondingly missed! – Megadeth Oct 3 '14 at 3:14
  • @Comeseeconquer: I am not sure if you are asking a question. If so, please post a new question. If this solution worked for you then you should give feedback clicking the 'up' arrow you can see above each answer's score. – Peter Grill Oct 3 '14 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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