%20%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AB%E5%A5%87%E5%A6%99%E3%81%AA%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%20(%5Cmitchi)%20%E3%81%8C%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B.png)
私の LaTeX 文書では、次のように記述します。
\index{chi@$\chi^2$-score}
別の場所ではこう書いています:
\index{chi@$\chi^2$-score|textbf}
最初の部分は、idx
予想どおりにファイル内でレンダリングされます。
\indexentry{chi@$\chi^2$-score|hyperpage}{39}
しかし、2番目はidx
ファイル内で次のように表示されます。
\indexentry{chi@$\mitchi ^2$-score|hyperindexformat{\textbf}}{55}
一体何ですか\mitchi
? Web 検索では何も役に立ちません...これは有効な LaTeX コマンドなのでしょうか? 有効なコマンドであるに違いありません... 結果の PDF でインデックスが正しくレンダリングされるからです。
両方のインデックス エントリがインデックスに表示され、正しくフォーマットされていますが、異なるエントリとして表示されます (当然です)。
誰か助けてくれませんか? 謎の $\mitchi$ はどこから来たのでしょうか? そしてそれは何でしょうか?
P.
答え1
使用可能な例を示していませんが、おそらくunicode-math
またはそれと互換性のあるパッケージを使用していると思われます。
unicode-math
定義:
\UnicodeMathSymbol{"1D712}{\mitchi }{\mathalpha}{mathematical italic small chi}%
つまり、U+1D712はメートルアスそれアリクカイ、\mitchi
。
答え2
問題は簡単に再現できます:
\documentclass{article}
\usepackage{makeidx}
\usepackage{unicode-math}
\usepackage{hyperref}
\makeindex
\begin{document}
Here's a $\chi$\index{chi@$\chi^2$-score}
\textbf{Here's a $\chi$\index{chi@$\chi^2$-score|textbf}}
\printindex
\end{document}
\index
が別のコマンドの引数に含まれている場合、LaTeX は外部レベルで使用できる「semiverbatim」モードを使用できません。
実際、ファイル内のエントリidx
は
\indexentry{chi@$\chi^2$-score|hyperpage}{1}
\indexentry{chi@$\mitchi ^2$-score|hyperindexformat{\textbf}}{1}
@
あなたが行っているように、複雑なインデックス エントリを常に使用している場合、「semiverbatim」モードは通常必要ありません。
\documentclass{article}
\usepackage{makeidx}
\usepackage{unicode-math}
\usepackage{hyperref}
\makeindex
\NewCommandCopy{\oldindex}{\index}
\RenewDocumentCommand{\index}{m}{\oldindex{#1}}
\begin{document}
Here's a $\chi$\index{chi@$\chi^2$-score}
\textbf{Here's a $\chi$\index{chi@$\chi^2$-score|textbf}}
\printindex
\end{document}
.idx
ファイルの内容
\indexentry{chi@$\mitchi ^2$-score|hyperpage}{1}
\indexentry{chi@$\mitchi ^2$-score|hyperindexformat{\textbf}}{1}