使用几何包的不同章节标题

使用几何包的不同章节标题

我想看获取不同章节标题的代码。

在下面的代码中,我将“第 1 章”及其标题按照我想要的方式排版在第 1 页上,并且我将它的标题按照我想要的方式排版在目录中。

在第 2 页上,我排版了“第 2 章”及其标题,但我不想排版“第 2 章”。但我仍然希望其标题位于目录中。

在第 3 页上,我排版了“第 3 章”及其标题,但我不想排版“第 3 章”,而希望标题以 \Huge 字体排版,位于页面顶部中央。我还希望其标题位于目录中。

\documentclass[10pt,oneside]{book}

%Some packages
\usepackage{amsmath, mathtools, amssymb, amsthm}
\usepackage{enumitem}
\usepackage{titlesec}
\usepackage{setspace}
%\usepackage{sectsty} % not with titlesec
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,intersections,quotes,decorations.markings}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usepackage[
  a4paper,
  bindingoffset=0.0in,
  left=1.5in,
  right=1in,
  top=1in,
  bottom=1in,
  footskip=.25in,
  %showframe,
]{geometry}
\usepackage{footnote}

\usepackage{blindtext}

\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor={black},citecolor={black},urlcolor={black}}


\urlstyle{same}
\allowdisplaybreaks


%This package allows Chapter titles to be single spaced.
\titleformat{\chapter}[display]
    {\setstretch{0.2}\normalfont\huge\bfseries\filright}{\chaptertitlename\ \thechapter}{20pt}{\Huge}\titlespacing*{\chapter}{0pt}{-50pt}{40pt}
\titleformat{\section}
    {\setstretch{0.2}\normalfont\Large\bfseries\filright}{\thesection}{1em}{}
\titleformat{\subsection}
    {\singlespacing\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
    {\singlespacing\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}

%Allows the first line in  paragraph to be indented.
\makeatletter
\renewcommand{\@afterheading}{}% or \let\@afterheading=\relax
\makeatother

%Makes page numbers appear
\pagestyle{plain}


\begin{document}



%Makes the page numbers roman numerals, and doesn't count these pages in the table of contents.
\frontmatter

\newgeometry{margin=0pt}
\pagestyle{empty}
\vspace*{-\topskip}
\vspace*{\fill}
\centerline{\Huge\bfseries The Rules of Arithmetic}
\vbox to 0pt{
  \vspace{1in}
  \centering
  \bfseries\Large Positive, Rational Numbers
  \vss
}
\vspace*{\fill}
\restoregeometry

\mainmatter



\chapter{Definition of Fractions}



In this first chapter, we will blah, blah-blah.



\chapter{Arithmetic with Fractions}

In this second chapter, we will blah, blah-blah.


\chapter{Converting Fractions to Decimals}

In this third chapter, we will blah, blah-blah.

\end{document}

相关内容