0
\documentclass[a4paper,oneside,11pt]{book}
\usepackage[left=4 cm,right=3cm,top=4cm,bottom=3cm]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{titlesec}

\usepackage{tocloft}
% code for List of Appendices
\newcommand{\listappendicesname}{List of Appendices}
\newlistof{appendix}{app}{\listappendicesname}
% new command for appendix sections
\newcommand{\appsection}[1]{\section{#1}%
    \addcontentsline{app}{appendix}{Appendix \protect\numberline{\thesection}#1}\par}

\titleformat{\chapter}
[display]
{\center\bfseries}
{\large\MakeUppercase{\chaptertitlename} \thechapter}{1pt}{\large}
\titlespacing{\chapter}{0cm}{-1.2cm}{0.7cm}

\titleformat{\section}
[hang]
{\bfseries}
{\bfseries\thesection}{1ex}{\bfseries}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
linefill=\bfseries\TOCLineLeaderFill,
beforeskip=2pt,
entrynumberformat=\chapterprefixintoc,
dynnumwidth
]{tocline}{chapter}

\newcommand*\chapterprefixintoc[1]
{\MakeUppercase{\chaptername}~#1\enskip}

\begin{document}
    \frontmatter
    \tableofcontents
    
    \newpage
    % print list of appendices and add title to the ToC
    \listofappendix \addcontentsline{toc}{chapter}{\listappendicesname}
    
    \mainmatter
    \chapter{ABC}
    \section{First}
    \lipsum[1-2]
    \section{Second}
    \lipsum[3-4]
    
    \chapter*{APPENDIX}
    \setcounter{section}{0}
    \renewcommand{\thesection}{\arabic{section}}
    \titleformat{\section}
    {\normalfont\Large\bfseries}{Appendix~\thesection.}{1em}{}
    %%%%%    \addcontentsline{toc}{chapter}{APPENDICES} % don't add to ToC
    \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} % No sections in ToC
    \appsection{First Appendix}
    \lipsum[4-4]
    
    \appsection{Second Appendix}
    \lipsum[3-3]
\end{document}

I want to move center the chapter title "Contents" and "List of Appendices". I also want to reduce the font size the chapter title "Contents" and "List of Appendices" same as "Chapter 1".

enter image description here

enter image description here

How to do it?

2
  • This was not the appearance you wanted in your question tex.stackexchange.com/questions/572170 If you had said that this was what you wanted I would have told you how to do it. Did you read the tocloft documentation? Nov 25, 2020 at 18:36
  • This is different question of tex.stackexchange.com/questions/572170. I have added \usepackage[titles]{tocloft}, and it works. Nov 26, 2020 at 1:28

1 Answer 1

0

I look at @egreg comment from Incorrect heading size of list generated with tocloft package, just adding [titles] in tocloft package, i.e. \usepackage[titles]{tocloft} it can solve my problem.

enter image description here

enter image description here

You must log in to answer this question.

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