12

I want to use a list of \subsection elements numbered "1", "2", "3", "4"... but by default they're numbered "0.1", "0.2", "0.3", "0.4".

How do I do this?

2 Answers 2

9

Using \section* doesn't allow for a resetting of the subsection counter. For ease-of-use, you could redefine \section to always be \section* using the following:

enter image description here

\documentclass{article}
\let\oldsection\section
\renewcommand{\section}{\stepcounter{section}\oldsection*}
\renewcommand{\thesubsection}{\arabic{subsection}}
%\usepackage{chngcntr}% http://ctan.org/pkg/chngcntr
%\counterwithout{subsection}{section}
\begin{document}
\section{First section}
\subsection{First subsection}
\subsection{Second subsection}
\subsection{Last subsection}
\section{Second section}
\subsection{First subsection}
\subsection{Second subsection}
\subsection{Last subsection}
\section{Last section}
\subsection{First subsection}
\subsection{Second subsection}
\subsection{Last subsection}
\end{document}

If your subsection should be numbered continuously (without resetting after every section), then all you need to do is remove \stepcounter{section} from the redefinition of \section:

enter image description here

\documentclass{article}
\let\oldsection\section
\renewcommand{\section}{\oldsection*}
\renewcommand{\thesubsection}{\arabic{subsection}}
%\usepackage{chngcntr}% http://ctan.org/pkg/chngcntr
%\counterwithout{subsection}{section}
\begin{document}

The chngcntr package provides a similar mechanism for removing counter dependencies. For more on this kind of manipulation, see Continuous v. per-chapter/section numbering of figures, tables, and other document elements.

1
  • Great, this is exactly what I was trying to do. Commented May 24, 2012 at 6:47
11

Add to the preamble

\renewcommand\thesubsection{\arabic{subsection}}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .