在我对主文档进行多次修改后,我发现“章节”一词从章节标题 ( \chapter{}
) 中消失了。章节编号和标题之间也没有空格,如下图所示。
问题是我不知道我在文档中做了哪些更改才导致这种情况发生。有什么想法吗?
我的主文档具有以下格式:
%Document class used is report from the koma script
\documentclass[twoside, openright, fontsize=13pt]{scrreprt}
%Packages
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{sectsty}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{fancyhdr}
\usepackage[backend=biber, style=apa]{biblatex}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{pdfpages}
\usepackage{setspace}
%Paths
\graphicspath{ {images/} }
\addbibresource{paperpile.bib}
%Styles
\setmainfont{Calibri}
\onehalfspacing
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{Supporting Language Learners in Science Education}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[LO,CE]{Chapter \thechapter}
\fancyfoot[CO,RE]{Author}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\raggedbottom
%Thesis information
\title{Thesis Title}
\author{Author Name}
\date{\today}
%Document start
\begin{document}
答案1
您必须使用选项chapterprefix=true
或启用章节前缀headings=chapterprefix
。
不要使用sectsty
带有 KOMA-Script 类的包。另外,我已将包替换fancyhdr
为scrlayer-scrpage
,它是 KOMA-Script 包的一部分。
\documentclass[twoside, open=right, fontsize=13pt,
DIV=calc,% to avoid a warning
chapterprefix=true% <- added
]{scrreprt}
%\providecommand*\Ifnumbered{\ifnumbered}% needed up to and including KOMA-Script version 3.27, see https://komascript.de/faq_deprecatedif
%Packages
\usepackage[width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{subcaption}% loads package caption
\usepackage[footsepline,headsepline,manualmark]{scrlayer-scrpage}% sets page style scrheadings automatically
\usepackage[backend=biber, style=apa]{biblatex}
\usepackage[english]{babel}
\usepackage{csquotes}% added
\usepackage{xcolor}
\usepackage{pdfpages}
\usepackage{scrhack}% added
\usepackage{setspace}
\usepackage{microtype}% added
\usepackage{blindtext}% only for dummy text in the MWE
%Paths
\graphicspath{ {images/} }
\addbibresource{paperpile.bib}
%Styles
\usepackage{lmodern}
\setmainfont{Calibri}
\setsansfont{Calibri}% added
\onehalfspacing
\renewcommand*\chaptermark[1]{\markboth{\Ifnumbered{chapter}{\chaptermarkformat}{}}{}}
\AfterTOCHead{\markboth{}{}}
\clearpairofpagestyles
\ohead{Supporting Language Learners in Science Education}
\ofoot*{\pagemark}
\lofoot{\leftmark}
\cofoot{Author}
\cefoot{\leftmark}
\refoot{Author}
\setkomafont{pageheadfoot}{\normalfont\normalcolor}
\raggedbottom
%Thesis information
\title{Thesis Title}
\author{Author Name}
\date{\today}
%Document start
\begin{document}
\maketitle
\tableofcontents
\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument
\end{document}