如何在ams-gsm包的theorem環境中縮排項目

如何在ams-gsm包的theorem環境中縮排項目

我使用 gsm 包來編寫我的乳膠文件。通常,在定理環境中,該項目會從左邊界縮排一小段距離。我想將其全部縮進到左邊距,如下圖所示:

在此輸入影像描述

這是一個最小的工作範例:

\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我理解的 中定義的技術進行修補。

相關內容