색인 항목 사이의 간격을 지정하는 방법

색인 항목 사이의 간격을 지정하는 방법

코드

\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 사이의 간격(예: 5pt, 10pt, 12pt 등)을 미리 지정하려면 어떻게 해야 하나요? AAB와 AAC 사이?

답변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}

여기에 이미지 설명을 입력하세요

관련 정보