部分内容不显示标题

部分内容不显示标题

事实上,我在标题方面遇到了问题。第 1 章和第 2 章没有问题,一切都很好,但在目录、图片列表和表格列表中没有标题,而在简介部分则显示第 0 章。图片列表没有意义。以下是代码:

\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{lineno}
\usepackage{array}
\newcolumntype{L}{>{$}l<{$}}
\newcolumntype{m}{>{\displaystyle}l}
\usepackage{cclicenses}
\usepackage{makecell}
\usepackage{setspace}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{nomencl}
\makenomenclature
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\usepackage[justification=centering]{caption}
\usepackage{etoolbox}
\usepackage{titleps}
\newpagestyle{mystyle}{%
\headrule\sethead{\textsc \chaptername\ \thechapter. \textsc \chaptertitle}
{}{}
\setfoot{}{\thepage}{}\footrule}
\pagestyle{mystyle}
\usepackage[a4paper,right=20mm,left=25mm,top=20mm, bottom=20mm]{geometry}
\makeatletter
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\makeatother
\title {Tile of the report }
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\renewcommand\arraystretch{1.3}
\doublespacing
\maketitle
\tableofcontents
\chapter*{Publications}
\chapter*{acknowledegement}
I want...
\chapter*{table list}
\listoffigures
\renewcommand{\nomname}{abbreviation list}
\printnomenclature
\chapter*{Introduction }
\lipsum
\chapter{state of art}
\lipsum
\chapter{theory}
\lipsum
\end{document} 

答案1

以下是使用包的示例scrlayer-scrpage。章节Alpaca相当于您的简介章节,仅在页眉中显示标题(未编号)。编号章节在页眉中显示单词 Chapter 和相应的编号,以及标题。

如果您决定不在章节开始的页面上显示页眉,请从中删除星号ihead

我建议将顶部和底部的边距稍微增大一些。

\documentclass[12pt]{report}
\usepackage{lipsum}
\usepackage{unnumberedtotoc}%https://github.com/johannesbottcher/unnumberedtotoc/
\usepackage[automark,
plainheadsepline,
headsepline,
plainfootsepline,
footsepline,
markcase=ignoreupper]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead*{\leftmark}
\cfoot*{\pagemark}
\setkomafont{pageheadfoot}{\scshape}
\usepackage{titlesec}
\usepackage[a4paper,right=20mm,left=25mm,top=20mm, bottom=20mm,%
head=14.5pt,%<- new
]{geometry}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\tableofcontents
\addchap{Alpaca}
\lipsum
\lipsum
\chapter{Introduction}
\lipsum
\lipsum
\chapter{state of art}
\lipsum
\chapter{theory}
\lipsum
\end{document} 

相关内容