
ttthesis
我正在使用基於book
from 的文檔類這裡。我真的很喜歡它,但我不想每章都有一個新頁面。可悲的是,我嘗試的每種方法都失敗了,現在我注意到這是因為章節中沒有clearpage
或cleardoublepage
(這就是為什麼像有關該主題的所有答案中所描述的那樣重新定義或忽略這些內容並沒有成功)。
這是重新定義章節的部分(不是我的程式碼,只是模板中的片段):
\newlength{\chapnolen}
\newlength{\chapparlen}
\newsavebox{\chapno}
%% Kein ``Kapitel'' bei Kapitelüberschrift
% \renewcommand{\@chapapp}{} allein reicht nicht!
%% \chapter{...}
\renewcommand{\@makechapterhead}[1]{%
\vspace*{0.2\textheight}%
%\hrule
\vskip 15\p@
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\savebox{\chapno}{\chapterheadfont\huge\bfseries \thechapter.}
\settowidth{\chapnolen}{\usebox{\chapno}}
\parbox[t]{\chapnolen}{\usebox{\chapno}}\nobreak\leavevmode
% \par\nobreak
% \vskip 20\p@
\fi
\fi
\interlinepenalty\@MM
\setlength{\chapparlen}{\textwidth}
\addtolength{\chapparlen}{-1.0\chapnolen}
\addtolength{\chapparlen}{-2ex}
\leavevmode\nobreak
\parbox[t]{\chapparlen}{\raggedright\chapterheadfont\huge \bfseries #1\par\nobreak}
%\the\textwidth
%\the\chapparlen
%\the\chapnolen
%\vskip 20\p@
%\rule{\textwidth}{1pt}
\vskip 40\p@
}}
我只是不懂為什麼會有是每章的分頁符號。我還搜尋了模板的其他部分,但沒有找到任何內容。
有誰知道這些分頁符號從何而來,或者更重要的是,我該如何防止它們?
答案1
如果您想要一個\chapter
不在頁面頂部的等級標題,除了停止分頁符號之外,您還需要一個很多頁面中間的設定較少,因此只需複製設定\section
並進行相應調整即可。
所以...
\documentclass{book}
\makeatletter
% section from book
%\newcommand\section{\@startsection {section}{1}{\z@}%
% {-3.5ex \@plus -1ex \@minus -.2ex}%
% {2.3ex \@plus.2ex}%
% {\normalfont\Large\bfseries}}
\renewcommand\chapter{\@startsection {chapter}{0}{\z@}%
{-4.5ex \@plus -1ex \@minus -.2ex}%
{3.3ex \@plus.2ex}%
{\normalfont\LARGE\bfseries}}
\makeatletter
\begin{document}
\chapter{Zzzz}
\section{Aaaa}
aa
\section{Bbbbbb}
bb
\chapter{Zzzz}
\section{Aaaa}
aa
\section{Bbbbbb}
bb
\end{document}