Latex:列表前后的垂直空间
我无法摆脱列表前后的垂直空间。我有如下代码:
\begin{list}{-}{}
\setlength{\itemsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\item First item
\item Second item
\end{list}
I cannot get rid of the vertical space before and behind the lists. I have code like below:
\begin{list}{-}{}
\setlength{\itemsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\item First item
\item Second item
\end{list}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新的答案:现在同时考虑单行和多行列表项。
一个订单项(简单)
逐项列出而不逐项...
将
$\bullet$
替换为您想要的任何内容。如图所示,“-”似乎与空格配合得很好,但其余的需要尾随
\,
在数学符号和下一个单词之间插入一个空格。如果没有它,“项目符号”和后面的文本之间就没有空格。多行项目(稍微复杂一点)
嗯,没那么复杂。刚刚找到了关于执行“悬挂缩进”的参考,这似乎使其足够灵活,可以做任何您想做的事情。 [1]
评论
Parindent stuff:我们将欺骗事情看起来像一个逐项项目符号,其中多行缩进以匹配第一个缩进的文本。为此,我们需要调整
parindent
和leftskip
值。 Leftskip 通常为零,但我不知道parindent
设置为什么,因此我们将其保存在变量中并稍后恢复。在试图找到相当于\setlength{\parindent}{default}
的东西时发现了这个技巧。[2]leftskip:这与整体缩进的距离有关。如果您希望它更靠右,只需增加该值即可。零意味着项目符号与段落向左齐平。
parindent:这会覆盖使后续行与项目符号左边缘对齐的默认行为。 -0.9 值恰好看起来适合补偿项目符号和空格,以便后续行看起来与第一行匹配。你也可以调整这个。例如,这样的东西可能看起来更好。
项目符号和文本之间的间距更大;家长相应调整:
希望有帮助! parindent 和 leftskip 手柄应该可以让您完善您想要的东西。
[1] http://www.wkiri.com/today/?p=76
[2] http://www .cs.cmu.edu/afs/cs/usr/bovik/database/tsf-bboard/Tex/enumerate
Updated answer: now accounts for both single and multi-line list items.
One line items (simple)
Itemize without itemizing...
Replace
$\bullet$
with whatever you want.The "-" seems to work fine with the whitespace as shown but the rest need the trailin
\,
which inserts a space between the math symbol and the next word. Without it there will be no space between the "bullet" and the text that follows.Multi-line items (just a tad more complex)
Well, not much complex. Just found a reference about doing "hanging indents" which appears to make this flexible enough to do whatever you want. [1]
Comments
Parindent stuff: we're going to trick things into looking like an itemized bullet with multiple lines indented to match the first indented text. To do this we fiddle with
parindent
andleftskip
values. Leftskip is usually zero but I don't know whatparindent
is set to so we save it in a variable and restore it later. Found this trick while trying to find something equivalent to\setlength{\parindent}{default}
.[2]leftskip: this plays with how far the overall thing is indented. If you want it further to the right, just increase the value. Zero means the bullets are flush left with the paragraphs.
parindent: this overrides the default behavior of making the subsequent lines aligned with the left edge of our bullet. The -0.9 value just happens to look right for compensating for the bullet and the space so that subsequent lines look like they're matched up with the first line. You can tweak this, too. For example, something like this might look better.
Bigger space between bullet and text; parindent adjusted accordingly:
Hope that helps! The parindent and leftskip handles should allow you to perfect what you want.
[1] http://www.wkiri.com/today/?p=76
[2] http://www.cs.cmu.edu/afs/cs/usr/bovik/database/tsf-bboard/Tex/enumerate
这是 Hendy 答案的延续: Latex:之前的垂直空间在列表后面,
我记下了他的笔记,并准备了以下内容:
之后我只能写:
在我的文档中的任何位置获取正确的列表。
It is continuation of Hendy answer: Latex: Vertical space before and behind the lists
I took his notes and I prepared the following:
After that I can only write:
To get proper list wherever in my document.
扩展之前的答案,一个根本没有要点的变体,而是第一行没有缩进,其他行(从第二行开始)有缩进:
然后,按照 Kogut 帖子中已经指出的相同方式使用:
Expanding on the previous answers, a variation with no bullet points at all, but instead first lines without indentation, and other lines (from 2nd line onwards) with indentation:
Then, use in the same way as already indicated in post by Kogut: