章节标题和目录有问题

章节标题和目录有问题

我在删除章节编号和章节标题之间的标线时遇到了问题。我想在目录标题和实际内容列表之间添加一些空格。这是我的 MWE。请帮助我。自上周以来,我一直在努力解决这个问题,但收效甚微。

\documentclass[a4paper,14pt]{extreport}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsbsy}
\usepackage{color}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{microtype}
\usepackage{lscape}
\usepackage[small,compact,clearempty,indentfirst]{titlesec}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\titleformat{\chapter}[display]
{\normalfont\Large\filcenter\sffamily}
{\vspace*{\fill}
%\titlerule[0pt]%
\vspace{1pt}%
%\titlerule
\vspace{1pc}%
\LARGE{\chaptertitlename}~\thechapter}{1pc}
{\titlerule\huge}
[\vspace*{\fill}\newpage]

\titlespacing*{\chapter}{1pt}{1pt}{1pt}

\titleformat{name=\chapter,numberless}[display]
{\normalfont\Large\filcenter\sffamily}
{}
{1pt}
{\titlerule[0pt]\Huge}
%[\titlerule]
\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\pagestyle{plain}
\newcommand{\helv}{%
\fontfamily{T1}\fontseries{b}\fontsize{12}{12}\selectfont}
\renewcommand{\chaptermark}[1]{%
\markboth{\sc {
        \helv \chaptername\ \thechapter.%
        \ #1}}{}}
\fancyhead{{\bf \sc \helv{\leftmark}}}
\lhead{}
\chead{}
\cfoot{\bf{\sf \thepage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\baselinestretch}{1.4}
\usepackage[hmargin=1.2in,vmargin=1.2in]{geometry}
\begin{document}
    \setcounter{tocdepth}{1}
    \tableofcontents
    \newpage
    \addcontentsline{toc}{section}{\textit{\bf{\small{List of Figures }}}}
    \listoffigures
     \newpage

    \thispagestyle{empty}
    %\chapter*{\textbf{Bibliography}}
    \addcontentsline{toc}{chapter}{\bf Bibliography}
    \rhead{\textbf{\sc{\helv{BIBLIOGRAPHY}}}
    \setcitestyle{numbers}
    \bibliographystyle{ieeetr}
    \bibliography{thesisref}
\end{document}

答案1

babel必须使用

\addto\captionsenglish{%
  \renewcommand{\contentsname}{TABLE OF CONTENTS}%
}

示例\titlerule:在未编号的章节后不带和附加空格:

\documentclass[a4paper,14pt]{extreport}
\usepackage[english]{babel}
\usepackage{microtype}

\usepackage[small,compact,clearempty,indentfirst]{titlesec}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\titleformat{\chapter}[display]
{\normalfont\Large\filcenter\sffamily}
{\vspace*{\fill}\LARGE{\chaptertitlename}~\thechapter}%<- changed
{1pc}
{\huge}%<- changed
[\vspace*{\fill}\newpage]

\titlespacing*{\chapter}{1pt}{1pt}{1pt}

\titleformat{name=\chapter,numberless}[display]
{\normalfont\Large\filcenter\sffamily}
{}
{1pt}
{\Huge}% <- changed
[\vspace{2em}]% <- added 

\addto\captionsenglish{%
  \renewcommand{\contentsname}{TABLE OF CONTENTS}%
}

\usepackage{blindtext}% only for dummy text in the MWE
\begin{document}
\tableofcontents
\Blinddocument
\end{document}

结果:

在此处输入图片描述

请注意,我已经删除了不相关的包等。

相关内容