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 am using the book.cls and I want that the page number of the first page (only the first page) of every chapter be at the bottom and on the right. And page numbering of the other pages remain intact.

Here is my .tex file: ‎

\documentclass[11pt,a4paper,‎twoside]{book}‎‎
‎\usepackage{lipsum}‎‎‎‎
‎\usepackage{fancybox,‎fancyhdr}‎
‎\pagestyle{fancy}‎
‎\renewcommand{\chaptermark}[1]{%‎
        ‎\markboth{#1}{}}‎
‎\renewcommand{\sectionmark}[1]{%‎
        ‎\markright{\thesection\ #1}}‎
‎\fancyhf{} 
‎\fancyhead[LE]{\small\leftmark‎}‎
‎\fancyhead[RO]{\small\rightmark‎}‎
‎\fancyhead[RE,LO]{\textbf{\thepage}}‎
‎\renewcommand{\headrulewidth}{0pt}‎
‎\renewcommand{\chaptermark}[1]{%‎
‎\markboth{\thechapter\ #1}{}}‎
‎\renewcommand{\sectionmark}[1]{\markright{\thesection\ ‎#1}}‎‎‎
‎\begin{document}‎‎
‎\chapter{Chapter‎ ‎one}‎‎
‎\section{Section‎ ‎one‎‎}‎‎
‎\lipsum[1-‎10‎‎‎]‎‎
‎\end{document}‎‎

How can I do this?

share|improve this question
    
I think that probably this question would not have been answered if the fancyhdr manual have been carefully read. –  Alessandro Cuttin Oct 21 '10 at 10:33
add comment

2 Answers

up vote 2 down vote accepted

Use the titlesec package's \assignpagestyle to set the page style for \chapter. Something like this.

\usepackage{titlesec}
\newpagestyle{chapterpage}{\setfoot{}{}{\thepage}}
\assignpagestyle\chapter{chapterpage}

Edit: Now that you've added a sample, I know that you're using fancyhdr so the solution is simple:

\fancypagestyle{plain}{
    \fancyhead{}
    \fancyfoot[R]{\textbf{\thepage}}
}
share|improve this answer
    
@TH: Thanks, but your solution doesn't work. In fact, the result is terrible. Because your code typesets "1 Chapter One" in the footer (and also in the header) as well. –  Malek Oct 20 '10 at 17:55
1  
@Malek: It worked just fine. You neglected to mention what you were actually doing. Now that you've done so, I've edited my answer to provide a simple solution. –  TH. Oct 20 '10 at 22:04
    
@TH: Thanks very much for your reply. Now it is exactly what I need. –  Malek Oct 21 '10 at 8:56
add comment

I assume that you want the first page of evey chapter to have the same layout of the other pages, correct? And probably you are using fancyhdr, isn'it?

If so, maybe this can help you. Otherwise, you can redefine the layout of plain (the style invoked for every \chapter command) pages like this:

\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[R]{\thepage} % except the right
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

taken from page 8 of fancyhdr user manual.

share|improve this answer
    
"I assume that you want the first page of evey chapter to have the same layout of the other pages, correct?" No! I just want the number of first page of every chapter (only this page) be at the bottom and on the right. Please see my code above. –  Malek Oct 20 '10 at 17:44
    
I answered your question when there wasn't a line of example code, that's the reason of my assumptions. Again, the answer to your question is in page 8 of the fancyhdr user manual. Probably you should have read the documentation instead of posting the question. –  Alessandro Cuttin Oct 21 '10 at 10:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.