自定义目录

自定义目录

我是 LaTeX 的新手,并且对我的目录中章节的标题存在问题:

在此处输入图片描述

我想删除前面的“章节”一词每一个主要列表。这是我的.tex文件中的内容: 在此处输入图片描述

我已删除实际文档中的“章节”一词: 在此处输入图片描述

但不知道如何从实际中删除它目录。所以最终结果应该是这样的:

在此处输入图片描述

有什么建议吗?谢谢。

我的文档类如下:

\newcommand{\pointsize}{12pt}
\documentclass[oneside, \pointsize, reqno]{amsbook}
\usepackage{titlesec}
\usepackage{pdflscape}

\usepackage[utf8]{inputenc}
\usepackage{fourier, erewhon, cabin}
\usepackage[english]{babel}
\usepackage{titletoc}
\usepackage{lipsum} 
\addto\captionsenglish{\renewcommand*\contentsname{\centerline{Contents}}}

\usepackage[
   %includehead,
   includefoot,
     left = 1in, 
      top = 1in, 
    right = 1in,
   bottom = 1in
]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{calc}

\setlength{\headheight}{\pointsize + 2pt}
\setlength{\headsep}{0.5in - \headheight} 

\fancyheadoffset[R]{0.5in} 

\fancypagestyle{prelim}{%    
   \renewcommand{\headrulewidth}{0pt} 
   \fancyhf{}           
   \pagenumbering{roman}    
   \cfoot{-\thepage-}       
}

\fancypagestyle{maintext}{%
   \pagenumbering{arabic}

   \newcommand{\chapfnt}{\fontsize{21}{21}}
   \newcommand{\secfnt}{\fontsize{17}{19}}
   \newcommand{\ssecfnt}{\fontsize{14}{17}}
   \newcommand{\sssecfnt}{\fontsize{10}{14}}

   \titleformat{\chapter}
   {\normalfont\chapfnt\bfseries}{\thechapter}{20pt}{\chapfnt}

   \titleformat{\section}
   {\normalfont\secfnt\bfseries}{\thesection}{1em}{}

   \titleformat{\subsection}
   {\normalfont\ssecfnt\bfseries}{\thesubsection}{1em}{}

   \titleformat{\subsubsection}
   {\normalfont\sssecfnt\bfseries}{\thesubsubsection}{1em}{}

   \titlespacing*{\chapter} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
   \titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
   \titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
   \titlespacing*{\subsubsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
}

\numberwithin{figure}{} 
\numberwithin{table}{chapter}
\numberwithin{equation}{}
\numberwithin{section}{chapter}

\usepackage{graphicx, float, listings, hyperref}
\usepackage{overcite}
\usepackage{amsmath, amssymb, bm}

\begin{document}

\makeatletter    
   \def\l@section{\@tocline{1}{0,2pt}{2pc}{8mm}{\ \ }} 
   \frontmatter
   \pagenumbering{gobble}
   \input{TitlePage.tex}
   \newpage
   \input{Declaration.tex}
   
   \pagestyle{prelim}
   \fancypagestyle{plain}{%
      \fancyhf{}
      \cfoot{-\thepage-}
   }%

   % Begin Double Spacing
   \doublespacing
   \newpage
   \input{Abstract.tex}
   \newpage
  
  % Contents Page  
    \tableofcontents
    \newpage
  %  

   \mainmatter
   
   \pagestyle{maintext}
   
   \fancypagestyle{plain}{%
      \renewcommand{\headrulewidth}{0pt}
   }%
   
   \chapter{Introduction}
   \label{ch:IntroductionLabel}
   \input{Chapters/1_Introduction/Introduction.tex}

   \chapter{Proximal Policy Optimisation (PPO)}
   \label{ch:PPOLabel}
   \input{Chapters/2_PPO/PPO.tex}
   
   \chapter{Aims \& Objectives}
   \label{ch:AimsLabel}
   \input{DEN318_Template/Chapters/Aims_and_objectives}
 
   \chapter{Conclusion}
   \label{ch:ConclusionLabel}
   \input{Chapters/Conclusions.tex}
   
   \bibliographystyle{IEEEtran}
   \bibliography{Bibliography}
   
   \newpage
   \begin{landscape}\centering
   \thispagestyle{empty}
   \vspace*{\fill}
   \begin{figure}[htpb]
   \centering
   \includegraphics[height=0.8\textheight, width=1.3\textwidth]{DEN318_Template/Pictures/plagiarism_check.png}
   \end{figure}
   \vfill
   \end{landscape}
   
 \end{document}

答案1

在 之后添加以下几行\documentclass{amsbook}

\renewcommand\tocchapter[3]{\indentlabel#2.\quad#3}
\renewcommand\tocappendix[3]{\indentlabel#3}

在此处输入图片描述

\documentclass{amsbook}
\renewcommand\tocchapter[3]{\indentlabel#2.\quad#3}
\renewcommand\tocappendix[3]{\indentlabel#3}
\numberwithin{section}{chapter}
\begin{document}
\tableofcontents
\chapter{First chapter}
\section{First section of first chapter}
\chapter{Second chapter}
\section{First section of second chapter}
\chapter{Third chapter}
\section{First section of third chapter}
\appendix
\begin{thebibliography}{99}
  \bibitem{xyz}
\end{thebibliography}
\end{document}

相关内容