我的代码如下:
\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}