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.

Can anyone tell me how to center the header and display it only on the first page?

share|improve this question
3  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Benedikt Bauer Dec 22 '12 at 23:47
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Martin Schröder Dec 22 '12 at 23:52
    
Welcome to TeX.sx! This question is very similar to How do I center text in a page heading? Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. –  Martin Schröder Dec 22 '12 at 23:53
3  
Guys easy with the auto-messages :-) –  percusse Dec 23 '12 at 0:22
add comment

1 Answer 1

First, you may use fancyhdr and to apply style only to first page, you may use \thispagestyle.

Example

\documentclass{article}
\usepackage{fancyhdr}
\fancypagestyle{myfancy}{
    \fancyhead{} %% or \fancyhf{}
    \chead{Centered heading}
    \renewcommand{\headrulewidth}{0pt}
}
\begin{document}
\thispagestyle{myfancy}
Hello world
\newpage
Second page
\end{document}

For details, refer to fancyhdr documentation.

share|improve this answer
add comment

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.