![ams-gsm パッケージの theorem 環境で項目をインデントする方法](https://rvso.com/image/281599/ams-gsm%20%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%81%AE%20theorem%20%E7%92%B0%E5%A2%83%E3%81%A7%E9%A0%85%E7%9B%AE%E3%82%92%E3%82%A4%E3%83%B3%E3%83%87%E3%83%B3%E3%83%88%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95.png)
私は gsm パッケージを使用して LaTeX ファイルを書きます。通常、theorem 環境では、項目は左余白から少しインデントされます。次の図のように、すべてを左余白にインデントしたいです。
以下に最小限の動作例を示します。
\documentclass{gsm-l}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem} This is the theorem.
\begin{enumerate}
\item The first item
\item The second item
\item Are they indented as my purpose?
\end{enumerate}
\end{theorem}
\end{document}
私を助けてください。
答え1
theorem
これは、ドキュメントクラスによって提供される環境とはまったく関係ありません\newtheorem
。代わりに、リスト(およびを含む)のデフォルトの動作ですenumerate
。itemize
インデントを変更するには、次の方法を使用します。enumitem
のインターフェース。以下では、 を をleftmargin
使用して自動的に計算するように設定し*
、その結果、左揃えの設定になります。
\documentclass{gsm-l}
\usepackage{amsmath,enumitem}% http://ctan.org/pkg/{amsmath,enumitem}
\setlist[enumerate]{leftmargin=*}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem} This is the theorem.
\begin{enumerate}
\item The first item
\item The second item
\item The third item that is a tad longer and should span more than
a single line, and naturally flow to a second line.
\end{enumerate}
\end{theorem}
\end{document}
\setlist[enumerate]
ドキュメント レベルで、ネストのすべてのレベルにわたってのデフォルトの動作を変更しますenumerate
。よりローカライズされた変更を希望する場合は、代わりに次のインターフェースを使用して、環境にオプションの引数を指定できます。
\begin{enumerate}[leftmargin=*]
...
\end{enumerate}
答え2
文書クラスamsbook
(以下を含む)gsm-l
) では、ここで見られるように、インデントが大きくなりすぎます。
ams でこれを減らすために使用されるメカニズムは、デフォルトのマージン設定を上書きすることです\AtBeginDocument
。これは、最初に定義されている方法であるため、必ず実行する必要があります。
\AtBeginDocument{%
\labelsep=5pt\relax
\setcounter{enumi}{13}\setcounter{enumii}{13}%
\setcounter{enumiii}{13}\setcounter{enumiv}{13}%
\settowidth\leftmargini{\labelenumi\hskip\labelsep}%
%% \advance\leftmargini by \normalparindent % this is the culprit
\settowidth\leftmarginii{\labelenumii\hskip\labelsep}%
\settowidth\leftmarginiii{\labelenumiii\hskip\labelsep}%
\settowidth\leftmarginiv{\labelenumiv\hskip\labelsep}%
\setcounter{enumi}{0}\setcounter{enumii}{0}%
\setcounter{enumiii}{0}\setcounter{enumiv}{0}%
\leftmarginv=10pt \leftmarginvi=\leftmarginv
\leftmargin=\leftmargini
\labelwidth=\leftmargini \advance\labelwidth-\labelsep
\@listi}
これはコマンド定義として設定されていないため、etoolbox
私の理解では、 で定義された手法では簡単にパッチを適用できません。