8

I use a LaTeX template which center aligns all section titles. I want to left align these section titles but I do not know how. I tried

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

but it has no effect on the section title (i.e., it is still centered). I tried

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

and it is left aligned the word "Introduction and Background" but it is no longer a section title and thus the numbering using section number are all messed up.

I am new to LaTeX so please keep it simple.

6
  • Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). Commented Sep 1, 2012 at 11:36
  • Even when trying to keep it simple, knowing which template you use would be very helpful. :-)
    – lockstep
    Commented Sep 1, 2012 at 11:42
  • Possible duplicate and here with centring instead of left align.
    – Daryl
    Commented Sep 1, 2012 at 11:49
  • I used the AMS LaTex Article tamplate
    – Lawrence
    Commented Sep 1, 2012 at 12:17
  • In that case, please accept my answer and (as soon as you have enough reputation) upvote it. ;-)
    – lockstep
    Commented Sep 1, 2012 at 12:37

1 Answer 1

10
\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}

Note that using formatting macros within section titles as in

\section{\textbf{Introduction and Background}}

is not the recommended way to make general changes. You should rather use

\normalfont\scshape\bfseries

in the definition of \section (and make sure to use a font that provides bold small capitals).

Also see What do \makeatletter and \makeatother do?

You must log in to answer this question.

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