如何在quotchap
不修改 .sty 文件的情况下更改章节标题和引文的对齐方式?更具体地说,我希望将章节标题左对齐,将引文右对齐。
答案1
这可以通过重新定义一些quotchap
内部宏来实现。(请注意,我的解决方案稍微增加了章节标题所需的垂直空间。)
\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}