使用花式页码和特殊章节标题样式时修复边距

使用花式页码和特殊章节标题样式时修复边距

我正在写论文,在修复页边距时遇到了问题。我需要在正文(阿拉伯文)的顶部显示页码,在前言的底部显示罗马页码。我还需要一种特殊的章节标题样式,如下例所示。页码不应出现在包含章节标题的页面中。我使用 fancyheader 并更改章节标题样式实现了上述目标,但现在我无法获得正确的页边距。我需要在每边留出 1.25 英寸的边距,但我无法获得正确的顶部边距测量值。带有章节标题的页面与仅包含文本的页面的边距似乎发生了变化。以下是示例代码:

\documentclass[reqno,12pt,oneside]{report}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{titletoc,setspace}
\usepackage[left = 1.25in, right = 1.25in, top = 1.25in, bottom = 1.25in]{geometry}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\listtablename}{LIST OF TABLES}
\renewcommand{\bibname}{REFERENCES}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Customize chapter head
\makeatletter
\renewcommand*\@makechapterhead[1]{
 {\parindent 0pt \raggedright
  \ifnum \c@secnumdepth >\m@ne
  %\centerline{\large\bf \@chapapp{} \thechapter} %\par
  \begin{singlespace}
  \huge\bf \@chapapp{} \hspace{1pt} \thechapter
  \huge\bf : \hspace{1pt} #1
  \nobreak \vskip 0.25in
  \end{singlespace}
 }}

\renewcommand*\@makeschapterhead[1]{%
   {\parindent \z@ \raggedright
     \normalfont
     \interlinepenalty\@M
     \Large \bfseries  \centerline{#1}\par\nobreak
     \vskip 40\p@
   }} 
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titlecontents*{chapter}
  [0pt]% <left>
  {}% <above-code>
  {\bfseries\chaptername\ \thecontentslabel\quad}% 
  {}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>
%First pages pagenumbers%%%%%%%%%%%%%%%%%%%%%
\fancypagestyle{plain2}{
\fancyhf{}
\fancyfoot[C]{\thepage}
%\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
%\setlength\headheight{50pt}
\setlength{\headsep}{0.25in}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\doublespacing
\title{
    {Thesis Title}\\
    {\large Institution Name}\\}
\begin{document}
\maketitle
\thispagestyle{empty}
\pagestyle{plain2}
\pagenumbering{roman}
\newpage
\hbox{ }
 \vfill
\begin{center}
   \bf{~\textcopyright \hspace{0.05in} COPYRIGHT BY} \\
   \bf{Name} \\
   \bf{2018} \\
   \bf{All Rights Reserved}
  %\end{singlespace}
 \end{center}
 \vfill
\newpage
\begin{center}
 \large
\textbf{DEDICATION}\\
 \textit{text}
\end{center}
\clearpage
\tableofcontents
\listoffigures
\listoftables

\chapter{CHAP1}
        %%%%%%%%%%%%%%%%%%%%puts page number on top%%%%%%%%%%%%%%%%

\fancypagestyle{plain}{
 \fancyhf{}
\fancyhead[C]{\thepage}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
%\setlength\headheight{50pt}
}

\pagestyle{plain}
\thispagestyle{empty}
\pagenumbering{arabic}
some text.
\section{a}
some text.
\clearpage
some other text, some other text .
\end{document}

提前致谢。

答案1

这似乎可以实现您想要的操作,使用titlesec,并titleps代替fancyhdr

\documentclass[reqno,12pt,oneside]{report}
\usepackage[pagestyles]{titlesec}
\usepackage{fancyhdr}
\usepackage{titletoc,setspace}
\usepackage[left = 1.25in, right = 1.25in, top = 1.35in, bottom = 1.25in, headheight = 0.12in, showframe]{geometry}
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\listtablename}{LIST OF TABLES}
\renewcommand{\bibname}{REFERENCES}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}{\thispagestyle{empty}\bfseries\huge\filright}{\chaptername\enspace\thechapter:}{1em}{}
\titlespacing{\chapter}{0pt}{-0.60in}{0.25in}
\titleformat{name = \chapter, numberless}{\bfseries\Large\filcenter}{}{0em}{}
\titlespacing{name = \chapter, numberless}{0pt}{-0.5in}{0.25in}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titlecontents*{chapter}
  [0pt]% <left>
  {}% <above-code>
  {\bfseries\chaptername\ \thecontentslabel\quad}%
  {}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>
%%%%%%%%%%%%%%%%%%%%%%%
\newpagestyle{plaintop}{%
\sethead{}{\thepage}{}
\setfoot{}{}{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\doublespacing
\title{
    {Thesis Title}\\
    {\large Institution Name}\\}
\begin{document}
\maketitle
\thispagestyle{empty}
\pagenumbering{roman}
\newpage
\hbox{ }
 \vfill
\begin{center}
   \bf{~\textcopyright \hspace{0.05in} COPYRIGHT BY} \\
   \bf{Name} \\
   \bf{2018} \\
   \bf{All Rights Reserved}
  %\end{singlespace}
 \end{center}
 \vfill
\newpage
\begin{center}
 \large
\textbf{DEDICATION}\\
 \textit{text}
\end{center}
\clearpage
\tableofcontents
\listoffigures
\listoftables

\chapter{CHAP1}
        %%%%%%%%%%%%%%%%%%%%puts page number on top%%%%%%%%%%%%%%%%

\pagestyle{plaintop}
\pagenumbering{arabic}
some text.
\section{a}
some text.
\clearpage
some other text, some other text .

\end{document} 

在此处输入图片描述 在此处输入图片描述

相关内容