3

I need to setup page number right side of the footer. It's ok in the second page of a chapter.

But in chapter title page, page number showing in the center of that page.

This is my MWE:

\documentclass[a4paper,12pt]{report}
\usepackage[left=1.5in,right=1in,top=1in,bottom=1in,includefoot,heightrounded]{geometry}
\usepackage{lipsum} 
\usepackage{fancyhdr}
\renewcommand{\baselinestretch}{1.3}
\usepackage{titlesec}

\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{0pt}{1cm}

\begin{document}
\begin{center}
{\huge \textbf{ Abstract}}
\end{center}
\addcontentsline{toc}{section}{Abstract}
\lipsum[2-4]
\pagenumbering{roman}
\pagestyle{fancy}
\fancyfoot{}
\fancyfoot[R]{\thepage}

\fancyhead[L]{\textit{\chaptername\thechapter}}

\chapter{Introduction}

\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-4]
\lipsum[2-4]
\end{document}

Please tell me the solution.

4
  • Unrelated: do you really want to have Chapter 1 on both sides of the header?
    – Bernard
    Mar 31, 2019 at 16:51
  • No. I don't need that . Acutally i need chapter 1 in left and chapter name such as Introduction on right. But this is not the problem for me.
    – Alamin
    Mar 31, 2019 at 16:56
  • Add \thispagestyle{fancy} after of \chapter{...}
    – skpblack
    Mar 31, 2019 at 17:00
  • With your code, you obtain Chapter1 on the left and CHAPTER 1 INTRODUCTiON on th right
    – Bernard
    Mar 31, 2019 at 17:07

2 Answers 2

2

Since you load titlesec, it's much simpler to load it with option pagestyles and use titleps. You have to redefine the plain page style, which is used in the first page of a chapter. Redefining a page style is particularly easy with titleps:

\documentclass[a4paper,12pt]{report}
\usepackage[left=1.5in,right=1in,top=1in,bottom=1in,includefoot,heightrounded]{geometry}
\usepackage{lipsum}

\renewcommand{\baselinestretch}{1.3}
\usepackage[pagestyles]{titlesec}
\newpagestyle{mine}{%
\headrule
\sethead{\itshape\chaptername\thechapter}{}{\itshape\chaptertitle}
\setfoot{}{}{\thepage}}%

\renewpagestyle{plain}{%
\setfoot{}{}{\thepage}}%

\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{0pt}{1cm}
\pagenumbering{roman}
\pagestyle{mine}
\begin{document}

\chapter{Introduction}

\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-10]

\end{document} 

enter image description here

4
  • It works fine. But facing another problem when i add another page before chapter such as Abstract page, it is showing chapter 0 in the heading. I don't need that. I have update MWE please check.
    – Alamin
    Mar 31, 2019 at 17:42
  • Will your real abstract fit on a single page?
    – Bernard
    Mar 31, 2019 at 17:55
  • Yes. only in single page
    – Alamin
    Mar 31, 2019 at 18:00
  • 1
    Why don't you use \chapter{Abstract} in this case? It would use the redefined plain page style.
    – Bernard
    Mar 31, 2019 at 18:16
5

You need to redefine the page style plain used on the chapter title page like:

\fancypagestyle{plain}{% <==============================================
  \fancyhf{}
  \fancyfoot[R]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}%
}

With the complete code

\documentclass[a4paper,12pt]{report}

\usepackage[%
  left=1.5in,right=1in,top=1in,bottom=1in,
  includefoot,heightrounded
]{geometry}
\usepackage{lipsum} 
\usepackage{fancyhdr}
\renewcommand{\baselinestretch}{1.3}
\usepackage{titlesec}

\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{0pt}{1cm}

\fancypagestyle{plain}{% <==============================================
  \fancyhf{}
  \fancyfoot[R]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}%
}

\begin{document}
\pagenumbering{roman}
\pagestyle{fancy}
\fancyfoot{}
\fancyfoot[R]{\thepage}

\fancyhead[L]{\textit{\chaptername\thechapter}}

\chapter{Introduction}

\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-4]
\lipsum[2-4]
\end{document}

you get:

enter image description here

Update:

To add an chapter/abstract before chapter 1 please change your used code to:

%\begin{center} % <======================================================
\chapter*{Abstract} % <============================= usualy not numbered!
%\end{center}
%\addcontentsline{toc}{section}{Abstract}
\lipsum[2-4] % <========================================================

With the complete code

\documentclass[a4paper,12pt]{report}

\usepackage[%
  left=1.5in,right=1in,top=1in,bottom=1in,
  includefoot,heightrounded
]{geometry}
\usepackage{lipsum} 
\usepackage{fancyhdr}
\renewcommand{\baselinestretch}{1.3}
\usepackage{titlesec}

\titleformat{\chapter}[display]{\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing{\chapter}{0pt}{0pt}{1cm}

\fancypagestyle{plain}{% <==============================================
  \fancyhf{}
  \fancyfoot[R]{\thepage}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}%
}


\begin{document}
\pagenumbering{roman}
\pagestyle{fancy}
\fancyfoot{}
\fancyfoot[R]{\thepage}

\fancyhead[L]{\textit{\chaptername\thechapter}}

%\begin{center} % <======================================================
\chapter*{Abstract}
%\end{center}
%\addcontentsline{toc}{section}{Abstract}
\lipsum[2-4] % <========================================================

\chapter{Introduction}

\pagenumbering{arabic}
\setcounter{page}{1}
\lipsum[2-4]
\lipsum[2-4]
\end{document}

you get then:

abstract

2
  • It works fine. But facing another problem when i add another page before chapter such as Abstract page, it is showing chapter 0 in the heading. I don't need that. I have update MWE please check
    – Alamin
    Mar 31, 2019 at 18:02
  • 1
    @Alamin Please see my updated answer ...
    – Mensch
    Mar 31, 2019 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .