另请参阅 xindy/imakeidx 中的条目因 hyperref 而消失?

另请参阅 xindy/imakeidx 中的条目因 hyperref 而消失?

我认为我在 imakeidx、xindy 和 hyperref 的某些组合中遇到了错误,但我不知道是哪一个。以下最小示例生成一个空索引,即使它应该有一个索引条目:

\documentclass{article}
\usepackage[xindy]{imakeidx}
\usepackage{hyperref}
\makeindex
\begin{document}
  Text. 
  \index{A|seealso{B}}
  \printindex
\end{document}

它应该有条目“A,另见 B”,但它却生成了一个空索引。如果您删除“hyperref”包或将其移到“imakeidx”之前,它就可以正常工作,但无论哪种情况,其他索引条目都没有链接回 pdf 中的页面。

我在这里做错了什么吗?(​​显然这只是一个最小的例子,但在实际文档中,我的所有 seealso 条目都消失了,这是一个问题。)如果没有,我应该向哪个软件包报告这个错误?

编辑以添加:日志文件:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=pdflatex 2021.2.27)  8 MAR 2021 08:50
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**bugtest.tex
(./bugtest.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-01-09> xparse <2020-03-03>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count177
\c@section=\count178
\c@subsection=\count179
\c@subsubsection=\count180
\c@paragraph=\count181
\c@subparagraph=\count182
\c@figure=\count183
\c@table=\count184
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(/usr/share/texlive/texmf-dist/tex/latex/imakeidx/imakeidx.sty
Package: imakeidx 2016/10/15 v1.3e Package for typesetting indices in a synchro
nous mode

(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2020/11/20 v2.8 package option processing (HA)

(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks15
\XKV@tempa@toks=\toks16

(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count185
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifxetex.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.

(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
))
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
)
(/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty
Package: multicol 2019/12/09 v1.8y multicolumn formatting (FMi)
\c@tracingmulticols=\count186
\mult@box=\box47
\multicol@leftmargin=\dimen139
\c@unbalance=\count187
\c@collectmore=\count188
\doublecol@number=\count189
\multicoltolerance=\count190
\multicolpretolerance=\count191
\full@width=\dimen140
\page@free=\dimen141
\premulticols=\dimen142
\postmulticols=\dimen143
\multicolsep=\skip49
\multicolbaselineskip=\skip50
\partial@page=\box48
\last@line=\box49
\maxbalancingoverflow=\dimen144
\mult@rightbox=\box50
\mult@grightbox=\box51
\mult@gfirstbox=\box52
\mult@firstbox=\box53
\@tempa=\box54
\@tempa=\box55
\@tempa=\box56
\@tempa=\box57
\@tempa=\box58
\@tempa=\box59
\@tempa=\box60
\@tempa=\box61
\@tempa=\box62
\@tempa=\box63
\@tempa=\box64
\@tempa=\box65
\@tempa=\box66
\@tempa=\box67
\@tempa=\box68
\@tempa=\box69
\@tempa=\box70
\@tempa=\box71
\@tempa=\box72
\@tempa=\box73
\@tempa=\box74
\@tempa=\box75
\@tempa=\box76
\@tempa=\box77
\@tempa=\box78
\@tempa=\box79
\@tempa=\box80
\@tempa=\box81
\@tempa=\box82
\@tempa=\box83
\@tempa=\box84
\@tempa=\box85
\@tempa=\box86
\@tempa=\box87
\@tempa=\box88
\@tempa=\box89
\@tempa=\box90
\c@minrows=\count192
\c@columnbadness=\count193
\c@finalcolumnbadness=\count194
\last@try=\dimen145
\multicolovershoot=\dimen146
\multicolundershoot=\dimen147
\mult@nat@firstbox=\box91
\colbreak@box=\box92
\mc@col@check@num=\count195
))
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2020-05-15 v7.00e Hypertext links for LaTeX

(/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)
(/usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
)
(/usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
)
(/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
(/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
)
\@linkdim=\dimen148
\Hy@linkcounter=\count196
\Hy@pagecounter=\count197

(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2020-05-15 v7.00e Hyperref: PDFDocEncoding definition (HO)
Now handling font encoding PD1 ...
... no UTF-8 mapping file for font encoding PD1
)
(/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count198
Package hyperref Info: Hyper figures OFF on input line 4464.
Package hyperref Info: Link nesting OFF on input line 4469.
Package hyperref Info: Hyper index ON on input line 4472.
Package hyperref Info: Plain pages OFF on input line 4479.
Package hyperref Info: Backreferencing OFF on input line 4484.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4717.
\c@Hy@tempcnt=\count199

(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 5076.
\XeTeXLinkMargin=\dimen149

(/usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)

(/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO
)
))
\Fld@menulength=\count266
\Field@Width=\dimen150
\Fld@charsize=\dimen151
Package hyperref Info: Hyper figures OFF on input line 6347.
Package hyperref Info: Link nesting OFF on input line 6352.
Package hyperref Info: Hyper index ON on input line 6355.
Package hyperref Info: backreferencing OFF on input line 6362.
Package hyperref Info: Link coloring OFF on input line 6367.
Package hyperref Info: Link coloring with OCG OFF on input line 6372.
Package hyperref Info: PDF/A mode OFF on input line 6377.
LaTeX Info: Redefining \ref on input line 6417.
LaTeX Info: Redefining \pageref on input line 6421.

(/usr/share/texlive/texmf-dist/tex/latex/base/atbegshi-ltx.sty
Package: atbegshi-ltx 2020/08/17 v1.0a Emulation of the original atbegshi packa
ge
with kernel methods
)
\Hy@abspage=\count267
\c@Item=\count268
\c@Hfootnote=\count269
)
Package hyperref Info: Driver (autodetected): hpdftex.

(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2020-05-15 v7.00e Hyperref driver for pdfTeX

(/usr/share/texlive/texmf-dist/tex/latex/base/atveryend-ltx.sty
Package: atveryend-ltx 2020/08/19 v1.0a Emulation of the original atvery packag
e
with kernel methods
)
\Fld@listcount=\count270
\c@bookmark@seq@number=\count271

(/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)

(/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
86.
)
\Hy@SectionHShift=\skip51
)
\bugtest@idxfile=\write3
\openout3 = `bugtest.idx'.


Writing index file bugtest.idx
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2020-01-29 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count272
\l__pdf_internal_box=\box93
)
(./bugtest.aux)
\openout1 = `bugtest.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
Package hyperref Info: Link coloring OFF on input line 7.
 (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2019/09/16 v2.46 Cross-referencing by name of section

(/usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty
Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO)
)
(/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO)
)
\c@section@level=\count273
)
LaTeX Info: Redefining \ref on input line 7.
LaTeX Info: Redefining \pageref on input line 7.
LaTeX Info: Redefining \nameref on input line 7.

