0

I would like to number my sections as follows

A section
Another section
A third section
1 - A subsection
1.1 - A subsubsection
1.2 - Another subsubsection

As you can see the sections are not numbered but the subsections and the subsubsections are. Is there a simple way to achieve this without resorting to titlesec? Thanks.

user32882
  • 1,594

1 Answers1

0

enter image description here

\documentclass{article}
\makeatletter
% we use \prefix@<level> only if it is defined
\renewcommand{\@seccntformat}[1]{%
    \ifcsname prefix@#1\endcsname
    \csname prefix@#1\endcsname
    \else
    \csname the#1\endcsname\quad
    \fi}
% define \prefix@section
\newcommand\prefix@section{Section \thesection: }
\makeatother

\begin{document} \section{Hello} \subsection{Subsection 1} \subsection{Subsection 2} \subsubsection{Subsubsection 1} \section{Go on} \subsection{Subsection 3} \subsubsection{Subsubsection 1} \end{document}

js bibra
  • 21,280