我得到了一个不愉快的结果makeindex
:
\documentclass[fontsize=12pt,twoside,parskip=half]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[makeindex]{imakeidx}
\makeindex[title=Register,options={-g lp3.ist},options={-s lp3.ist}]
\begin{document}
This is a short Test.
\index{apple}
\index{Number}
\index{$\alpha$}
\index{7}
\index{7 the Borg}
\index{seven the Borg}
\index{soeven@söven}
\printindex
\end{document}
和lp3.ist:
quote '+'
headings_flag 1
symhead_positive "Symbols"
numhead_positive "Numbers"
heading_prefix "{\\textbf "
heading_suffix "}\\nopagebreak%\n \\indexspace\\nopagebreak%"
delim_0 "\\dotfill "
delim_1 "\\dotfill "
delim_2 "\\dotfill "
delim_r "~--~"
suffix_2p "\\,f"
suffix_3p "\\,ff"
preamble
"\\markright{INDEX}\n\n\\begin{theindex}\n\\thispagestyle{headings}\n"
postamble "\n\n\\end{theindex}\n"
我期待着7.博格人在数字下逐项列出,但不是在符号下。我怎样才能实现这一点?
附录:只要我能得到正确且细致的指数,我愿意接受任何解决方案。
答案1
如果您想要将某个项目归类为数字,则它应该仅由数字组成。根据规则规定,如果索引词的形式为
<pre>@<post>
该部分<pre>
用于排序,因此该部分必须仅由数字组成。
这是一个可能的解决方法。
\documentclass[fontsize=12pt,twoside,parskip=half]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{imakeidx}
\makeindex[title=Register]
\newcommand{\numindex}[2]{%
\begingroup\edef\y{\pdfescapehex\expandafter{\detokenize{#2}}}%
\edef\x{\endgroup
\noexpand\index{#1#1#1\expandafter\converthex\y 00000000\relax @\unexpanded{#1 #2}}%
}\x
}
\def\converthex#1#2#3#4#5#6#7#8#9\relax{\number"#1#2#3#4#5#6#7#8}
\begin{document}
This is a short Test.
\index{apple}
\index{Number}
\index{$\alpha$}
\index{7}
\numindex{7}{the Borg}
\numindex{7}{se Borg}
\numindex{8}{söven}
\index{seven the Borg}
\index{soeven@söven}
\printindex
\end{document}