(./bugtest.out) (./bugtest.out)
\@outlinefile=\write4
\openout4 = `bugtest.out'.

 [1

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./bugtest.ind)

Package imakeidx Warning: Remember to run (pdf)latex again after calling
(imakeidx)                `texindy bugtest.idx'.

[2

] (./bugtest.aux)
Package rerunfilecheck Info: File `bugtest.out' has not changed.
(rerunfilecheck)             Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
 ) 
Here is how much of TeX's memory you used:
 4843 strings out of 481176
 77069 string characters out of 5914226
 372483 words of memory out of 5000000
 21735 multiletter control sequences out of 15000+600000
 404035 words of font info for 29 fonts, out of 8000000 for 9000
 59 hyphenation exceptions out of 8191
 71i,4n,74p,234b,315s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></us
r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on bugtest.pdf (2 pages, 19849 bytes).
PDF statistics:
 26 PDF objects out of 1000 (max. 8388607)
 19 compressed objects within 1 object stream
 4 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

.idx 文件:

\indexentry{A|hyperindexformat{\seealso{B}}}{1}

.ind 文件:

\begin{theindex}
  \providecommand*\lettergroupDefault[1]{}
  \providecommand*\lettergroup[1]{%
      \par\textbf{#1}\par
      \nopagebreak
  }


\end{theindex}

答案1

我在这里将答案记录下来,以供后人参考。

tldr:这是 xindy 中的一个已知错误,似乎不太可能修复。

xindy 自 2014 年以来似乎没有得到积极维护。它最初托管在https://sourceforge.net/projects/xindy/ 。这里仍然是大多数 xindy 错误报告的存档位置。此错误记录在https://sourceforge.net/p/xindy/bugs/62/ ,它本身指向 2009 年关于该内容的邮件列表帖子。

xindy 的最新版本 2.5.1 发布在 CTAN 上,似乎是从https://github.com/jschrod/xindy.ctan。有一个修复此错误的拉取请求(https://github.com/jschrod/xindy.ctan/pull/6) 也自 2009 年以来一直如此。

Debian 打包团队维护了一个 Debian 打包分支,网址为https://github.com/debian-tex/xindy。我会看看他们是否愿意应用拉取请求。

相关内容