我可以使用makeindex
但不排序吗?这个问题看起来很奇怪,但我想使用索引,而索引条目(例如\index{Peace}
在文档中)已经根据冰岛字母正确排序。原因是xindy
冰岛语的排序(目前)不正确(根据这个答案)
答案1
您的问题不是很清楚,但如果我从链接的问题中获取 MWE,并在字符串之前添加 ascii 近似值,@
那么 makeindex 就会按要求排序。(我的排序顺序可能不对,但想法是,如果顺序是 A Á B,则将 Á 更改为在 A 和 B 之间排序的任何内容(例如 A1),并将混乱的字符串放在前面,@
这样它仅用于排序。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[]{makeidx}
\usepackage[icelandic, czech]{babel}
\makeindex
\begin{document}
Hello
\index{z1ari@Þari - Franz Eugen Kohler, Public Domain}
\index{z1istill@Þistill - ŠARŽÍK František, COPYRIGHT/PD}
\index{O2nd@Önd - Karney, Lee, PD}
\index{a3d@Æðarkóngur - Whitehouse, Laura L., PD}
\index{Avo1@Avókadó - Forest \& Kim [[p:2684;Starr]], CC-BY}
\index{Aud1@Auðnutittlingur - Arnstein Rønning, CC BY-SA 3.0}
\index{Asni@Asni - Zicha Ondřej, COPYRIGHT/CC-BY-NC}
\index{A1@Á - hvalur.org, CC Unported Licence}
\index{A1lft@Álft - Bukovský Jiří, COPYRIGHT/CC-BY-NC}
\index{A1lka@Álka - Jack Spellingbacon from Scotland, CC BY-SA 3.0}
\printindex
\end{document}
答案2
不建议
以防万一有人需要创建索引而不进行排序xindy
。我将计数器中的数字添加到索引项中,它们将成为排序过程的一部分。无论如何,我们都会丢失字母组。
lualatex mal-xindy-nosorting.tex
xindy -M texindy -M makeindex mal-xindy-nosorting.idx
lualatex mal-xindy-nosorting.tex
生成的结果idx
如下:
\indexentry{1 dog@dog|hyperpage}{1}
\indexentry{2 mouse@mouse|hyperpage}{1}
\indexentry{3 horse@horse|hyperpage}{1}
\indexentry{4 cat@cat|hyperpage}{1}
\indexentry{5 bird@bird|hyperpage}{1}
\indexentry{6 girafa@girafa|hyperpage}{1}
\indexentry{7 zebra@zebra|hyperpage}{1}
\indexentry{8 jellyfish@jellyfish|hyperpage}{1}
\indexentry{9 lion@lion|hyperpage}{1}
\indexentry{10 cow@cow|hyperpage}{1}
\indexentry{11 octopus@octopus|hyperpage}{1}
\indexentry{12 ant@ant|hyperpage}{1}
\indexentry{13 worm@worm|hyperpage}{1}
\indexentry{14 wolf@wolf|hyperpage}{1}
\indexentry{15 owl@owl|hyperpage}{1}
该文件的内容ind
如下:
\begin{theindex}
\providecommand*\lettergroupDefault[1]{}
\providecommand*\lettergroup[1]{%
\par\textbf{#1}\par
\nopagebreak
}
\lettergroupDefault{default}
\item dog, \hyperpage{1}
\item mouse, \hyperpage{1}
\item horse, \hyperpage{1}
\item cat, \hyperpage{1}
\item bird, \hyperpage{1}
\item girafa, \hyperpage{1}
\item zebra, \hyperpage{1}
\item jellyfish, \hyperpage{1}
\item lion, \hyperpage{1}
\item cow, \hyperpage{1}
\item octopus, \hyperpage{1}
\item ant, \hyperpage{1}
\item worm, \hyperpage{1}
\item wolf, \hyperpage{1}
\item owl, \hyperpage{1}
\end{theindex}
我还将tex
文件和第 2 页的预览附在pdf
:
%! *latex mal-xindy-nosorting.tex
%! xindy -M texindy -M makeindex mal-xindy-nosorting.idx
%! *latex mal-xindy-nosorting.tex
\documentclass{article}
\pagestyle{empty}
\usepackage[colorlinks]{hyperref}
\usepackage{makeidx}
\makeindex
\begin{document}
The first paragraph of text.
\let\oldindex=\index
\newcount\malcount \malcount=0
\def\index#1{\advance\malcount by 1%
\oldindex{\the\malcount\space#1@#1}%
}% End of \index redefinition...
\index{dog}\index{mouse}\index{horse}
\index{cat}\index{bird}\index{girafa}\index{zebra}
\index{jellyfish}\index{lion}\index{cow}\index{octopus}
\index{ant}\index{worm}\index{wolf}\index{owl}
\begingroup\def\thispagestyle#1{}\printindex\endgroup
\end{document}