Document Classesscrbook: Question about the \part command -> no extra page

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

scrbook: Question about the \part command -> no extra page

Post by Montag »

Hello,

for a summary of a lecture that I am preparing for myself, I'd like to copy the lecture's script's formatting, meaning cloning its page layout and its table of contents.
What I would like to get is that the extra page for the part title is not printed, which means it was dropped (or "surpressed"?). But then, I would also want the text from this extra page be written simply over the chapter heading.

I hope it is clear what I want? :)

edit:
A solution I found here does not work:

Code: Select all

\makeatletter
\newcommand*{\restoreclearpage}{\global\let\clearpage\orig@clearpage
  \global\let\cleardoublepage\orig@cleardoublepage}
\newcommand*{\orig@clearpage}{}
\let\orig@clearpage\clearpage
\newcommand*{\orig@cleardoublepage}{}
\let\orig@cleardoublepage\cleardoublepage
\renewcommand*{\partheadendvskip}{%
  \global\let\clearpage\restoreclearpage
  \global\let\cleardoublepage\restoredoublepage
}
\makeatother
There's the error

Code: Select all

! Undefined control sequence.
\chapter ->\if@openright \cleardoublepage 
                                          \else \clearpage \fi \thispagestyl...
l.61 \chapter
             {Differences between the course and the world}
Attachments
scrbook-part-test.tex
(1.35 KiB) Downloaded 202 times
Last edited by Montag on Sun Aug 08, 2010 10:12 pm, edited 1 time in total.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

scrbook: Question about the \part command -> no extra page

Post by Montag »

I think I got it. The following code belongs into the preamble:

Code: Select all

\makeatletter
\renewcommand\part{\if@openright\hspace{1cm}\else\hspace{1cm}\fi
                  \thispagestyle{\partpagestyle}%
                  \if@twocolumn
                      \onecolumn
                      \@tempswatrue
                    \else
                      \@tempswafalse
                  \fi
                  \secdef\@part\@spart}
%\makeatletter
\renewcommand*{\@endpart}{\vbox to\z@{\use@preamble{part@u}\vss}\setcounter{chapter}{0}}
\makeatother

\makeatletter
\renewcommand\chapter{\noindent\if@openright\hspace{1cm}\else\hspace{1cm}\fi
  \thispagestyle{\chapterpagestyle}%
  \global\@topnum\z@
  \@afterindentfalse
  \secdef\@chapter\@schapter
}
\makeatother

%\renewcommand{\thepart}{\Alph{part}}
\renewcommand{\thechapter}{\Alph{chapter}}
\renewcommand{\thesection}{\Alph{chapter}.~\Roman{section}}
\renewcommand{\thesubsection}{\Alph{chapter}.~\Roman{section}.~\arabic{subsection}}
\renewcommand{\thesubsubsection}{\Alph{chapter}.~\Roman{section}.~\arabic{subsection}.~\alph{subsubsection}}
Jesus christ, took me some good time to get there. Looks really funny to me with all the commands, but it simply leads to the layout I wished for, so I guess it'll have to do. Unless someone likes to improve something? :)
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Post Reply