TransWikia.com

How to print title chapters on the right side and odd pages on right side in the book class

TeX - LaTeX Asked on October 2, 2021

I am writing my thesis in book class but I figured out that my title chapters are appearing on the left side of the pdf instead of right. I see some discussions that chapter title page must be appear on the right side and also odd pages should be on the right side. I have tried several but not working. Is it because of some package error ?

I have tried this discussion but not working. my compiler is XeLaTeX. My MWE is,

this is the output

PassOptionsToPackage{square,comma,numbers,sort&compress,super}{natbib}

documentclass[a4paper, twoside, 12pt]{book}

usepackage{newunicodechar} % It is used to remove the error due to the previous document class

usepackage{booktabs}           %for table lines

usepackage{textgreek,stackengine}          %for a dot over the greek letters

newunicodechar{fi}{fi} 

newunicodechar{ff}{ff}

UseRawInputEncoding

usepackage[colorlinks=true]{hyperref} 

hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,      
urlcolor=cyan,
}

usepackage{graphicx} 

usepackage{textcomp}

usepackage{fontspec}

usepackage{graphics}

usepackage{natbib} 

usepackage[symbols,nogroupskip,nonumberlist,acronym]{glossaries-extra}

makeglossaries

loadglsentries{glos} 

usepackage{threeparttable}

usepackage{amsmath}

usepackage{xcolor} 

usepackage{setspace}

 usepackage{fancyhdr}  

 pagestyle{fancy}

 fancyhead[RO,LE]{smallthepage}

 fancyhead[LO]{small emph{nouppercase{leftmark}}}

 fancyhead[RE]{small emph{nouppercase{rightmark}}}

 fancyfoot[L,R,C]{}

 renewcommand{headrulewidth}{1pt}

  renewcommand{footrulewidth}{1pt}


  newcommand{chapabstract}[1]{
   begin{quote}singlespacingsmall  rule{11.5cm}{1pt}#1vskip-4mmrule{11.5cm}{1pt}end{quote}
   }
 newcommand{publn}{
  begin{quote}
    singlespacingsmall
   end{quote}
   }

   begin{document}

   frontmatter

   pagenumbering{roman}

   include{firstpage}

   include{frontmatter}

   tableofcontents

   clearpage{pagestyle{empty}cleardoublepage}

   listoftables

   clearpage{pagestyle{empty}cleardoublepage}

    mainmatter

    setcounter{page}{1}

    pagenumbering{arabic}

    input{intro}       %%Chapter 1%%

    input{Materialia}  %%Chapter 2%%

    cleardoublepage

     singlespacing

     renewcommand{bibname}{References}

     bibliographystyle{IEEEtran}

      bibliography{RSC}

       end{document}

One Answer

When I try to use xelatex it comes back with Segmentation fault (core dumped) so I used lualatex instead on your MWE, which I edited slightly to comment out the files you did not provide, replacing them with a simple version of what I assume their contents are.

% chapterprob.tex SE 555584

PassOptionsToPackage{square,comma,numbers,sort&compress,super}{natbib}
documentclass[a4paper, twoside, 12pt]{book}    
usepackage{newunicodechar} % It is used to remove the error due to the previous document class    
usepackage{booktabs}           %for table lines
usepackage{textgreek,stackengine}          %for a dot over the greek letters
newunicodechar{fi}{fi}     
newunicodechar{ff}{ff}    
UseRawInputEncoding    
usepackage[colorlinks=true]{hyperref}    
hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,      
urlcolor=cyan,
}    
usepackage{graphicx}    
usepackage{textcomp}    
usepackage{fontspec}
usepackage{graphics}    
usepackage{natbib}     
usepackage[symbols,nogroupskip,nonumberlist,acronym]{glossaries-extra}    
makeglossaries    
loadglsentries{glos}    
usepackage{threeparttable}    
usepackage{amsmath}    
usepackage{xcolor} 
usepackage{setspace}    
 usepackage{fancyhdr}    
 pagestyle{fancy}    
 fancyhead[RO,LE]{smallthepage}    
 fancyhead[LO]{small emph{nouppercase{leftmark}}}    
 fancyhead[RE]{small emph{nouppercase{rightmark}}}    
 fancyfoot[L,R,C]{}    
 renewcommand{headrulewidth}{1pt}    
  renewcommand{footrulewidth}{1pt}    
  newcommand{chapabstract}[1]{
   begin{quote}singlespacingsmall  rule{11.5cm}{1pt}#1vskip-4mmrule{11.5cm}{1pt}end{quote}
   }
 newcommand{publn}{
  begin{quote}
    singlespacingsmall
   end{quote}
   }

   begin{document}

   frontmatter

   pagenumbering{roman}

   include{firstpage}

   include{frontmatter}

   tableofcontents

   clearpage{pagestyle{empty}cleardoublepage}

   listoftables

   clearpage{pagestyle{empty}cleardoublepage}

    mainmatter

%    setcounter{page}{1} % mainmatter sets this

%    pagenumbering{arabic} % mainmatter sets this

%    input{intro}       %%Chapter 1%%
chapter{Introduction}
Some text.

%    input{Materialia}  %%Chapter 2%%
chapter{Materiala}
More text.

    cleardoublepage

     singlespacing

     renewcommand{bibname}{References}

     bibliographystyle{IEEEtran}

      bibliography{RSC}

       end{document}

The above MWE starts each chapter on the right hand (recto, odd) page.

Your problem may be with xelatex but probably not. More likely is what you have in your intro.tex and Materiala.tex files which you haven't given us an inkling of.

Answered by Peter Wilson on October 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP