# Format title: section number flush left and title centered?

How can I format with the titlesec package that I get somethine like this (this is a twocolumn document):

I do not know how to get the number to the left and the title in the center is this possible?

Thanks a lot!!!

-
changed title to indicate that section number is flush left; ragged left means flush right. –  barbara beeton Mar 25 '12 at 16:54

## 1 Answer

You can put the title in a minipage with \centering inside it. This will allow long wrapped titles to wrap properly: (Thanks to egreg for making the centring code better.)

\documentclass{article}
\usepackage{titlesec}
\usepackage{lipsum}
\titleformat{\section}
[block]{\normalfont\bfseries\Large}{\rlap{\thesection}}{0em}
{\hspace*{.05\textwidth}\begin{minipage}[t]{.9\textwidth}\centering}[\end{minipage}]

\begin{document}
\section{A section}
\lipsum[1]
\section{A very long section title to show that it will wrap correctly}
\lipsum[2]
\end{document}


-