答案1
中有一个拼写错误manyind.sty
,基本上就在 的开头\AtBeginDocument{...}
:
\protected@write
\@indexfile {}{\string \indexentry
{\ind@nr#1 }{\thepage}}%
\endgroup
必须改为
\protected@write
\@indexfile {}{\string \indexentry
{\ind@nr #1}{\thepage}}%
\endgroup
\ind@nr
即和之间的空间#1
在这里确实很重要。
以下代码修复了这个问题。
\documentclass{book}
\usepackage{blindtext}
\usepackage{manyind}
\makeatletter
\AtBeginDocument{\def\ind@nr#1{\string\indnr\mindchoice d\gr@bltr#1-\relax b #1}%
\ifx\@@wrindex\undefined
\def\@wrindex#1{\@bsphack
\protected@write
\@indexfile {}{\string \indexentry
{\ind@nr #1}{\thepage}}%
\endgroup
\@esphack}%
\else
\def\@wrindex#1{\@@wrindex\ind@nr#1||\\}%
\fi
\setindex{main}}%
\makeatother
%\usepackage{makeidx}
\makeindex
\begin{document}
\blindtext[1]\index{abc} \index{cdef}
\printindex
\end{document}