![枚举环境中新段落后的垂直空间](https://linux22.com/image/456646/%E6%9E%9A%E4%B8%BE%E7%8E%AF%E5%A2%83%E4%B8%AD%E6%96%B0%E6%AE%B5%E8%90%BD%E5%90%8E%E7%9A%84%E5%9E%82%E7%9B%B4%E7%A9%BA%E9%97%B4.png)
这里为什么有垂直空间?我怎样才能将其删除?
\documentclass[12pt]{article}
% Imported packages
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage[backend=biber, isbn=false, doi=false]{biblatex-chicago}
% Lemma & Example commands
\newtheorem{lem}{Lemma}
\newtheorem{ex}{Example}
% Single letter sets
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
% New operators
\DeclareMathOperator{\lcm}{lcm}
\DeclareMathOperator{\ord}{ord}
% Indentation Settings
\setlength{\parindent}{20pt}
\usepackage{enumitem}
\setlist[enumerate]{listparindent=\parindent}
\title{Homework 2 - MATH 4001}
\author{Clyde Kertzer}
\date{\today}
\begin{document}
\setlength{\abovedisplayskip}{5pt}
\setlength{\belowdisplayskip}{5pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\maketitle
\begin{enumerate}
\item
First line.
Why is there vertical space above this line?
答案1
你问,
这里为什么有垂直空间?我怎样才能将其删除?
这是因为长度参数\parsep
(控制列表环境中段落之间的垂直间距)默认为非零。它是一个“橡胶长度”(警告:使用了一些 TeX 术语),默认值为5.0pt+2.5pt-1.0pt
1 级枚举。
要将给定级别的项目枚举长度设置为零,请更改
\begin{enumerate}
到
\begin{enumerate}[parsep=0pt]
另一方面,如果你想设置\parsep
为零全球, 为了全部枚举级别,我建议你改变
\setlist[enumerate]{listparindent=\parindent}
到
\setlist[enumerate]{listparindent=\parindent,
parsep=0pt
}
在序言中。
答案2
这与空格的解释方式有关。我为您提供了一些选项,但还有更多方法可以完成您的要求。
\documentclass[12pt]{article}
% Imported packages
\usepackage[utf8]{inputenc}
\usepackage{fullpage}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage[backend=biber, isbn=false, doi=false]{biblatex-chicago}
% Lemma & Example commands
\newtheorem{lem}{Lemma}
\newtheorem{ex}{Example}
% Single letter sets
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
% New operators
\DeclareMathOperator{\lcm}{lcm}
\DeclareMathOperator{\ord}{ord}
% Indentation Settings
\setlength{\parindent}{20pt}
\usepackage{enumitem}
\setlist[enumerate]{listparindent=\parindent}
\title{Homework 2 - MATH 4001}
\author{Clyde Kertzer}
\date{\today}
\begin{document}
\setlength{\abovedisplayskip}{5pt}
\setlength{\belowdisplayskip}{5pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\maketitle
\begin{enumerate}
\item
First line.
Why is there vertical space above this line?
\item
Second line. \\
Less vertical space.
\item
Third line.
%
No space.
\item
Fourth line. \vspace{-0.5em}
Less space but indented.
\end{enumerate}
\end{document}