2

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} 
7
  • Please include a link to the class Commented Sep 3 at 15:28
  • I edited the post with the link to the class, which is the following: github.com/fmarotta/kaobook Commented Sep 3 at 15:31
  • 1
    The class uses etoc and scrbook. The definition of \l@tomo is therefore completely wrong. Commented Sep 3 at 15:46
  • I know, but the question is different: is there any other way to achieve the same behaviour? I was mainly linking to previous replies to avoid getting flagged for duplicated question, as this is the same problem, but on a different class. Thanks, Commented Sep 3 at 15:50
  • ok, but there is not much point copying code you know will error when you know the reason. you could link the question and just say that it depends on code specific to memoir or 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). Commented Sep 3 at 18:04

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.