I've seen on this previous question that the memoir package can be used. I was wondering whether srcbook has a similar set-up: I tried to apply this previous solution to the current case, but I am getting the following error:
- error 44: Missing number, treated as zero. \tomo
- error: 44: Missing = inserted for \ifnum. \tomo
- error: 44: Missing number, treated as zero. \tomo
This is, the new sectioning is appearing as a new page, but there is an error when creating the table of contents. I provide a MWE below using this class:
\documentclass[ a4paper, % Page size fontsize=10pt, % Base font size twoside=true, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside) %open=any, % If twoside=true, uncomment this to force new chapters to start on any page, not only on right (odd) pages %chapterentrydots=true, % Uncomment to output dots from the chapter name to the page number in the table of contents numbers=noenddot, % Comment to output dots after chapter numbers; the most common values for this option are: enddot, noenddot and auto (see the KOMAScript documentation for an in-depth explanation) ]{kaobook} \makeatletter \newcounter{tomo} \renewcommand\thetomo {\roman{tomo}} \let\tomorunhead\tomorunhead \def\tomoname{tomo} \def\tomo{\cleardoublepage \thispagestyle{empty}% \null\vfil \markboth{}{}\secdef\@tomo\@tomo} \def\@tomo[#1]#2{% \ifnum \c@secnumdepth >-2\relax \refstepcounter{tomo}% \addcontentsline{toc}{tomo}{\tomoname\ \thetomo. \protect\enspace\protect\noindent#1}% \else \addcontentsline{toc}{tomo}{#1}\fi \begingroup\centering \ifnum \c@secnumdepth >-2\relax {\fontsize{\@xviipt}{22}\bfseries \tomoname\ \thetomo} \vskip 20\p@ \fi \fontsize{\@xxpt}{25}\bfseries #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}} \def\@stomo#1{\addcontentsline{toc}{tomo}{\protect\noindent#1}% \begingroup\centering \fontsize{\@xxpt}{25}\bfseries #1\vfil\vfil\endgroup \newpage\thispagestyle{empty}} \def\tomorunhead#1#2#3{% \@ifnotempty{#2}{\uppercase{#1 #2}\@ifnotempty{#3}{. }}% \def\@tempa{#3}% \ifx\@empty\@tempa\else\uppercasenonmath\@tempa\@tempa\fi} \def\l@tomo{\@tocline{-1}{12pt plus2pt}{0pt}{}{\bfseries}} \let\toctomo\tocsection \makeatother \begin{document} \tableofcontents \tomo{Missing} \part{Hello} \chapter{World} \end{document}
etocandscrbook. The definition of\l@tomois therefore completely wrong.memoiror whatever. it would be better to explain what you've found in the docs for the class you are using (or koma docs in this case).