8

How can I get the chapter higher on the page in order to get as many words as possible per page. Here is my MWE of what I am talking about.

\documentclass[12pt]{book}
\usepackage[pass,showframe]{geometry}
\begin{document}
\chapter{example}
How do I get chapter to go higher on the page. In order to get as many words per page. 
\end{document}

enter image description here

I also would like to have chapter number and chapter title in one line.

rabin
  • 83
  • Your title and body is contradicting... regardless, why do you use a \chapter then? Why not use something like a \section? – Werner May 16 '16 at 17:12
  • I added a figure of your MWE, but also put on a showframe to show the text margins. – Steven B. Segletes May 16 '16 at 17:15
  • I would use section but I was asked to keep everything in chapter form. Is there a way that I can get it to say Chapter 1 for example at the top of the page instead of the middle? If you could please help I would really appreciate it. – rabin May 16 '16 at 17:21

3 Answers3

5

The vertical skip between text page top margin and the chapter title is controlled by \vspace*{50\p@} in \@makechapterhead. (\p@ is an internal representation for pt)

Either redefine this command completely or use a \xpatchcmd replacing \vspace*{50\p@} with some other length, that's easier to change, in a special length register, say \chaptertopskip.

\documentclass[12pt]{book}
\usepackage[pass,showframe]{geometry}
\usepackage{xpatch}
\newlength{\chaptertopskip}
\setlength{\chaptertopskip}{10pt}
\makeatletter
\xpatchcmd{\@makechapterhead}{\vspace*{50\p@}}{\vspace*{\chaptertopskip}}{\typeout{Success}}{\typeout{Failure!!!}}
\makeatother
\begin{document}
\chapter{example}
How do I get chapter to go higher on the page. In order to get as many words per page. 
\end{document}

enter image description here

Update

Changing the wrap and bottom skip as well:

\documentclass[12pt]{book}
\usepackage[pass,showframe]{geometry}
\usepackage{xpatch}
\newlength{\chaptertopskip}
\newlength{\chapterbottomskip}
\setlength{\chaptertopskip}{10pt}
\setlength{\chapterbottomskip}{10pt}
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{\chaptertopskip}%
  {\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 \chapterbottomskip
  }}
\makeatother
\begin{document}
\chapter{example}
How do I get chapter to go higher on the page. In order to get as many words per page. 
\end{document}

enter image description here

  • I like the placement of where it says chapter. But is there a way to just make it say the chapter number and the chapter title on the same line? – rabin May 16 '16 at 17:22
  • 1
    @rabin: That's another question -- you asked for the movement of the chapter header. –  May 16 '16 at 17:26
  • @rabin: See the update at the bottom –  May 16 '16 at 17:31
  • Thank You very much. You have no idea how much I appreciate it. – rabin May 16 '16 at 17:43
  • @rabin: If it's what you requested, please consider to accept it later on –  May 16 '16 at 17:44
  • Funny thing, last week i redefined the chapterhead for the MDT thing in almost the same way :-) – Johannes_B May 16 '16 at 18:01
5

The default \chapter command issues three different spaces to set the chapter heading:

  1. Space from the top of the text block to the word Chapter; default is 50pt.

  2. Space between Chapter and the chapter title; default is 20pt.

  3. Space between the chapter title and the chapter body text; default is 40pt.

All of this is made by the macro \@makechapterhead (from book.cls; emphasis added):

\def\@makechapterhead#1{%
  \vspace*{50\p@}% <------------------------------------ (1)
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\bfseries \@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@% <--------------------------------- (2)
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@% <------------------------------------- (3)
  }}

For unnumbered chapters, there are still two spaces (1) and (3) above given as part of \@makeschapterhead:

\def\@makeschapterhead#1{%
  \vspace*{50\p@}% <------------------------------------ (1)
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@% <------------------------------------- (3)
  }}

You can either get rid of these using an etoolbox patch, but it may be better to just write your own \@makechapterhead macro:

enter image description here

\documentclass{book}

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
  {\noindent\raggedright\normalfont% Alignment and font reset
   \huge\bfseries \@chapapp\space\thechapter~~#1\par\nobreak}% Formatting
  \vspace{\baselineskip}% ...just a little space
}
\makeatother

\usepackage{showframe}% Just to show the frame

\begin{document}

\chapter{Example}
How do I get chapter to go higher on the page. In order to get as many words per page. 

\end{document}

You can do something similar for \@makeschapterhead.

Werner
  • 603,163
1

If you only need it for a certain chapter just once, you might use a very dirty workaround (that might put you into Latex jail). You can use \chapter{\vspace*{-2em} Chapter 1} lifting it by approximately two lines.

Nicouh
  • 11
  • 3
    Welcome to tex.sx. -2\baselineskip is a bit more direct. em is usually considered a horizontal dimension, and ex the corresponding vertical dimension. – barbara beeton Apr 06 '23 at 16:39
  • Beware: this is going to mess up the index! I have not yet found a solution to change a single chapter... – Andrea Marino Dec 05 '23 at 17:29