枚举中的直立字母未对齐

枚举中的直立字母未对齐

我在定理环境中使用了几个枚举。字体是斜体,但我想将标签(我使用字母)设置为直立。我读到我通过这样做\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带有选项的包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}

无论何处您需要这种枚举/格式化。

相关内容