I want some chapters to appear at the level and with the layout of a part in the TOC. The chapters should still be numbered with their chapter number (also in the TOC) and should look like chapters in the text (no title page).
A special case of this is the list of abbreviations. Currently, I use:
\usepackage[automake, abbreviations, acronym, nomain, section=part]{glossaries-extra}
With this the TOC looks like I want but in the text there is a title page (empty besides title) which I do not want.
For normal chapters I could use:
\addcontentsline{toc}{part}{Chapter 0}
This results in an entry in the TOC with the right layout but without the chapter number in front. However, the number of the chapter should be shown in the TOC.
Here is a MWE:
\documentclass[a4paper]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[hang,tight]{subfigure}
\usepackage[subfigure]{tocloft}
\usepackage[toc,automake, abbreviations, acronym, nomain, section=part]{glossaries-extra}
\usepackage{hyperref}
\cftsetindents{chapter}{1em}{2.5em}
\cftsetindents{section}{2em}{3em}
\cftsetindents{subsection}{5em}{4.2em}
\cftsetindents{subsubsection}{9.2em}{7em}
\makeglossaries
\newabbreviation{test}{TEST}{test}
\begin{document}
\tableofcontents
\glsaddall
\printabbreviations %should not generate a title page
\chapter{Chapter 0} %should look like Part 1
%\addcontentsline{toc}{part}{Chapter 0} %no number in front
\label{test0}
\part{Part 1}
\chapter{Chapter 1}
\label{test3}
\end{document}
UPDATE:
I found this related question and modified the answer therein. So between \tableofcontents
and glsaddall
there is now:
\makeatletter
\def\toclevel@chapter{1}\def\toclevel@part{2}
\addtocontents{toc}{\string\let\string\l@chapter\string\l@part}
\makeatother
and the option "section" was set to "chapter" (instead of "part") for the "glossaries-extra" package.
Now I need to revert it for the next chapter. Another suggested solution for the question mentioned above uses \xpatchcmd
but besides I included \usepackage{regexpatch}
the command is not recognized. So, how could the command be reverted for the next chapter?