Skip to content

Instantly share code, notes, and snippets.

@aminophen
Last active March 3, 2019 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aminophen/72ec44c3593fbc30b2c0c6526deb8189 to your computer and use it in GitHub Desktop.
Save aminophen/72ec44c3593fbc30b2c0c6526deb8189 to your computer and use it in GitHub Desktop.
Japanese index (using LuaLaTeX and Mendex)
%% jgind.ist written by Hironobu Yamashita (@aminophen)
% to customize this, please refer to
% mendex.1 (or, mendex.man1.pdf).
%% enable letter header.
lethead_flag 1
%% print letter header in Hiragana
%% (default = 1: Katakana)
letter_head 2
% eof
%% ltjindex.tex written by Hironobu Yamashita (@aminophen)
\documentclass{ltjsarticle}
\usepackage{makeidx}
\makeindex
\begin{document}
免疫\index{めんえき@免疫}とは,例外をおそれずにいえば,体内に入ってきた細菌や
ウィルス(非自己\index{ひじこ@非自己}\footnote{抗原\index{こうげん@抗原}と総称される。})
といった自己にとって危険な要素を徹底的に排除しようと試みる際に,脳以上に主導権を握っている
生体防御機構\index{せいたいぼうぎょきこう@生体防御機構}である。
\printindex
\end{document}
@aminophen
Copy link
Author

How to typeset this:

$ lualatex ltjindex
$ mendex -U -s jgind.ist ltjindex
$ lualatex ltjindex

The output index:

ltjindex-hira

Note that Kanji characters are sorted according to its reading.

@aminophen
Copy link
Author

Here is my ltjindex.ind, which can be obtained from the method above:

\begin{theindex}
こ
  \item 抗原, 1

  \indexspace
せ
  \item 生体防御機構, 1

  \indexspace
ひ
  \item 非自己, 1

  \indexspace
め
  \item 免疫, 1

\end{theindex}

@aminophen
Copy link
Author

Origin of this: TeX.SX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment