[Tex/LaTex] Add section symbol to section

formattingsectioningsections-paragraphs

I would like to know how can I add the section symbol §, so that it will be displayed as follows.

§4 First section

§5 Second section

By default, it is generated as follows when a \section command is used.

4 First section

5 Second section

Edit:

This is one solution:

\renewcommand{\thesection}{\S\arabic{section}}

However, it adds § also with \subsection command. Is there another solution?

Best Answer

Perhaps the quickest way is to use the titlesec package:

\documentclass{article}
\usepackage{titlesec}

\titleformat{\section}
  {\normalfont\Large\bfseries}{\S\thesection}{1em}{}

\begin{document}

\section{Test section}
\subsection{Test subsection}
\section*{An unnumbered test section}
\section{Another test section}
\subsection{Another test subsection}

\end{document}

enter image description here

Related Question