如何更改枚举环境的项目内部(而不是之间)的行距?

如何更改枚举环境的项目内部(而不是之间)的行距?

我有一个带有枚举环境的文档,我已将其baselinestretch设置为1,并且在大多数情况下,这似乎有效。但是,当环境\item中的内容enumerate长于一行时,项目内的行间距似乎约为文档其余部分的两倍。

因此,此代码:

Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing
\begin{enumerate}[noitemsep]
  \item first item
  \item second item (imagine this fills a line on the page)
        still the second item, which has wrapped onto this new line.
  \item third item
\end{enumerate}
Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing

生成的文档看起来类似如下内容:

Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing
  1. first item
  2. second item (imagine this fills a line on the page)
                                 <-- this is the space I am refering to -->
     still the second item, which has wrapped onto this new line.
  3. third item
Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing

我该如何修复它?

答案1

如果你明白空间那么你的图像在底部有一些空白或深度,这当然是不寻常的。没有深度的图像将其底部放置在当前行上:

\documentclass[12pt]{article}
\usepackage[demo]{graphicx}
\usepackage{enumitem}
\begin{document}    

Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing
\begin{enumerate}[noitemsep]
    \item first item
    \item \includegraphics[width=\linewidth,height=1cm]{demo}
    still the second item, which has wrapped onto this new line.
    \item third item
\end{enumerate}
Regular lines of text (imagine this fills a line on the page)
wrap with the correct spacing

\end{document}

在此处输入图片描述

相关内容