3

I have an appendix which goes 3 lines on a second page, so I would like to recover some "lost" space by the "Appendix" text on the top to keep it on one page.

I tried using \vspace{some negative value} or the titlesec package between \appendix and \chapter, but nothing moved...

My appendices looks like this :

\appendix
\chapter{Some code}
\label{cwalg}
\begin{lstlisting}
...
\end{lstlisting}

2 Answers2

2

Just before the \chapter for the appendix add some changes to the spacing using titlesec's \titlespacing* (in the example I changed the default 50pt and used -20pt instead); the change will have effect only if you also use \titleformat, so I used the default definition:

\documentclass{report}
\usepackage{titlesec}

\begin{document}

\chapter{A regular chapter}
\appendix
\titleformat{\chapter}[display]
  {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}
  {0pt}{-20pt}{40pt}
\chapter{An appendix}

\end{document}
Gonzalo Medina
  • 505,128
1

Alternatively, define a new \@makechapterhead for Appendix right before the chapter for the appendix. One may change the distance via \\[xx]

\documentclass{report}

\begin{document}

\chapter{A First Chapter}
\chapter{A Second Chapter}

\makeatletter
\def\@makechapterhead#1{ \null
\begin{flushleft} 
\huge\bfseries APPENDIX \thechapter\\
   #1
\end{flushleft}
\nobreak
}
\makeatletter
\appendix

\chapter{An appendix}

\end{document}

enter image description here

David Carlisle
  • 757,742
Jesse
  • 29,686