1

I need 3 events happening together:

  1. get rid of blank page after title

  2. get the page number for chapter 2 in header with fancyhdr

  3. even on left and odd on right pages numbers for all the pages after title in header


\documentclass[openany]{book}
\usepackage{geometry}
\geometry{paperheight=9.8125in,paperwidth=8in, left=.5in, 
right=.5in,top=.75in,bottom=.4375in }
\usepackage{fancyhdr}
\fancypagestyle{plain}{\fancyhf{} \fancyhead[EL,OR]{\textbf 
{\thepage}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\renewcommand{\rmdefault}{pag}
\usepackage[utf8]{inputenc}
\usepackage[hyphens]{url}
\usepackage[authoryear,round]{natbib}
\begin{document}
\newcommand{\titlefontarash}{\usefont{OT1}{pag}{b}{n}\fontsize{25} 
{\baselineskip} \selectfont}
\newcommand{\basefontarash}{\usefont{OT1}{pag}{b}{n}\fontsize{18} 
{\baselineskip} \selectfont}
\title{\titlefontarash  Helping each other}
\author{\basefontarash Good boy}
\maketitle
\frontmatter
\vspace*{\fill}
\begin{center}
\basefontarash To good...
\basefontarash To those good..
\end{center}
\vspace*{\fill}
\tableofcontents
\newgeometry{ left=2.75in, right=.5in }
\mainmatter
\fancypagestyle{plain}{ \fancyhf{}\fancyhead[EL,OR]{\textbf 
{\thepage}\hspace*{2.25in}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\chapter{Introduction}
\section{Introducing the fish}
\section{fox}
referring to \citet{Fish(1979)}.
A \textbf{fish}  (or \textbf{cat}) jungle sky.
\section{river}
\chapter{Introduction2}
\section{Introducing the fish2}
\section{fox2}
\newgeometry{ left=.5in, right=.5in}
\fancypagestyle{plain}{\fancyhf{}\fancyhead[EL,OR]{\textbf 
{\thepage}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}

\begin{thebibliography}{9}
\bibitem[Fish(1979)]{Fish(1979)} Fish, Y(1979) \textit{orange HHH} New York: 
hot.  
\end{thebibliography}
\end{document}
1

Your code has several issues resulting in your problems:

  1. In class book command \maketitle uses an \cleardoublepage at the end. To get rid of that build a group with \maketitle and \frontmatter and deactivate \clearpage inside this group ...

    { % <===================================================================
    \maketitle
    \let\cleardoublepage\relax
    
    \frontmatter
    } % <===================================================================
    
  2. Your page geometry for your chapters is very strange. To show that effect simply add option showframe for package geometry to your code and compile. Then you see the strange result of your \geometry commands. In the following mwe I simply commented this unusual geometry settings ...

  3. I moved command \newcommand{\titlefontarash} and command \newcommand{\basefontarash} into the preamble ...
  4. I commented/deleted your redefinition of style plain, its not needed with unchanged page geometry ...

Please see the following complete MWE

\documentclass[openany]{book}

\usepackage[showframe]{geometry} % <====================================
\geometry{%
  paperheight=9.8125in,
  paperwidth=8in, 
  left=.5in, right=.5in,top=.75in,bottom=.4375in 
}
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
  \fancyhf{} 
  \fancyhead[EL,OR]{\textbf {\thepage}}
  \renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}

\renewcommand{\rmdefault}{pag}

\usepackage[utf8]{inputenc}
\usepackage[hyphens]{url}
\usepackage[authoryear,round]{natbib}

\newcommand{\titlefontarash}{% 
  \usefont{OT1}{pag}{b}{n}%
  \fontsize{25}{\baselineskip}%
  \selectfont%
}
\newcommand{\basefontarash}{%
  \usefont{OT1}{pag}{b}{n}%
  \fontsize{18}{\baselineskip}%
  \selectfont%
}


\begin{document}

\title{\titlefontarash  Helping each other}
\author{\basefontarash Good boy}
{ % <===================================================================
\maketitle
\let\clearpage\relax

\frontmatter
} % <===================================================================
\vspace*{\fill}
\begin{center}
  \basefontarash To good...
  \basefontarash To those good..
\end{center}
\vspace*{\fill}

\tableofcontents

%\newgeometry{ left=2.75in, right=.5in } % <======================= ?????
\mainmatter
%\fancypagestyle{plain}{%
  %\fancyhf{}
  %\fancyhead[EL,OR]{\textbf {\thepage}\hspace*{2.25in}} % <========== ?????
  %\renewcommand{\headrulewidth}{0pt}
%}
\pagestyle{plain}

\chapter{Introduction}
\section{Introducing the fish}
\section{fox}
referring to \citet{Fish(1979)}.
A \textbf{fish}  (or \textbf{cat}) jungle sky.
\section{river}

\chapter{Introduction2}
\section{Introducing the fish2}
\section{fox2}
%\newgeometry{ left=.5in, right=.5in}
%\fancypagestyle{plain}{\fancyhf{}\fancyhead[EL,OR]{\textbf 
%{\thepage}}\renewcommand{\headrulewidth}{0pt}}
%\pagestyle{plain}

\begin{thebibliography}{9}
\bibitem[Fish(1979)]{Fish(1979)} Fish, Y(1979) \textit{orange HHH} New York: 
hot.  
\end{thebibliography}
\end{document}

and its result:

resulting page

Now -- if that solution does not help you -- please ask a new question and explain exactly in this new question, what you want to get as a layout for your chapter 1 etc. To be honest I could not guess what you want from your given code ...

With your activated geometry you get the following chapter 1, where the pagenumber can not be placed:

strange geometry result

UPDATED Answer:

After your explanation in comments see the following changed code:

\newgeometry{ left=2.75in, right=.5in } % <======================= ?????
\mainmatter
\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyhead[OR]{\textbf {\thepage}\hspace*{2.25in}} % <================
  \fancyhead[EL]{\textbf {\hspace*{2.25in}\thepage}} % <================
  \renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}

Because you changed the left margin from .5in to 2.75in you need to add a \hspace*{2.25in} to the new definition for the header. B careful, for the odd and even header you need to add \hspace different!

So with the following code

\documentclass[openany]{book}

\usepackage{blindtext}
\usepackage[showframe]{geometry} % <====================================
\geometry{%
  paperheight=9.8125in,
  paperwidth=8in, 
  left=.5in, right=.5in,top=.75in,bottom=.4375in 
}
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
  \fancyhf{} 
  \fancyhead[EL,OR]{\textbf {\thepage}}
  \renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}

\renewcommand{\rmdefault}{pag}

\usepackage[utf8]{inputenc}
\usepackage[hyphens]{url}
\usepackage[authoryear,round]{natbib}

\newcommand{\titlefontarash}{% 
  \usefont{OT1}{pag}{b}{n}%
  \fontsize{25}{\baselineskip}%
  \selectfont%
}
\newcommand{\basefontarash}{%
  \usefont{OT1}{pag}{b}{n}%
  \fontsize{18}{\baselineskip}%
  \selectfont%
}


\begin{document}

\title{\titlefontarash  Helping each other}
\author{\basefontarash Good boy}
{ % <===================================================================
\maketitle
\let\clearpage\relax

\frontmatter
} % <===================================================================
\vspace*{\fill}
\begin{center}
  \basefontarash To good...
  \basefontarash To those good..
\end{center}
\vspace*{\fill}

\tableofcontents

\newgeometry{ left=2.75in, right=.5in } % <======================= ?????
\mainmatter
\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyhead[OR]{\textbf {\thepage}\hspace*{2.25in}} % <================
  \fancyhead[EL]{\textbf {\hspace*{2.25in}\thepage}} % <================
  \renewcommand{\headrulewidth}{0pt}
}
\pagestyle{plain}

\chapter{Introduction}
\section{Introducing the fish}
\section{fox}
referring to \citet{Fish(1979)}.
A \textbf{fish}  (or \textbf{cat}) jungle sky.
\section{river}
\Blinddocument

\chapter{Introduction2}
\section{Introducing the fish2}
\section{fox2}
\newgeometry{ left=.5in, right=.5in}
\fancypagestyle{plain}{\fancyhf{}\fancyhead[EL,OR]{\textbf 
{\thepage}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}

\begin{thebibliography}{9}
\bibitem[Fish(1979)]{Fish(1979)} Fish, Y(1979) \textit{orange HHH} New York: 
hot.  
\end{thebibliography}
\end{document}

you get the result:

chapter 1

and

chapter 2

  • I want to use wide right margins on the body of the book. I can not have narrow margins. That is why I used new geometry. – Aria May 2 at 22:52
0

To remove the empty page:

\documentclass[openany]{book}
\usepackage{geometry}
\geometry{paperheight=9.8125in,paperwidth=8in, left=.5in, 
right=.5in,top=.75in,bottom=.4375in }
\usepackage{fancyhdr}
\fancypagestyle{plain}{\fancyhf{} \fancyhead[EL,OR]{\textbf 
{\thepage}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\renewcommand{\rmdefault}{pag}
\usepackage[utf8]{inputenc}
\usepackage[hyphens]{url}
\usepackage[authoryear,round]{natbib}
\begin{document}
\newcommand{\titlefontarash}{\usefont{OT1}{pag}{b}{n}\fontsize{25} 
{\baselineskip} \selectfont}
\newcommand{\basefontarash}{\usefont{OT1}{pag}{b}{n}\fontsize{18} 
{\baselineskip} \selectfont}
\title{\titlefontarash  Helping each other}
\author{\basefontarash Good boy}
{
\maketitle
\let\newpage\relax
\frontmatter
\vspace*{\fill}
\begin{center}
\basefontarash To good...
\basefontarash To those good..
\end{center}
\vspace*{\fill}
}
\tableofcontents
\newgeometry{ left=2.75in, right=.5in }
\mainmatter
\fancypagestyle{plain}{ \fancyhf{}\fancyhead[EL,OR]{\textbf 
{\thepage}\hspace*{2.25in}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\chapter{Introduction}
\section{Introducing the fish}
\section{fox}
referring to \citet{Fish(1979)}.
A \textbf{fish}  (or \textbf{cat}) jungle sky.
\section{river}
\chapter{Introduction2}
\section{Introducing the fish2}
\section{fox2}
\newgeometry{ left=.5in, right=.5in}
\fancypagestyle{plain}{\fancyhf{}\fancyhead[EL,OR]{\textbf 
{\thepage}}\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}

\begin{thebibliography}{9}
\bibitem[Fish(1979)]{Fish(1979)} Fish, Y(1979) \textit{orange HHH} New York: 
hot.  
\end{thebibliography}
\end{document}
  • hi Vadu would u explain how u removed the blank? – Aria May 2 at 21:31
  • @ArashRashidi I temporarily disabled \newpage to do nothing – user188004 May 2 at 21:36
  • thanks! yes do u know how to get page number for chapter2? – Aria May 2 at 21:39
  • @ArashRashidi I think all the page numbers are already there, but they are not visible because of the geometry of the page – user188004 May 2 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.