![Easylist:垂直间距](https://linux22.com/image/383061/Easylist%EF%BC%9A%E5%9E%82%E7%9B%B4%E9%97%B4%E8%B7%9D.png)
使用easylist
,如何设置各个“级别”之间的垂直间距?(手册中的第 8 页似乎是该问题的适当部分,但我仍然感到困惑。)例如,1 级条目与另一个 1 级条目之间的垂直间距;1 级条目与 2 级条目之间的垂直间距;2 级条目与 2 级条目之间的垂直间距;2 级条目与 3 级条目之间的垂直间距;3 级条目与 3 级条目之间的垂直间距。
梅威瑟:
\documentclass[12pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{microtype}
\usepackage{libertine}
\usepackage[at]{easylist}
\ListProperties(Hang=true,Margin=-3pc, Align=3pc, Indent=1em)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{easylist}
@ Level 1, item 1
@ Level 1, item 2
@@ Level 2, item 3
@@ Level 3, item 4
@ Level 1, item 5
@@ Level 2, item 6
@@@ Level 3, item 7
@@@ Level 3, item 8
@@ Level 2, item 9
@ Level 1, item 10
\end{easylist}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
答案1
关于第 8 页的参考easylist
手动的非常详细。也许下面的插图会有所帮助:
... | ...
Level n item | Level !=n item
Spacen* | Spacen
Level n item | Level n item
... | ...
例如,Space1
如果前一个项目来自某一级别,则设置第一级项目之前的垂直间距以外1 级;Space1*
如果前一个项目来自相同的级别。以下是示例:
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{microtype}
\usepackage{libertine}
\usepackage[at]{easylist}
\ListProperties(Hang=true,Margin=-3pc, Align=3pc, Indent=1em)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{easylist}
\ListProperties(Space1=0.75cm, % Level not 1, Space1, Level 1
Space1*=0.25cm,% Level 1, Space1*, Level 1
Space2=1cm, % Level not 2, Space2, Level 2
Space2*=0.5cm, % Level 2, Space2*, Level 2
Space3=0.33cm, % Level not 3, Space3, Level 3
Space3*=0.1cm, % Level 3, Space3*, Level 3
)
@ Level 1, item 1
@ Level 1, item 2
@@ Level 2, item 3
%@@ Level 3, item 4
@@ Level 2, item 4
@ Level 1, item 5
@@ Level 2, item 6
@@@ Level 3, item 7
@@@ Level 3, item 8
@@ Level 2, item 9
@ Level 1, item 10
\end{easylist}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
由于实施 easylist
,特别是在以下代码中发现 easylist.sty
\expandafter\ifnum\el@PreviousItem=\el@CounterLevel
\vskip\csname Space\the\el@CounterLevel*\endcsname
\else
\vskip\csname Space\the\el@CounterLevel\endcsname
\fi
我们看到:如果前一个项目和当前项目处于同一级别,则Spacen*
使用;否则,Spacen
使用。
要定义第 3 级和第 2 级之间的垂直空间,只能通过指定 来实现Space2
。要定义第 3 级和第 1 级之间的垂直空间,只能通过指定 来实现Space1
。要点是:考虑垂直空间前当前项目,而不是后。