
\@makechapterhead
章のタイトルの前後のスペースを短くするように再定義しましたが、中央に配置する方法がわかりません... 何か助けはありますか?
\makeatletter
\def\@makechapterhead#1{%
%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\normalsize\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\normalsize \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
%%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\normalsize \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
答え1
章の見出し構造全体を中央揃えにするには、\raggedright
(見出しの現在の/一般的な配置スタイル) を次のように置き換えます\centering
。
\documentclass{report}
\usepackage{lipsum}% Just for this example
\makeatletter
\def\@makechapterhead#1{%
%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \centering \normalfont
\ifnum \c@secnumdepth >\m@ne
\normalsize\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\normalsize \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@makeschapterhead#1{%
%%%%%\vspace*{50\p@}% %%% removed!
{\parindent \z@ \centering
\normalfont
\interlinepenalty\@M
\normalsize \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
\begin{document}
\chapter{A chapter}
\lipsum[1]
\end{document}