# Is there any way of adding my name at the top of each page without fancyhdr

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.

-
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

## 2 Answers

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

\makeatletter
\def\ps@foo{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@evenhead{\thepage\hfil{Your name}\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil{Your name}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\chaptermark\@gobble
\let\sectionmark\@gobble
}
\makeatother


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

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

-
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.

-
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