我有这个代码:
\documentclass[oneside]{book}
\begin{document}
\chapter{Example 1}
Text chapter 1
\chapter{Example 2}
Text chapter 2
\end{document}
这给了我以下两个页面:
我的问题是:例如,我怎样才能将第 2 章的标题在页面上向上移动,同时将第 1 章的标题保留在同一位置?
PS:我的问题类似于这个但我只想将一章的标题向上移动。
答案1
如果使用类(和memoir
的超集)会容易得多。book
report
% upchapterprob.tex SE 615713
% \documentclass[oneside]{book}
\documentclass[oneside]{memoir}
\begin{document}
\setlength{\textheight}{0.4\textheight} %% just for printing convenience
\chapter{Example 1}
Text chapter 1
\addtolength{\beforechapskip}{-0.5in} % reduce space above title
\chapter{Example 2}
\addtolength{\beforechapskip}{0.5in} % restore space above title
Text chapter 2
\chapter{Example 3}
Text chapter 3
\end{document}
%%%% if using the book class instead of memoir then put the following,
%%%% less any typos, in the preamble. It is a redefinition of some book
%%%% class code.
\newlength{\beforechapskip}
\setlength{\beforechapskip}{50pt}
\makeatletter
%% revised \@makechapterhead
\renewcommand{\@makechapterhead}[1]{%
\vspace*{\beforechapskip}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth > \m@ne
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
第一页:
第二页:
第三页: