
これは単純な質問かもしれませんが、私は LaTeX に比較的慣れていないため、これを行う方法を見つけることができませんでした。
\newtheorem
自然数で番号を付けたいのですが、サブセクションごとにリセットします。
次のように設定した場合:
\newtheorem{example}{Example}[subsection]
として注文されますa.b.c
が、私は として注文したいだけですc
。
基本的に、例を順序付けて、各サブセクションをリセットしたいと思います。
どのような解決策でも大歓迎です。よろしくお願いします。
答え1
name
を更新することで、いくつかの定理の番号付けスタイルを変更できます\thename
。 以下は の MWE ですexample
。
\documentclass{article}
\newtheorem{example}{Example}[subsection]
\renewcommand{\theexample}{\alph{subsection}}
\begin{document}
\subsection{This is the subsection}
\begin{example}
Here is the example.
\end{example}
\end{document}
他の番号付けスタイルには\roman
、、、\Roman
があり\arabic
ます\Alph
。これらを混在させることもできます。例:
\renewcommand{\theexample}{\arabic{section}.\alph{subsection}}
答え2
\theexample
環境を のスレーブとして定義した後、を再定義しますsubsection
。
\newtheorem{example}{Example}[subsection]
\renewcommand{\theexample}{\alph{example}}