文本段落与列表项之间的间距

文本段落与列表项之间的间距

下面我从 TeXworks 编写的代码输出一段文本,后面跟着一个itemize列表,后面跟着另一段文本。每个段落都是双倍行距,每个项目文本内的间距也是双倍行距。但是,第一段最后一行和第一项目第一行之间的间距(以及第二段第一行和第二项目最后一行之间的间距)不等于每个段落内的间距(即双倍)。如何使段落和列表之间的间距与每个段落内的间距itemize相同(在本例中为双倍)?

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\rhead{Name \thepage}
\cfoot{}
\usepackage{setspace}
\doublespacing
\usepackage{geometry}

\begin{document}

\noindent This is My Name\\
This is Something\\
This is Something\\
This is the Date
\pagebreak[0]
\begin{center}
Title
\end{center}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper. 
\begin{itemize}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper. 
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper. 
\end{itemize}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper. 

\end{document}

答案1

加载enumitem并使用[nosep]作为选项。

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in]{geometry}
\usepackage{enumitem}
\usepackage{setspace}
\doublespacing

\begin{document}

\noindent This is My Name\\
This is Something\\
This is Something\\
This is the Date
\pagebreak[0]
\begin{center}
Title
\end{center}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\begin{itemize}[nosep]
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\end{itemize}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.

\end{document}

如果你希望它具有全局效果,那么使用

\setlist[itemize]{nosep}

以便所有itemize环境都遵守此规则。

另外,\\在文档中使用强制换行符被认为是一种不好的做法。要获得您想要的效果,您可以使用tabular以下代码:

\documentclass[12pt]{article}
\usepackage[margin=1in, left=1.25in, right=1.25in]{geometry}
\usepackage{enumitem}
\setlist[itemize]{nosep}
\usepackage{setspace}
\doublespacing

\begin{document}

\noindent 
\begin{tabular}{@{}l@{}}
This is My Name\\
This is Something\\
This is Something\\
This is the Date
\end{tabular}
\pagebreak[0]
\begin{center}
Title
\end{center}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\begin{itemize}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.
\end{itemize}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla bibendum dignissim arcu, faucibus condimentum ex pulvinar a. Integer vehicula lacus quis molestie vestibulum. Quisque sed ligula in erat faucibus aliquet. Phasellus volutpat luctus nisl nec semper.

\end{document}

在此处输入图片描述

相关内容