Sunday, 2 June 2013

How to change horizontal spacing before section number

How to change horizontal spacing before section number

How do i change the small horizontal spacing that is present before a section number?
I have used the command \titlespacing from package titlesec to set the left spacing to 0, but it is still present. Small example
\documentclass[12pt,a4paper,titlepage]{article}
\usepackage{titlesec}
\titleformat{\section}[display]{\normalfont \bfseries}{\hspace{0mm} \thesection}{1em}{}
\titlespacing{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\begin{document}
\section{Section title}

Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet Lorem ispum dolor sit amet

\end{document}
If you look at the output, "Section title" is aligned to the second line of text perfectly, whereas the section number "1" is slightly moved to the right.

No comments:

Post a Comment