![如何在ams-gsm包的theorem環境中縮排項目](https://rvso.com/image/281599/%E5%A6%82%E4%BD%95%E5%9C%A8ams-gsm%E5%8C%85%E7%9A%84theorem%E7%92%B0%E5%A2%83%E4%B8%AD%E7%B8%AE%E6%8E%92%E9%A0%85%E7%9B%AE.png)
我使用 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
。相反,它是列表的預設行為(包括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
我理解的 中定義的技術進行修補。