如何在书籍类中将标题章节打印在右侧,将奇数页打印在右侧

如何在书籍类中将标题章节打印在右侧,将奇数页打印在右侧

我在书本课上写论文,但我发现标题章节出现在 pdf 的左侧而不是右侧。我看到一些讨论说章节标题页必须出现在右侧,奇数页也应该出现在右侧。我试了几次,但都没有用。是因为一些包错误吗?

我试过讨论但不起作用。我的编译器是 XeLaTeX。我的 MWE 是,

这是输出

\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]{\small\thepage}

 \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}\singlespacing\small  \rule{11.5cm}{1pt}\\#1\vskip-4mm\rule{11.5cm}{1pt}\end{quote}
   }
 \newcommand{\publn}{
  \begin{quote}
    \singlespacing\small
   \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}

答案1

当我尝试使用xelatex它时,它返回了,Segmentation fault (core dumped)因此我改用lualatex你的 MWE,我对其进行了稍微的编辑以注释掉你未提供的文件,并用我认为它们的内容的简单版本替换它们。

% 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]{\small\thepage}    
 \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}\singlespacing\small  \rule{11.5cm}{1pt}\\#1\vskip-4mm\rule{11.5cm}{1pt}\end{quote}
   }
 \newcommand{\publn}{
  \begin{quote}
    \singlespacing\small
   \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}

上述 MWE 从右侧(右页,奇数页)开始每一章。

您的问题可能出在 ,xelatex但也可能不是。更可能的是,您的intro.texMateriala.tex文件中有一些您没有告诉我们的东西。

相关内容