質問: I'm creating a Japanese to English dictionary, using the glossaries package with xindy. Thanks to the answer here, I am able to put Japanese text in the name field of a glossary entry; eg. `\newglossaryentry{a}{name={\cjkname{あ}},description={a}}`. However, as xindy doesn't have Japanese in its list of languages, I've had to use Korean as a substitute. This in turn means that the entries won't be automatically sorted. I can work around this by assigning each character in the Japanese phonetic alphabet (Hiragana) with a Latin script entry, then using the `sort={}` field to sort entries. However it's far from ideal. Hence, I wish to create a Japanese phonetic alphabet (just using Hiragana is fine) that xindy can use to sort words. Other alphabets have been created, see International Phonetic Alphabet and Vietnamese. However, they have used Latin script. I'm not sure if I can simply replace those alphabets with Hiragana, or if I need to edit the Korean language files in xindy (`utf8.xdy` and `utf8-lang.xdy`), which look completely different from those in previously answered questions. I believe the correct sort order is as follows (see here); however this may not be correct, which is largely why I wish to create an alphabet, for which the sort order can be changed/corrected as necessary. ``` あ ぁ い ぃ う ぅ う ゙ え ぇ お ぉ か が き ぎ く ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た だ ち ぢ つ っ づ て で と ど な に ぬ ね の は ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み む め も や ゃ ゆ ゅ よ ょ ら り る れ ろ わ を ん ``` Below is a minimal example of some entries to be sorted. It can be compiled using xindy with korean, but of course it won't be sorted. ``` \documentclass{article} \usepackage{CJKutf8} \usepackage[overlap, CJK]{ruby} \renewcommand{\rubysep}{0.01ex} \usepackage[xindy={language={korean},glsnumbers=false},nopostdot,nonumberlist]{glossaries} \usepackage{glossary-mcols} \setglossarystyle{mcolindex} \makeglossaries \newrobustcmd{\cjkname}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}} \glsnoexpandfields \newglossaryentry{add}{ name={\cjkname{\ruby{足}{た}す}},%sort using たす description={plus / add}} \newglossaryentry{subtract}{ name={\cjkname{\ruby{引}{ひ}く}},%sort using ひく description={minus / subtract}} \newglossaryentry{multiply}{ name={\cjkname{かける}},%sort using かける description={times / multiply}} \newglossaryentry{divide}{ name={\cjkname{\ruby{割}{わ}る}},%sort using わる description={divide}} \begin{document} \glsaddall \printglossaries \end{document} ```
回答: If you want to display Japanese characters on LaTeX, simply use package bxcjkjatype. It works very well for me. The good news is, the package does not only work on Hiragana, but Katakana and Kanji as well. This is the example of simple code I created, containing all three kinds of Japanese letters, using package bxcjkjatype. I set my compiler to pdfLaTeX. ``` \documentclass{article} \usepackagewhole]{bxcjkjatype} \begin{document} 日本語が面白いです。コンピューターでもタイプされますよ。\\ Japanese is interesting. You can even type it in computer. \end{document} ``` The code above gave me result like this. ![bxcjkjatype package result display