番号が付いていないサブセクションのカウンターをリセットするにはどうすればいいですか?

番号が付いていないサブセクションのカウンターをリセットするにはどうすればいいですか?
\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}

次のように表示されます。

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

2 番目の番号なしサブセクションで、定理 0.3 が定理 0.1 にリセットされ (また、定理 0.4 が定理 0.2 になるように) カウンターをリセットするにはどうすればよいですか?

(番号付けされていないサブセクションを配置したのは、この特定のドキュメントクラスではセクションが中央に配置されており、それが気に入らないからです。そのため、サブセクションを使用して開始しましたが、サブセクションの番号付けは 0.1 から始まり、1 から開始したいと考えました。そのため、サブセクションの番号付けを解除し、独自の番号を配置しました。)

答え1

2 つの定理 0.1 と 2 つの定理 0.2 が欲しいと言っているようなので、何を尋ねているのかよくわかりません。これは私には意味がわかりません。おそらく次のようなものを望んでいるのだと思います。

ここに画像の説明を入力してください

これを実現するために、定理に番号を付けるために使用されるカウンターを\section使用する偽のコマンドを定義しました。mysection

\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}

答え2

コマンドの形式を変更するのは\section簡単で、そのレベルをスキップして を使用するよりもはるかに優れたアプローチです (ulrike fischer が指摘) \subsection

\sectionこれはの定義ですamsart.cls:

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

以下のコマンドを削除するだけです\centering:

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

小文字大文字以外のフォント スタイルを使用したい場合は、同時に に変更することもできます\bfseries

コマンド定義の一部だけを変更する別の方法は、\patchcmdパッケージのコマンドによって提供されますetoolbox。詳細については、ドキュメントを参照してください。

関連情報