枚舉中的直立字母未設定為兩端對齊

枚舉中的直立字母未設定為兩端對齊

我在定理環境中使用了幾個枚舉。字體是斜體,但我想將標籤(我使用字母)設為直立。我讀到我是通過這樣做的\normalfont並且它有效。但我發現標籤設定不合理。這是一張圖片: 在此輸入影像描述

如果我們仔細觀察,我們可以看到 (b) 被設定為距離左邊緣更遠的一些像素: 在此輸入影像描述

我想調整它們,最好不要硬編碼。那可能嗎?

這是我的 MWE:

\documentclass[ngerman, fontsize=11pt, DIV=12 ,BCOR = 10mm, parskip=half-, twoside]{scrbook}

\usepackage{enumitem}
\usepackage{amsthm}

\newtheoremstyle{style:lemma}
{3pt}% Space above
{3pt}% Space below
{\itshape}% Body fonti
{}% Indent amount
{\bfseries}% Theorem head font
{.}% Punctuation after theorem head
{.5em}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’)

\theoremstyle{style:lemma}
    \newtheorem{lemma}[]{Lemma}

\begin{document}
    \begin{lemma}
        There are several points to show. These are

    \begin{enumerate}[label = \normalfont(\alph*)]
        \item $a = b+1$
        \item $\sqrt{n} = 2$
        \item and the third.
    \end{enumerate}
\end{lemma}
\end{document}

答案1

使用enumitem帶有 options 的包wide=0pt, left=0pt,它解決了對齊問題。

\documentclass[ngerman, fontsize=11pt, DIV=12, BCOR=10mm, parskip=half-, twoside]{scrbook}

\usepackage{enumitem}
\usepackage{amsthm}

\newtheoremstyle{style:lemma}
{3pt}% Space above
{3pt}% Space below
{\itshape}% Body font
{}% Indent amount
{\bfseries}% Theorem head font
{.}% Punctuation after theorem head
{.5em}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’)

\theoremstyle{style:lemma}
\newtheorem{lemma}[]{Lemma}

\begin{document}
    \begin{lemma}
        There are several points to show. These are

        \begin{enumerate}[label=\normalfont(\alph*), wide=0pt, left=0pt]
            \item $a = b+1$
            \item $\sqrt{n} = 2$
            \item and the third.
        \end{enumerate}
    \end{lemma}
\end{document}

在此輸入影像描述

答案2

enumitem提供align鍵,您可以將其設定left為使枚舉左對齊。然而,這可能還需要對其他水平列表測量進行一些調整。下面的範例嘗試複製輸出,使它們相似,後者只是添加align=left到混合中。

在此輸入影像描述

\documentclass{article}

\usepackage{enumitem}
\usepackage{amsthm}

\newtheorem{lemma}{Lemma}

\begin{document}

\begin{lemma}
There are several points to show. These are
\begin{enumerate}[label=\normalfont(\alph*)]
  \item $a = b + 1$
  \item $\sqrt{n} = 2$
  \item and the third.
\end{enumerate}
\end{lemma}

\begin{lemma}
There are several points to show. These are
\begin{enumerate}[label=\normalfont(\alph*),align=left,labelwidth=1em,labelindent=0.8em,labelsep=0.25em,leftmargin=*]
  \item $a = b + 1$
  \item $\sqrt{n} = 2$
  \item and the third.
\end{enumerate}
\end{lemma}

\end{document}

您可以透過新增專門為此建立一個列表

\newlist{theoremenum}{enumerate}{1}
\setlist[theoremenum]{%
  label=\normalfont(\alph*),
  align=left,
  labelwidth=1em,
  labelindent=0.8em,
  labelsep=0.25em,
  leftmargin=*
}

到你的序言。這允許您使用

\begin{theoremenum}
  \item ...
  \item ...
  ...
\end{theoremenum}

無論您何時需要這種枚舉/格式。

相關內容