ams-gsm パッケージの theorem 環境で項目をインデントする方法

ams-gsm パッケージの theorem 環境で項目をインデントする方法

私は 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。代わりに、リスト(およびを含む)のデフォルトの動作ですenumerateitemizeインデントを変更するには、次の方法を使用します。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私の理解では、 で定義された手法では簡単にパッチを適用できません。

関連情報