TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm just trying to figure out a way to add my name at the top of each page without using the package fancyhdr, since I'm having problems with the installation of this package.

share|improve this question
What class are you using? What do you have on the header now? – Sigur Feb 3 '13 at 18:34
Welcome to TeX.sx!. fancyhdr is part of the big TeX distributions. There should be no need to install it manually?! – clemens Feb 3 '13 at 18:34
I'm kinda dumb and I'm using Mactex – user1286390 Feb 3 '13 at 18:40
@user1286390 I'd call MacTeX one of the big distributions. Are you sure fancyhdr isn't installed yet? Maybe you should update your version? – clemens Feb 3 '13 at 18:52
@cgnieder When compiling it does not identify the package, so I think that it isn't installed. Furthermore, I have already updated my version. – user1286390 Feb 3 '13 at 19:25
up vote 3 down vote accepted

If you use report/article class, for example, create the page style foo as below. Just copy and paste to your preamble:

    \def\@evenhead{\thepage\hfil{Your name}\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil{Your name}\hfil\thepage}%

Then, load it using \pagestyle{foo} after the document environment.

ps: Don't forget to edit your name on \def\@oddhead and \def\@evenhead.

share|improve this answer
Sorry, but I did not understand the part " load it using \pagestyle{foo}". – user1286390 Feb 3 '13 at 18:44
I'm using article – user1286390 Feb 3 '13 at 18:45
@user1286390, you can use the page style defined loading it with \pagestyle{foo} after the \begin{document}. – Sigur Feb 3 '13 at 18:46
Thanks, it works and sorry for my dumbness. – user1286390 Feb 3 '13 at 18:48
If you are using \maketitle command you could have a problem, but if you have a simple document, it'll work – Sigur Feb 3 '13 at 18:50

You could use the titleps package, included in titlesec. It does essentially the same as fancyhdr, albeit not so powerful.

share|improve this answer
It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Kurt Feb 3 '13 at 18:52

Your Answer


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.