[Tex/LaTex] No space between section heading and numbering

sectioningspacing

I'd like my section headings to be displayed directly after the section numbering with no space in between.
This should be the case regardless of the number.
Something like this:

1. A section heading
2. Another section heading
...
1526. Yet another section

Currently I'm using titlesec with

\titleformat{\section}{\large\bfseries}{\makebox[1pt][l]{\thesection}}{12pt}{}

but this causes heading and large numbers to overlap.

Best Answer

Update: there's an easier solution with titlesec: the \thetitle command is respectively \thesection, \thesubsection, etc. The default value in standard classes is:

\titlelabel{\thetitle\quad}

which means that after the number, an space of 1em is inserted; to change this behaviour is enough then to redefine \thetitle to add a dot and then a space:

\titlelabel{\thetitle.\ }

A complete example:

\documentclass{article}
\usepackage{titlesec}

\setcounter{secnumdepth}{5}% just for the example

\titlelabel{\thetitle.\ }

\begin{document}

\section{Test Section}
\subsection{Test Subsection}
\subsubsection{Test Subsubection}
\paragraph{Test Paragraph}
\subparagraph{Test Subparagraph}

\section*{Test Section}
\subsection*{Test Subsection}
\subsubsection*{Test Subsubection}
\paragraph*{Test Paragraph}
\subparagraph*{Test Subparagraph}

\end{document}

enter image description here

One possibility using the titlesec package affecting \section through \subparagraph:

\documentclass{article}
\usepackage[explicit]{titlesec}

\setcounter{secnumdepth}{5}% just for the example

\titleformat{\section}
  {\normalfont\Large\bfseries}{\thesection.}{0em}{~#1}
\titleformat{name=\section,numberless}
  {\normalfont\Large\bfseries}{}{0em}{#1}
\titleformat{\subsection}
  {\normalfont\large\bfseries}{\thesubsection.}{0em}{~#1}
\titleformat{name=\subsection,numberless}
  {\normalfont\large\bfseries}{}{0em}{#1}
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries}{\thesubsubsection.}{0em}{~#1}
\titleformat{name=\subsubsection,numberless}
  {\normalfont\normalsize\bfseries}{}{0em}{#1}
\titleformat{\paragraph}[runin]
  {\normalfont\normalsize\bfseries}{\theparagraph.}{0em}{~#1}
\titleformat{name=\paragraph,numberless}[runin]
  {\normalfont\normalsize\bfseries}{}{0em}{#1}
\titleformat{\subparagraph}[runin]
  {\normalfont\normalsize\bfseries}{\thesubparagraph.}{0em}{~#1}
\titleformat{name=\subparagraph,numberless}[runin]
  {\normalfont\normalsize\bfseries}{}{0em}{#1}

\begin{document}

\section{Test Section}
\subsection{Test Subsection}
\subsubsection{Test Subsubection}
\paragraph{Test Paragraph}
\subparagraph{Test Subparagraph}

\end{document}

I can't upload images; will do it later.