[Tex/LaTex] Changing the alignment of chapter headings and quotes in quotchap

chaptershorizontal alignmentquotchapsectioning

How can I change the alignment of chapter headings and quotes in quotchap without modifying the .sty file? More specifically, I would like left-align the chapter headings and right-align the quotes.

Best Answer

This can be done by redefining some of quotchap's internal macros. (Note that my solution somewhat increases the vertical space required by the chapter heading.)

\documentclass{book}

\usepackage{quotchap}

\makeatletter
\renewcommand\chapter{%
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{plain}%
  \global\@topnum\z@
%   \@printcites% DELETED
  \null\hfill\@printcites\par% NEW
  \@afterindentfalse
  \secdef\@chapter\@schapter
}
\renewcommand{\@makechapterhead}[1]{%
  \chapterheadstartvskip%
%   {\size@chapter{\sectfont\raggedleft% DELETED
  {\size@chapter{\sectfont\raggedright% NEW
    {\chapnumfont
      \ifnum \c@secnumdepth >\m@ne%
      \if@mainmatter\thechapter%
      \fi\fi
      \par\nobreak}%
%     {\raggedleft\advance\leftmargin10em\interlinepenalty\@M #1\par}}% DELETED
    {\raggedright\advance\leftmargin10em\interlinepenalty\@M #1\par}}% NEW
  \nobreak\chapterheadendvskip}}
\makeatother

\begin{document}

\begin{savequote}[5cm]
A quote.
\qauthor{The author}
\end{savequote}

\chapter{foo}

Some text.

\end{document}
Related Question