2

In my thesis, am not getting page number on the first page of each chapter.

The definitions used in the thesis are (formatAndDefs.tex):

\usepackage{amsmath,amssymb}             % AMS Math
% \usepackage[french]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=1.5in,right=1.3in,top=1.1in,bottom=1.1in,includefoot,includehead,headheight=13.6pt]{geometry}
\renewcommand{\baselinestretch}{1.05}
%\linespread{1.25}   %%%smita
% Table of contents for each chapter

\usepackage[nottoc, notlof, notlot]{tocbibind}
\usepackage{minitoc}
\setcounter{minitocdepth}{2}
\mtcindent=15pt
% Use \minitoc where to put a table of contents

\usepackage{aecompl}

% Glossary / list of abbreviations

\usepackage[intoc]{nomencl}
\renewcommand{\nomname}{List of Abbreviations}

\makenomenclature

% My pdf code

\usepackage{ifpdf}

\ifpdf
  \usepackage[pdftex]{graphicx}
  \DeclareGraphicsExtensions{.jpg}
  \usepackage[a4paper,pagebackref,hyperindex=true]{hyperref}
\else
  \usepackage{graphicx}
  \DeclareGraphicsExtensions{.ps,.eps}
  \usepackage[a4paper,dvipdfm,pagebackref,hyperindex=true]{hyperref}
\fi

\graphicspath{{.}{images/}}

