例に番号を付けるより良い方法

例に番号を付けるより良い方法

数学で番号付きの例を書く他の方法はありますか? 私は asmart クラスを使用しています。

\textbf{Example 1 }

答え1

このスタイルが達成したいものであるかどうかはわかりませんが、通常の/アプローチで参照できる\newtheorem番号付き環境を取得する方法を示した MWE がここにあります。examplelabelref

\documentclass{amsart}
\theoremstyle{definition}
\newtheorem{thm}{Theorem}[section]
\newtheorem{example}[thm]{Example}

\begin{document}

\begin{example}
some example
\label{test example}
\end{example}
Reference the above example: \ref{test example}
\end{document}

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

コメントで barbara beeton が述べているように、上記の例では、同じカウンターを使用して例と定理に番号を付けます。例を個別に番号付けしたい場合は、\newtheorem{example}{Example}[section]代わりに を使用します。

答え2

自動番号付け、コンテキストに応じた正しい垂直間隔が必要な場合は、次のようにします。

\newtheorem{example}{Example}
......
\begin{document}
......
\begin{example}
......
\end{example}
......
\end{document}

amsthmレイアウトの詳細は、 や などの専用パッケージでntheorem、定義済みの のいずれかを使用してカスタマイズできますstyles。 の両方と連携する などのパッケージを使用thmtoolsすると、さらにカスタマイズが可能になります。

関連情報