
コード
\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
\usepackage[itemlayout=singlepar]{idxlayout}
\begin{document}
\LARGE
This is the first paragraph.\index{AA! first}\index{AA! second}\index{AA! third}
This is the second paragraph.\index{AAB! an entry}
This is the third paragraph.\index{AAC! another entry}
\idxlayout{columns=1}
\printindex
\end{document}
次のインデックスを生成します:
AA と AAB の間、AAB と AAC の間のギャップ (たとえば、5pt、10pt、12pt など) を事前に指定するにはどうすればよいでしょうか。
答え1
\@idxitem
垂直方向のスペースを追加するように再定義します。
\documentclass{book}
\usepackage{imakeidx}
\usepackage[itemlayout=singlepar]{idxlayout}
\makeindex
\makeatletter
\renewcommand{\@idxitem}{\par\addvspace{\medskipamount}\hangindent40\p@}
\makeatother
\begin{document}
This is the first paragraph.\index{AA! first}\index{AA! second}\index{AA! third}
This is the second paragraph.\index{AAB! an entry}
This is the third paragraph.\index{AAC! another entry}
\idxlayout{columns=1}
\printindex
\end{document}