% nicer backref links
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{%
\ifcase #1 %
(Not cited.)%
\or
(Cited on page~#2.)%
\else
(Cited on pages~#2.)%
\fi}
\renewcommand*{\backrefsep}{, }
\renewcommand*{\backreftwosep}{ and~}
\renewcommand*{\backreflastsep}{ and~}

% Links in pdf
\usepackage{color}
\definecolor{linkcol}{rgb}{0,0,0.4} 
\definecolor{citecol}{rgb}{0.5,0,0} 


\hypersetup
{
bookmarksopen=true,
pdftitle="Design of low power digital circuits using deep submicron technology",
pdfauthor="Smita Singhal", 
pdfsubject="Low power cmos design", %subject of the document

pdfmenubar=true, %menubar shown
pdfhighlight=/O, %effect of clicking on a link
colorlinks=true, %couleurs sur les liens hypertextes
pdfpagemode=None, %aucun mode de page
pdfpagelayout=SinglePage, %ouverture en simple page
pdffitwindow=true, %pages ouvertes entierement dans toute la fenetre
linkcolor=linkcol, %couleur des liens hypertextes internes
citecolor=citecol, %couleur des liens pour les citations
urlcolor=linkcol %couleur des liens pour les url
}

% definitions.
% -------------------

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{2}

% Some useful commands and shortcut for maths:  partial derivative and stuff

\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\def\abs{\operatorname{abs}}
\def\argmax{\operatornamewithlimits{arg\,max}}
\def\argmin{\operatornamewithlimits{arg\,min}}
\def\diag{\operatorname{Diag}}
\newcommand{\eqRef}[1]{(\ref{#1})}

\usepackage{rotating}                    % Sideways of figures & tables

\usepackage{fancyhdr}                    % Fancy Header and Footer



%%% Fancy Header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Fancy Header Style Options

\pagestyle{fancy}                       % Sets fancy header and footer
\fancyfoot{}                            % Delete current footer settings
\fancyhead{}    %by smita




\fancyfoot[C]{\bfseries\thepage} %%%%by smita:
% pages and right on odd pages
\fancyhead[RE]{\bfseries\nouppercase{\leftmark}}      % Chapter in the right on even pages
\fancyhead[LO]{\bfseries\nouppercase{\rightmark}}     % Section in the left on odd pages

\let\headruleORIG\headrule
\renewcommand{\headrule}{\color{black} \headruleORIG}
\renewcommand{\headrulewidth}{1.0pt}
\usepackage{colortbl}
\arrayrulecolor{black}

\fancypagestyle{plain}{
  \fancyhead{}
  \fancyfoot{}
  \renewcommand{\headrulewidth}{0pt}
}

\usepackage{algorithm}
\usepackage[noend]{algorithmic}

%%% Clear Header %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear Header Style on the Last Empty Odd pages
\makeatletter

\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
  \hbox{}%
  \thispagestyle{empty}%              % Empty header styles
  \newpage%
  \if@twocolumn\hbox{}\newpage\fi\fi\fi}

\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% Prints your review date and 'Draft Version' (From Josullvn, CS, CMU)
\newcommand{\reviewtimetoday}[2]{\special{!userdict begin
    /bop-hook{gsave 20 710 translate 45 rotate 0.8 setgray
      /Times-Roman findfont 12 scalefont setfont 0 0   moveto (#1) show
      0 -12 moveto (#2) show grestore}def end}}
% You can turn on or off this option.
% \reviewtimetoday{\today}{Draft Version}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

\newenvironment{maxime}[1]
{
\vspace*{0cm}
\hfill
\begin{minipage}{0.5\textwidth}%
%\rule[0.5ex]{\textwidth}{0.1mm}\\%
\hrulefill $\:$ {\bf #1}\\
%\vspace*{-0.25cm}
\it 
}%
{%

\hrulefill
\vspace*{0.5cm}%
\end{minipage}
}

\let\minitocORIG\minitoc
\renewcommand{\minitoc}{\minitocORIG \vspace{1.5em}}

\usepackage{multirow}
\usepackage{slashbox}

\newenvironment{bulletList}%
{ \begin{list}%
    {$\bullet$}%
    {\setlength{\labelwidth}{25pt}%
     \setlength{\leftmargin}{30pt}%
     \setlength{\itemsep}{\parsep}}}%
{ \end{list} }

\newtheorem{definition}{Définition}
\renewcommand{\epsilon}{\varepsilon}

% centered page environment

\newenvironment{vcenterpage}

{\newpage\vspace*{\fill}\renewcommand{\headrulewidth}{0pt}} %%Smita
{\vspace*{\fill}}

File Thesis.tex consists of:

\documentclass[a4paper,12pt,twoside, openany]{ThesisStyle}
\usepackage{fixltx2e}
\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}
\newcommand\tsub[1]{\textsubscript{#1}}
\newcommand\tsup[1]{\textsuperscript{#1}}
\include{formatAndDefs}
\usepackage{setspace}
\usepackage{subfigure}% Support for small, `sub' figures and tables

\usepackage{titlesec}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{enumitem}

\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\begin{document}

\setstretch{1.5}
\begingroup
\let\cleardoublepage\clearpage
\include{TitlePage2}
\endgroup



\dominitoc

\pagenumbering{roman}
\setcounter{page}{2}
\begingroup
\let\cleardoublepage\clearpage
\tableofcontents
\listoffigures

\listoftables
\endgroup

\mainmatter


\include{chapters/chapter1}
\include{chapters/chapter2}
\include{chapters/chapter3}
\include{chapters/chapter4}
\include{chapters/chapter5}
\include{chapters/chapter6}

%\appendix

%\include{Appendix1}
%\bibliographystyle{ThesisStyle}
\bibliographystyle{IEEEtran/bibtex/IEEEtran}

\bibliography{mybib}
\include{publications}

\end{document}
3
  • 1
    Look in your code for fancypahestyle{plain} and add the page number where you want it to appear.
    – Johannes_B
    Feb 9, 2020 at 4:58
  • 1
    Your template is mostly outdated. I would recommend to start with a minimal document and just add what you really need. The page number on chapter starting pages would be the default, your code disables it, and you don't want it.
    – Johannes_B
    Feb 9, 2020 at 5:00
  • Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. Feb 9, 2020 at 13:06

1 Answer 1

1

Hi ssinghal and welcome to TeX-SE.

As has been said in the comments of your question, please revise your code and post here only the minimum necessary to the question. If you have some problems while combining packages, ask a specific question about it.

When someone uses a lot of packages and other configurations, it becomes a little bit messy to clearly identify the issue.

That said, I will assume your ThesisStyle is some variation of the book class (The options seems to be basically the same). The book class always use the pagestyle plainto the pages where the chapter begins. A simple method to define the page with chapters the way you want is modify the pagestyle plain with the package fancyhdr.

The following code has some commented options to make easier and faster to you to test them. Basically \pagestyle{headings} defines the style of the whole document and \fancypagestyle{plain}{...} defines the style of pages with chapters.

The line \fancyhead[RO,LE]{\thepage} sets the Right-Odd and Left-Even header of the pages with the page number. It is necessary if you use the openany option of the bookclass. I suggest to test what happens with the option openright and the others fancyhead combinations.

A MWE follows:

\documentclass[twoside,openany]{book}
%\documentclass[twoside,openright]{book}

\usepackage{lipsum}

\usepackage{fancyhdr} 
\pagestyle{headings} % options: fancy, headings, myheadings
\fancypagestyle{plain}{
    \fancyhf{} % clear all header and footer fields 
    \fancyhead[RO,LE]{\thepage} % Right Odd, Left Even => Outside
    % Some examples
    %\fancyhead[R]{\thepage} % Right side has the page number
    %\fancyhead[L]{\leftmark} % Left side has the \chapter{title} 
    \renewcommand{\headrulewidth}{0pt} % remove line between header and main text 
}

\begin{document}
\chapter{title a}
\lipsum[1-12]
\chapter{title b}
\section{S1}
\lipsum[1-10]
\section{S2}
\lipsum[1-10]
\section{S3}
\lipsum[1-10]
\end{document}

You must log in to answer this question.

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