1

I would like to remove the 50pts of vertical space before the chapter when it is an appendix (leaving the default space for normal chapters). Here is a mwe

% !Mode:: "TeX:UTF-8"
\documentclass[a4paper,12pt,oneside]{book} 

\usepackage{fontspec}                    
\usepackage{polyglossia}             
\usepackage{titlesec}                       
\usepackage{appendix}  

\begin{document}

\chapter{Normal chapter}
\chapter{Normal chapter}

\appendix

\chapter{Appendix chapter}
\chapter{Appendix chapter}

\end{document}

I tried to comment the space in the book class declaration by adding this in the preamble

%remove vspace before chapter
\makeatletter
\def\@makechapterhead#1{%
  %\vspace*{50\p@}%
  {\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 

but doing so will remove the space for all chapters. Is it possible to add an if-else condition to the code to remove the space only if it is an appendix?

2
  • 1
    Don't place it in the preamle, place it just in front of \appendix or add the code to the definition of appendix. First seems to be much easier for you right now Space before chapters and contents
    – Johannes_B
    Commented Jun 25, 2015 at 9:34
  • Wow, I didn't know it was possible, I thought the preamble was the only palce to put it. Thank you very much, it works!
    – Emmet
    Commented Jun 25, 2015 at 10:18

2 Answers 2

5

A solution with the apptools and titlesec packages:

% !Mode:: "TeX:UTF-8"
\documentclass[a4paper,12pt,oneside]{book}

\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{titlesec}
\usepackage{appendix, apptools}
\AtAppendix{%
\titleformat{\chapter}[display]{\vspace*{-50pt}\bfseries\huge}{\chaptername~\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}}%

\begin{document}

\chapter{Normal chapter}
\chapter{Normal chapter}
\appendix
\chapter{Appendix chapter}
\chapter{Appendix chapter}

\end{document} 

enter image description here enter image description here

1

A simpler solution, in my opinion is to remove some space before each appendix, as below:

\chapter{\vspace{-5cm}Appendix 1}

and etc.

1
  • This leaves 'Appendix A' bellow the title and I can't do anything about that.
    – FanaticD
    Commented Apr 29, 2019 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .