我想独立于文本中的章节编号来格式化目录章节编号。附录的章节编号应为小写字母。但是,我修改了字体\chapterformat
。\EuRoman
因此,使用\renewcommand*{\thechapter}{\textsc{\alph{chapter}}}
会改变文本中章节标题的外观。
标题应该是这样的:
目录看起来应该是这样的:
梅威瑟:
\documentclass[10pt, oneside, numbers=noenddot, listof=totoc, toc=indentunnumbered]{scrbook}
\usepackage{anyfontsize}
\usepackage{newpxmath}
\usepackage{microtype}
\DeclareMathAlphabet\EuRoman{U}{eur}{m}{n}
\SetMathAlphabet\EuRoman{bold}{U}{eur}{b}{n}
\newcommand{\eurom}{\EuRoman}
\usepackage[osf]{newpxtext} \linespread{1.05}
\usepackage[left=32.5mm, right=25mm, top=25mm, bottom=20mm]{geometry}
\renewcommand*{\chapterformat}{\textls*[-30]{\Huge\fontfamily{pplx}\selectfont$\eurom\thechapter$}}
\setkomafont{chapter}{\huge\fontfamily{qpl}\selectfont\normalfont\lsstyle\scshape}
\addtokomafont{chapterentry}{\normalfont\lsstyle\scshape}
\DeclareTOCStyleEntries[raggedpagenumber=true, linefill=\qquad, pagenumberbox=\mbox]{tocline}{chapter,section,subsection}
\begin{document}
\tableofcontents
\appendix
% \renewcommand*{\thechapter}{\textsc{\alph{chapter}}}
\chapter{test}
\section{test}
\end{document}
答案1
我想这就是你想要的。
\documentclass[10pt, oneside, numbers=noenddot, listof=totoc, toc=indentunnumbered]{scrbook}
\usepackage{anyfontsize}
\usepackage{microtype}
\usepackage{etoolbox}
\usepackage{newpxmath}
\usepackage[osf]{newpxtext} \linespread{1.05}
\usepackage[left=32.5mm, right=25mm, top=25mm, bottom=20mm]{geometry}
\makeatletter
\patchcmd\appendix{\@Alph\c@chapter}{\@alph\c@chapter}{}{}
\renewcommand\chapterlinesformat[3]{%
\@hangfrom{\formatchapternumber{#2}}{#3}%
}
\newcommand*\formatchapternumber[1]{%
\usefont{U}{eur}{m}{n}\Huge
\MakeUppercase{#1}%
}
\renewcommand\sectionlinesformat[4]{%
\@hangfrom{\hskip #2\formatsectionnumber{#3}}{#4}%
}
\newcommand*\formatsectionnumber[1]{%
\scshape #1%
}
\makeatother
\setkomafont{chapter}{\huge\fontfamily{qpl}\selectfont\normalfont\lsstyle\scshape}
\addtokomafont{chapterentry}{\normalfont\lsstyle\scshape}
\DeclareTOCStyleEntries[raggedpagenumber=true, linefill=\qquad, pagenumberbox=\mbox]{tocline}{chapter, section, subsection}
\DeclareTOCStyleEntry[entrynumberformat=\scshape]{tocline}{section}
\begin{document}
\tableofcontents
\appendix
\chapter{Test}
\section{Test}
\end{document}