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'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
2  
Welcome to TeX.sx!. fancyhdr is part of the big TeX distributions. There should be no need to install it manually?! –  cgnieder Feb 3 '13 at 18:34
    
I'm kinda dumb and I'm using Mactex –  user1286390 Feb 3 '13 at 18:40
1  
@user1286390 I'd call MacTeX one of the big distributions. Are you sure fancyhdr isn't installed yet? Maybe you should update your version? –  cgnieder 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 2

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:

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

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

 
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.