为了更改章节编号,我已将其包含在序言中:
\renewcommand{\thechapter}{\Alph{chapter}}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[block]%
{\bfseries\large\sffamily\color{blue}}{SUBPART \thechapter}{10pt}{\hangindent=2.7em\hangafter=1\large}
在文档中,章节的编号方式为 SUBPART A、SUBPART B.... 但在目录中,它们按 A、B... 的方式编号,如果不考虑 SUBPART,我想我必须在 \thechapter 的定义中包含 SUBPART,但不知道如何
答案1
谢谢 Bernard,我已经准备了一个 MWE,解决了章节问题,但无法解决两个问题:回忆录中的 \appendix 声明没有任何作用(章节名称不变),目录中的虚线未打印,可能是软件包冲突?我在序言中保留了我正在使用的所有软件包,尽管它们在这个 MWE 中不需要:
\documentclass[a4paper,8pt]{memoir}
%\usepackage[]{appendix}
\usepackage{array}
\usepackage{atveryend}%%%% <--- ! thumb index
\usepackage[ukrainian,english]{babel}
\usepackage{bbding}
\usepackage{boldline}
%\usepackage{boolexpr}%boolean loops
\usepackage{calc}
\usepackage{color}
\usepackage{colortbl}
\usepackage{comment}
\usepackage[shortlabels]{enumitem}
\usepackage{enumerate}
\usepackage{etoolbox}
\usepackage{fancyhdr}
%\usepackage[T2A]{fontenc}
\usepackage{framed}
\usepackage{gensymb}
\usepackage[left=3.0cm,right=3.0cm,top=4.0cm,bottom=3.0cm,headheight=2.8cm,headsep=0.8cm,textwidth=15.0cm]{geometry}
\usepackage{graphicx}
\usepackage{hhline}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage{keyval}%numberless sections, etc
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{makecell}
%\usepackage{marvosym}%e-mail \Email
\usepackage{multirow}
\usepackage{pageslts}
\usepackage{pdfpages}
\usepackage{pifont}%acft symbol et al
\usepackage{rotating}
\usepackage{soul}
\usepackage[table]{xcolor}
\usepackage{tcolorbox}
\usepackage{textcomp}% textdagger textborn textopenbullet
\usepackage[height={2cm},distance={2cm},width=1.5cm,topthumbmargin={auto},bottomthumbmargin={auto}]{thumbs}%%%% <--- ! thumb index
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shapes.arrows,calc,positioning,shadows,trees}
\usepackage[newparttoc]{titlesec}
\usepackage{titletoc}
\usepackage{titling}
\usepackage{tocloft}
\usepackage{url}%long urls
\usepackage{varwidth}
\usepackage{wasysym}%other symbols (pointer)
%
\renewcommand*{\cftchapterleader}{
\normalfont\cftdotfill{\cftsectiondotsep}}
%
\titleclass{\part}{top}
\titleformat{\part}[block]
{\bfseries\LARGE\sffamily}{PART~\thepart}{10pt}{\LARGE}
%
\titleclass{\chapter}{straight}
\titleformat{\chapter}[runin]%
{\bfseries\large\sffamily}{SUBPART~\thechapter~ -- ~}{0pt}{\hangindent=3.7em\hangafter=1\large}
\titlecontents{chapter}% <section-type>
[0pt]% <left>
{\hangindent7.0em}% <above-code>hangindent segunda línea en títulos largos
{\bfseries SUBPART\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>
\titleformat{\section}
{\bfseries\large\sffamily}{SECTION~\thesection}{0.5em}{}
%
\titlecontents{section}% <section-type>
[.7cm]% <left>
{}% <above-code>
{\bfseries SECTION\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>
%
%
\titlespacing*{\part}{0pt}{10pt}{10pt}
\titlespacing*{\chapter}{0pt}{20pt}{10pt}
\titlespacing*{\section}{0pt}{10pt}{10pt}
%
\renewcommand{\thepart}{\arabic{part}}
\renewcommand{\thechapter}{\Alph{chapter}}
\renewcommand{\thesection}{\arabic{section}}
%
\setlength\cftchapternumwidth{1.5em}
\setlength\cftsectionnumwidth{2.3em}
%
\begin{document}
%
\pagenumbering{arabic}
\begin{KeepFromToc}
\renewcommand{\contentsname}{Contents}
\tableofcontents
\end{KeepFromToc}%
\newpage
\chapter{First}
\lipsum[1]
\section{Second}
\lipsum[1]
\appendix
\appendixname
\chapter{First}
\end{document}