左對齊章節標題

左對齊章節標題

我使用 LaTeX 模板,該模板將所有部分標題居中對齊。我想左對齊這些部分標題,但我不知道如何。我試過

\begin{flushleft}
\section{\textbf{Introduction and Background}}
\end{flushleft}

但它對部分標題沒有影響(即,它仍然居中)。我試過

\begin{flushleft}
\textbf{Introduction and Background}
\end{flushleft}

它與“簡介和背景”一詞左對齊,但它不再是章節標題,因此使用章節編號的編號都混亂了。

我是 LaTeX 新手,所以請保持簡單。

答案1

\documentclass{amsart}

\makeatletter
\def\specialsection{\@startsection{section}{1}%
  \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
%  {\normalfont\centering}}% DELETED
  {\normalfont}}% NEW
\def\section{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
%  {\normalfont\scshape\centering}}% DELETED
  {\normalfont\scshape}}% NEW
\makeatother

\begin{document}

\section{Introduction and Background}

\end{document}

請注意,在章節標題中使用格式化宏,如下所示

\section{\textbf{Introduction and Background}}

不是建議的進行一般更改的方法。你應該使用

\normalfont\scshape\bfseries

在定義中\section(並確保使用提供粗體小寫大寫字母的字體)。

另請參閱\makeatletter 和 \makeatother 做什麼?

相關內容