![需要在索引条目中添加垂直空间](https://linux22.com/image/452097/%E9%9C%80%E8%A6%81%E5%9C%A8%E7%B4%A2%E5%BC%95%E6%9D%A1%E7%9B%AE%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%9E%82%E7%9B%B4%E7%A9%BA%E9%97%B4.png)
我的代码如下:
\documentclass[executive,twoside, justified, symmetric, notoc, openany]{tufte-book}
\usepackage{imakeidx}
\makeindex[intoc, name = Rindex, title = Index of R and RStudio, columns=2]
\newcommand{\Rindex}[1]{\index[Rindex]{#1}}
\begin{document}
The upper-left window\Rindex{window} is the \Rindex{R script}, which
is where we write and run code\Rindex{run code}, giving R commands to
execute\Rindex{execute}.
The lower-left\Rindex{lower-left} window is the \Rindex{R console},
where R provides either the results of successfully executed code (known as outputs) or any error\Rindex{error} messages.\Rindex{R errors}
\printindex[Rindex]
\end{document}
它运行良好,但需要在特定条目之间插入一些垂直空间(不是全部),请指教......
答案1
从手册中得知\indexsetup
:
夸张地说\parskip
\documentclass{book}
\usepackage{imakeidx}
\makeindex[intoc, name = Rindex, title = Index of R and RStudio, columns=2]
\indexsetup{othercode=\setlength{\parskip}{4ex plus 0.2ex minus 0.1ex}}
\newcommand{\Rindex}[1]{\index[Rindex]{#1}}
\begin{document}
The upper-left window is the \Rindex{R script}, which is where
we write and run code, giving R commands to execute.
The lower-left window is the \Rindex{R console}, where R provides
either the results of successfully executed code (known as outputs)
or any error messages.\Rindex{R errors}
\printindex[Rindex]
\end{document}