imakeidx
我需要仅当第一列到达页面底部后才开始创建索引的第二列。
\documentclass{book}
\usepackage{imakeidx}
\makeindex[columns=2]
\begin{document}
foo\index{a}. foo\index{b}. foo\index{c}. foo\index{d}. foo\index{e}. foo\index{f}. foo\index{g}. foo\index{h}. foo\index{i}. foo\index{j}. foo\index{k}. foo\index{l}. foo\index{m}. foo\index{ab}. foo\index{ac}. foo\index{asd}. foo\index{asddf}. foo\index{aasef}.
\printindex
\end{document}
该图显示了我拥有的东西和我需要的东西:
答案1
你有两种选择:第一种是通过original
选择
\documentclass[a5paper]{book}
\usepackage[pass]{geometry}
\usepackage[original]{imakeidx}
\makeindex
\begin{document}
foo\index{a}. foo\index{b}. foo\index{c}. foo\index{d}. foo\index{e}. foo\index{f}.
foo\index{g}. foo\index{h}. foo\index{i}. foo\index{j}. foo\index{k}. foo\index{l}.
foo\index{m}. foo\index{ab}. foo\index{ac}. foo\index{asd}. foo\index{asddf}. foo\index{aasef}.
\printindex
\end{document}
只支持双栏格式,为了更清晰的展示结果,我用了A5纸:
第二种策略是通过multicols*
而不是multicols
:
\documentclass[a5paper]{book}
\usepackage[pass]{geometry}
\usepackage{imakeidx}
\makeindex[columns=2]
\xpatchcmd{\theindex}{multicols}{multicols*}{}{}
\xpatchcmd{\endtheindex}{multicols}{multicols*}{}{}
\begin{document}
foo\index{a}. foo\index{b}. foo\index{c}. foo\index{d}. foo\index{e}. foo\index{f}.
foo\index{g}. foo\index{h}. foo\index{i}. foo\index{j}. foo\index{k}. foo\index{l}.
foo\index{m}. foo\index{ab}. foo\index{ac}. foo\index{asd}. foo\index{asddf}. foo\index{aasef}.
\printindex
\end{document}
这样做的好处是所有功能imakeidx
均可用。