如果我首先手動編輯項目之間的空格,則將枚舉從數字更改為字母表不起作用

如果我首先手動編輯項目之間的空格,則將枚舉從數字更改為字母表不起作用

我正在嘗試將枚舉從數字更改為字母。即代替列表

1.
2.
3. 

我想要清單

(a)
(b)
(c)

為此,我使用以下命令:

\documentclass[12pt, a4paper]{article}
\usepackage{setspace}
\setstretch{1}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage[ampersand]{easylist}
\usepackage[margin=2.5cm]{geometry}
\setlength{\topmargin}{-2cm}
\usepackage{titling}
\setlength{\droptitle}{0cm}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{example}{Example}
\theoremstyle{remark} 
\newtheorem*{solution}{Solution}
\newtheorem*{remark}{Remark}
\title{\textbf{Metric Spaces} \vspace{-0.5cm}}

\begin{document}
\maketitle

\section{Basic Topology}
    \begin{definition} %\parskip0pt \parsep0pt
    A set $X$ together with a real-valued function $d$ is called a metric space if for all $x, y, z, \in X,$ the following properties are satisfied:

    \usepackage{enumitem}

    %%This command creates list.
    \begin{enumerate}[label=(\alph*)]
    \item $ d(x,x)=0$
    \item $ d(x,y)>0 if x \neq y $
    \item $ d(x,y)=d(y,x) $
    \item $ d(x,y) \leq d(x,z)+d(z,y) $
    \end{enumerate}

如果我按照上面的方式去做,它就會起作用。

但是,當我想更改項目之間的垂直空間時,請按以下方式進行:

\let\oldenumerate\enumerate\renewcommand{\enumerate}{\oldenumerate\setlength{\itemsep}{3pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}}

…… 這是行不通的。

因此,需要明確的是,這種組合不起作用:

\documentclass[12pt, a4paper]{article}
\usepackage{setspace}
\setstretch{1}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage[ampersand]{easylist}
\usepackage[margin=2.5cm]{geometry}
\setlength{\topmargin}{-2cm}
\usepackage{titling}
\setlength{\droptitle}{0cm}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{example}{Example}
\theoremstyle{remark} 
\newtheorem*{solution}{Solution}
\newtheorem*{remark}{Remark}
\title{\textbf{Metric Spaces} \vspace{-0.5cm}}
\let\oldenumerate\enumerate\renewcommand{\enumerate}{\oldenumerate\setlength{\itemsep}{3pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}}


\begin{document}
\maketitle

\section{Basic Topology}
    \begin{definition} %\parskip0pt \parsep0pt
    A set $X$ together with a real-valued function $d$ is called a metric space if for all $x, y, z, \in X,$ the following properties are satisfied:

    \usepackage{enumitem}

    %%This command creates list.
    \begin{enumerate}[label=(\alph*)]
    \item $ d(x,x)=0$
    \item $ d(x,y)>0 if x \neq y $
    \item $ d(x,y)=d(y,x) $
    \item $ d(x,y) \leq d(x,z)+d(z,y) $
    \end{enumerate}

誰能幫助我這兩個命令之間的聯繫是什麼以及為什麼第一個命令使第二個命令無效?

謝謝,

答案1

enumitem你一起應該這樣做:

\setlist[enumerate,1]{itemsep=10pt}

在全球範圍內改變一些事情。

你的程式碼:

\documentclass[12pt, a4paper]{article}
\usepackage{mathtools}
\usepackage{enumitem}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{example}{Example}
\theoremstyle{remark}
\newtheorem*{solution}{Solution}
\newtheorem*{remark}{Remark}
\title{\textbf{Metric Spaces} \vspace{-0.5cm}}
\setlist[enumerate,1]{itemsep=10pt}
\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}


\begin{document}
\maketitle

\section{Basic Topology}
    \begin{definition} %\parskip0pt \parsep0pt
    A set $X$ together with a real-valued function $d$ is called a metric space if for all $x, y, z, \in X,$ the following properties are satisfied:

    %%This command creates list.
    \begin{enumerate}[label=(\alph*)]
    \item $ d(x,x)=0$
    \item $ d(x,y)>0 if x \neq y $
    \item $ d(x,y)=d(y,x) $
    \item $ d(x,y) \leq d(x,z)+d(z,y) $
    \end{enumerate}
\end{definition}
\end{document}

在此輸入影像描述

答案2

發布演示問題的完整範例而不是我們無法使用的片段會更有用。但無論如何,您正在使用(但沒有說)enumitem它定義\enumerate來查找可選參數,但是您定義了命令,以便該命令始終後面跟著,\setlength因此看不到可選參數。在你的定義之後,就好像你已經走了

\begin{enumerate}\setlength{\itemsep}{3pt}[label=(\alph*)]

\itemsep無論如何,清單內的設定都是錯誤的地方,因為您正在使用enumitem可以在可選參數內設定清單參數。

相關內容