报告类前言中的章节页码

报告类前言中的章节页码

首页

证书

确认第 1 页,显示页码

确认第 2 页,显示页码

内容,隐藏页码

第 1 章 第 1 页,隐藏页码 第 1 章第 2 页,必须显示页码

[![第 2 章第 3 页,隐藏页码][8]][8] [![第 2 章第 4 页,必须显示页码][9]][9]

还有什么办法可以隐藏目录第一页、简介第一页、第一章和第二章?前言中的页码是必要的,但正文中每章的第一页不需要!

以下是完整的代码。

\documentclass[12pt,a4paper]{report}

\usepackage{import}
\usepackage[none]{hyphenat}
\usepackage{chappg}
\usepackage{fancyhdr}

\usepackage{lipsum}
% document starts here...
\begin{document}

    %%frontmatter starts here
    \pagenumbering{roman}
\chapter*{Main logo for the Project} \thispagestyle{empty}
{\centering
title\\
\vspace{2cm}
name\\
\vspace{2cm}
reg.no.\\
\vspace{2cm}
month\\
\vspace{2cm}
year}
\clearpage
    
\chapter*{\centering Certificate}
\lipsum[1-2]
\clearpage
    
\chapter*{\centering Acknowledge}
\lipsum[1-7]
\clearpage
    
%%Main matter starts here...
    \pagenumbering{roman}
    \chapter*{thesis abstract}
    \addcontentsline{toc}{chapter}{Abstract}
    \lipsum[1-3]    
    \clearpage

    \tableofcontents
    \clearpage
    
    \pagenumbering{arabic}
\chapter{Introduction}
Brief note of Main content of the chapters.
\lipsum[1-4]

\chapter{one}
first chapter content...
\section{lispum one}
\lipsum[1-7]

\chapter{two}
second chapter content...
\section{lipsum two}
\lipsum[1-2]

\end{document}

答案1

我会使用像这样一致的东西:

\documentclass[12pt,a4paper,oneside]{book}

\usepackage{import}% Loaded but currently not used. Note: You should not load
                   % not used packages.
\usepackage[none]{hyphenat}% Deactivating hyphenation with justified text is
                           % not recommended and will result in several
                           % overfull \hboxes! If you use this, you should at
                           % least also use \raggedright. But I would
                           % recommend to not deactivate hyphenation.
\usepackage{chappg}
\usepackage{fancyhdr}
\fancyhead[R]{}
\fancyfoot[C]{\thepage}
\renewcommand*{\headrulewidth}{0pt}
\pagestyle{fancy}

\makeatletter
\let\ps@plain\ps@empty% Make page style plain the same like page style empty.
\makeatother

\usepackage{lipsum}
% document starts here...
\begin{document}

\frontmatter
\begin{titlepage}% Recommended for titlepages
  \centering
  \vspace*{1cm}
  {\Huge Main logo for the Project\par}
  \vspace{2cm}
  
  title\\[2cm]
  name\\[2cm]
  reg.no.\\[2cm]
  month\\[2cm]
  year
\end{titlepage}
    
\chapter*{\centering Certificate}
\lipsum[1-2]
    
\chapter*{\centering Acknowledge}
\lipsum[1-7]
    
\chapter{thesis abstract}
\lipsum[1-3]    

\tableofcontents
    
\mainmatter
\chapter{Introduction}
Brief note of Main content of the chapters.
\lipsum[1-4]

\chapter{one}
first chapter content...
\section{lispum one}
\lipsum[1-7]

\chapter{two}
second chapter content...
\section{lipsum two}
\lipsum[1-2]

\end{document}

标题页+证书+确认书第一页

第二页致谢+摘要+目录+第一章第一页

第 1 章第 2 页 + 第 2 章 + 第 3 章

也许您还想要:

\fancyhead[L]{}% remove the running head

作为替代方案

\makeatletter
\let\ps@plain\ps@empty% Make page style plain the same like page style empty.
\makeatother

你也可以使用

\fancypagestyle{plain}{\fancyhf{}}

“论文摘要”之前的章节起始页码不一致的完整示例:

\documentclass[12pt,a4paper,oneside]{book}

\usepackage{import}% Loaded but currently not used. Note: You should not load
                   % not used packages.
\usepackage[none]{hyphenat}% Deactivating hyphenation with justified text is
                           % not recommended and will result in several
                           % overfull \hboxes! If you use this, you should at
                           % least also use \raggedright. But I would
                           % recommend to not deactivate hyphenation.
\usepackage{chappg}
\usepackage{fancyhdr}
\fancyhead[R]{}
\fancyfoot[C]{\thepage}
\renewcommand*{\headrulewidth}{0pt}
\pagestyle{fancy}

\usepackage{lipsum}
% document starts here...
\begin{document}

\frontmatter
\begin{titlepage}% Recommended for titlepages
  \centering
  \vspace*{1cm}
  {\Huge Main logo for the Project\par}
  \vspace{2cm}

  title\\[2cm]
  name\\[2cm]
  reg.no.\\[2cm]
  month\\[2cm]
  year
\end{titlepage}

\chapter*{\centering Certificate}
\lipsum[1-2]

\chapter*{\centering Acknowledge}
\lipsum[1-7]

\chapter{thesis abstract}
\fancypagestyle{plain}{\fancyhf{}}
\lipsum[1-3]    

\tableofcontents

\mainmatter
\chapter{Introduction}
Brief note of Main content of the chapters.
\lipsum[1-4]

\chapter{one}
first chapter content...
\section{lispum one}
\lipsum[1-7]

\chapter{two}
second chapter content...
\section{lipsum two}
\lipsum[1-2]

\end{document}

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

fancyhdr注意:您可以在文档中多次更改页面样式。有关\fancyhead\fancyfoot或等命令的更多信息,请参阅手册\fancypagestyle。另一种方法是使用fancyhdrscrlayer-scrpage我更了解它,它还提供了一个功能,可以在文档序言中定义几对标题页面样式和普通页面样式,并在文档中从一对切换到另一对。

顺便说一句:每章的页码对读者来说并不是很有用,因为找到第 5-13 页并不像找到第 89 页那么容易。但是,我知道,它经常用于某些类型的文档。

相关内容