I am using the titlesec
package and the code under the usepackage to make parts appear on the same page as chapters, not on an individual page. Sorry I don't remember where I got the code from, but it does what I want. The problem is it also does something to the way appendices appear in toc. I want "Appendix A" in toc, but using the code for titlesec
makes appendices appear without "Appendix" in toc. I tested and I know for sure this is the cause. Please suggest some modification so that appendices appear "Appendix A" in toc and parts stay on the same page as chapters. Here is some outline code for my document.
\documentclass[titlepage, oneside, 12pt]{report}
\usepackage[titletoc]{appendix}
\usepackage[nottoc, notlof, notlot]{tocbibind}
\renewcommand*\listfigurename{}
\renewcommand*\listtablename{}
\usepackage{titlesec}
\titleclass{\part}{top}
\titleformat{\part}[display]
{\normalfont\huge\bfseries}{\centering\partname\ \thepart}{20pt}{\Huge\centering}
\titlespacing*{\part}{0pt}{50pt}{40pt}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter} {0pt}{50pt}{40pt}
\begin{document}
\begingroup
\setcounter{tocdepth}{2}
\tableofcontents{}
\endgroup
\part{part 1}
\chapter{chapter one}
\part{part 2}
\chapter{chapter two}
\clearpage
\begin{appendices}
\chapter{List of figures}
\listoffigures
\clearpage
\chapter{List of tables}
\listoftables
\end{appendices}
\end{document}
Here is what happens to the appendices in toc with the code between \usepackage{titlesec} and \begin{document} left as it is:
And here is what the appendices in toc look like when I remove that code. This is the way I would like them to be displayed
I would like someone to modify this code so that it still keeps parts from having a separate page and makes appendices show up properly in toc. Thanks.
\part
but\part
is not used at all. Could you please provide an example where both the\part
command is used, and the issue you need to solve is present? Then it'll be much easier to solve the problem. And please don't be rude. We're not paid to help you here, and even if we were, it's not a reason for rudeness.