0

To change the numbering of chapters I have included this in the preamble:

\renewcommand{\thechapter}{\Alph{chapter}}

\titleclass{\chapter}{straight}
\titleformat{\chapter}[block]%
   {\bfseries\large\sffamily\color{blue}}{SUBPART \thechapter}{10pt}{\hangindent=2.7em\hangafter=1\large}

With this in the document the numbering of chapters goes like SUBPART A, SUBPART B.... But in the ToC they go as A, B... without taking the SUBPART into account I guess that I have to include SUBPART in the definition of \thechapter but do not see how

3
  • The simplest, since you use titlesec , would be to use titletoc for the toc formatting, more precisely \titlecontents{chapter}{...}`.
    – Bernard
    Aug 17, 2019 at 9:33
  • Tks Bernard, I have tried with title contents but \thechapter is not read: \titlecontents{chapter}[0pt]{\normalsize\protect\addvspace{15pt}}% {\bfseries\small\sffamily{SUBPART \thechapter}}{ }%\chaptername{} {\enspace\titlerule\contentspage}%
    – Richard
    Aug 17, 2019 at 16:03
  • 1
    Could you post a complete, yet minimal, code of what you've tried?
    – Bernard
    Aug 17, 2019 at 16:53

1 Answer 1

-1

Tks Bernard, I have prepared a MWE, solved the issue with the chapter but cannot solve two things the \appendix declaration in memoir is not doing anything (names of chapters do not change) and dotted lines in ToC are not printed, may be a clash of packages? I have left in the preamble all the packages I am using although they are not needed in this 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}
1
  • Please don't use the answer section for a post that isn't an answer to the question (even if you're the one who posted the question). Just edit the question and add the additional information directly there. Thank you.
    – Miyase
    Jun 5, 2022 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .