본문 및 ToC의 장 번호 변경

본문 및 ToC의 장 번호 변경

장의 번호 매기기를 변경하기 위해 서문에 다음을 포함했습니다.

\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와 같습니다.... 하지만 ToC에서는 SUBPART를 고려하지 않고 A, B...로 지정됩니다. 정의에 SUBPART를 포함해야 할 것 같습니다. \thechapter의 내용을 읽었지만 어떻게 하는지 모르겠습니다.

답변1

Bernard님, MWE를 준비했고 해당 장의 문제를 해결했지만 회고록의 \appendix 선언이 아무 것도 하지 않고(장 이름이 변경되지 않음) ToC의 점선이 인쇄되지 않는 두 가지 문제를 해결할 수 없습니다. 패키지 충돌? 이 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}

관련 정보