目录之前的章节缺少标题

目录之前的章节缺少标题

目录之前的章节缺少标题。目录中不应识别这些章节。

\documentclass[
  parskip=full,
  fontsize=12pt,
  toc=flat,
  twoside=false,
  numbers=nodotatend,
  toc=listof,
  toc=index,
  bibliography=totoc,
  ]
{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{textcomp}
\usepackage{helvet}
\usepackage{csquotes}
\usepackage{geometry}
\geometry{a4paper,top=20mm, left=30mm, right=20mm, bottom=25mm} 
\linespread{1.25}

\usepackage[
  automark,
  headsepline=.5pt,
  plainheadsepline
]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\renewcommand\chaptermarkformat{\thechapter\hspace{1cm}}
\clearpairofpagestyles
\ihead*{\leftmark}
\cfoot*{\pagemark}
\addtokomafont{pagehead}{\normalfont\bfseries}

\BeforeStartingTOC{\thispagestyle{scrheadings}}% pagestyle scrheadings on first page in TOC, LOF and LOT
\renewcommand*\chapterpagestyle{scrheadings}


\begin{document}
\chapter*{HEADER MISSING}

\chapter*{HEADER MISSING}

\tableofcontents
\chapter{HEADER}
\chapter{HEADER}
\chapter{HEADER}
\newpage
\listoffigures
\listoftables
\appendix
\end{document}

答案1

添加选项headings=optiontoheadandtoc\addchap[tocentry={}]{HEADER MISSING}改用\chapter*{HEADER MISSING}

在此处输入图片描述

代码:

\documentclass[
  parskip=full,
  fontsize=12pt,
  toc=flat,
  twoside=false,
  numbers=nodotatend,
  toc=listof,
  toc=index,
  bibliography=totoc,
  headings=optiontoheadandtoc
  ]
{scrbook}
\usepackage{amsmath}        
\usepackage{amssymb}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{helvet}
\usepackage[style=alphabetic,]{biblatex}
\usepackage{csquotes}
%\addbibresource{babib.bib}% I do not have babib.bib
\usepackage{geometry}
\geometry{a4paper,top=20mm, left=30mm, right=20mm, bottom=25mm} 
\linespread{1.25}

\usepackage[
  automark,
  headsepline=.5pt,
  plainheadsepline
]{scrlayer-scrpage}% sets pagestyle scrheadings automatically
\renewcommand\chaptermarkformat{\thechapter\hspace{1cm}}
\clearpairofpagestyles
\ihead*{\leftmark}
\cfoot*{\pagemark}
\addtokomafont{pagehead}{\normalfont\bfseries}

\BeforeStartingTOC{\thispagestyle{scrheadings}}% pagestyle scrheadings on first page in TOC, LOF and LOT
\renewcommand*\chapterpagestyle{scrheadings}


\renewcommand\familydefault{\sfdefault}
\begin{document}
\addchap[tocentry={}]{HEADER MISSING}% <- changed
\addchap[tocentry={}]{HEADER MISSING}% <- changed

\tableofcontents
\chapter{HEADER}
\chapter{HEADER}
\chapter{HEADER}
\newpage
%\printbibliography[title=Literaturverzeichnis]% bibliography is empty
\listoffigures
\listoftables
\appendix
\end{document}

相关内容