# How to reset counter for un-numbered subsections?

\documentclass{amsart}

\newtheorem{theorem}{Theorem}[section]

\begin{document}

\subsection*{1}

\begin{theorem}
blah is blah
\end{theorem}

\begin{theorem}
bloo is bloo
\end{theorem}

\subsection*{2}

\begin{theorem}
bleh is bleh
\end{theorem}

\begin{theorem}
blih is blih
\end{theorem}

\end{document}


This shows up as:

1.

Theorem 0.1. blah is blah

Theorem 0.2. bloo is bloo

2.

Theorem 0.3. bleh is bleh

Theorem 0.4. blih is blih


How can I reset the counter so that in my second un-numbered subsection, Theorem 0.3 is reset to Theorem 0.1 (and also make Theorem 0.4 as Theorem 0.2)?

(I put un-numbered subsections because for this particular documentclass, the sections are centered which I don't like, so I start off by using subsections, but the subsection numbering starts with 0.1, and I want it to start with 1. so I un-numbered the subsections and put in my own numbers.)

• If you don't like centered sections then change their format or change the class instead of creating such a silly and illogical document structure. – Ulrike Fischer Sep 24 '14 at 13:34
• I'm not sure what you mean by "change their format" and I can't change the class because it's useful for every other aspect of my document, except this one particular thing. – mr eyeglasses Sep 24 '14 at 13:37
• You can redefine the look of sections if you don't like the current look. Much better then dubious hacks which will lead to more and more problems. – Ulrike Fischer Sep 24 '14 at 13:42
• You can do that rather easily with the titlesec option. Which us this class you use? – Bernard Sep 24 '14 at 13:47

I am not sure that I understand what you are asking as you seem to be saying that you want two theorem 0.1s an two theorem 0.2s. This does not make sense to me, so I think that you probably want something like this:

To do this I have defined a fake \section command that uses a mysection counter, which is also used to number the theorems.

\documentclass{amsart}

\newcounter{mysection}
\let\realsection=\section
\renewcommand\section[1]{\refstepcounter{mysection}%
\subsection*{\themysection.\space #1}
}
\newtheorem{theorem}{Theorem}[mysection]

\begin{document}

\section{First section}

\begin{theorem}
blah is blah
\end{theorem}

\begin{theorem}
bloo is bloo
\end{theorem}

\section{Second section}

\begin{theorem}
bleh is bleh
\end{theorem}

\begin{theorem}
blih is blih
\end{theorem}

\end{document}


changing the format of the \section command is trivial, and a much better approach (as pointed out by ulrike fischer) than skipping that level and using \subsection.

this is the definition of \section in amsart.cls:

\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\scshape\centering}}


just remove the \centering command:

\makeatletter
\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\scshape}}
\makeatother


if you would rather have some font style other than small caps, you can change that at the same time, say to \bfseries.

an alternative method of changing just parts of a command definition is provided by the command \patchcmd from the package etoolbox; refer to the documentation for details.