如何在附录 A 和章节标题之间添加冒号

如何在附录 A 和章节标题之间添加冒号

我的附录仅被标记为“A”,“B”,“C”ETC。。 我找到了这个回答将它们更改为“附录 A”、“附录 B”等非常有帮助。我试图在附录标签和章节标题之间添加一个冒号,例如“附录A:筛选实验”。

我尝试将冒号添加到\renewcommand{\appendixname}{},但插入的位置不正确,IE“附录:A”。这当然是有道理的,但我不知道如何将结肠移到正确的位置。

我在 LaTeX Stack Exchange 上的经验不足,无法仅对上述答案发表评论,因此提出这个问题。有人知道如何实现这一点吗?

编辑:我正在写论文。我无法给出完整的工作示例,因为我目前有 245 页。下面我给出了模板的主要导入,希望这能澄清我正在处理的内容。

\documentclass[a4paper,12pt]{article}
%\RequirePackage[l2tabu,orthodox]{nag}
\usepackage{appendix}

\usepackage{upreport}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{amssymb}
\usepackage{chemmacros}
\usepackage{chemgreek}
\usepackage[version = 4]{mhchem}
\usepackage{multirow}
\chemsetup{formula= mhchem}
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
\pdfminorversion=7

\addbibresource{report.bib}

\title{Poly(lactic acid) filament filled with layered double hydroxide for fused deposition modelling; optimisation of additive fraction and material extrusion parameters}
\author{Philip de Bruin}
\studentnumber{18017763}
\subject{CVD 800}
\date{\today}

% Nomenclature unit command - see the documentation for nomencl
\newcommand{\nomunit}[1]{%
\renewcommand{\nomentryend}{\hspace*{\fill}\si{#1}}}

% Create a custom user command or run the following 
% makeindex %.nlo -s nomencl.ist -o %.nls
% execute this command after compiling your file once, then compile a second time to generate a nomenclature table

% If you comment out one of these lines, the document can be compiled
% without the section, but retaining page numbers and references
% this is useful to send your supervisor a partial PDF.
\includeonly{
  contents/frontmatter,
  contents/introduction,
  contents/theory,
  contents/experimental,
  contents/results_discussion,
  contents/conclusions_recommendations
}

\begin{document}

% Note: To edit the abstract, edit the file abstract.tex
\include{contents/frontmatter}
\include{contents/introduction}
\include{contents/theory}
\include{contents/experimental}
\include{contents/results_discussion}
\include{contents/conclusions_recommendations}

\printbibliography

\renewcommand{\appendixname}{Appendix} 
\appendixtitleon    % puts \appendixname before each appendix title
\appendixtitletocon % puts \appendixname before each TOC entry

\newpage
\begin{appendices}

\renewcommand{\thefigure}{\thesection.\arabic{figure}}
\renewcommand{\thetable}{\thesection.\arabic{table}}
\renewcommand{\thepage}{\thesection.\arabic{page}}

\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{page}{1}
% Renew figure and page counter per Appendix using the commands above
\section{Screening experiment} \label{afd_bl_se}
\end{appendices}

答案1

非常简单,如果你使用 KOMA-Script 类scrartcl

\documentclass{scrartcl}
\usepackage[english]{babel}% To have \appendixname defined.

\AddToHook{scrartcl/appendix}{% Needs at least LaTeX 2020/10/10
  \renewcommand*{\sectionformat}{\appendixname~\thesection:\enskip}%
}

\usepackage{blindtext}

\begin{document}
\tableofcontents
\blinddocument
\appendix
\blinddocument
\end{document}

使用 scrartcl

类似的解决方案也适用于scrbookscrreprt。 重新定义\sectionformat(或\chapterformat或)不会影响或 条目对目录或页眉的引用。 但也有用户界面可以更改它们scrbookscrreprt\ref

相关内容