I'm busy making a document on Japanese Kanji characters.
I want one Index (among several others) to have a specific format:
- Kanji must be categorised according to "Stroke Count"
- The Kanji itself, should be flushed to the left under it's respective category.
- The page number on which the Kanji can be found, should be flushed to the right.
This image is a good example of what I'm trying to achieve:
I had a stab at producing the output I want, but to be frank it looks rather ugly. In the code block below you'll find a MWE:
\documentclass[10pt, a4paper]{ltjbook}
\usepackage{luatexja}
\usepackage{imakeidx}
\makeindex[name=stroke, columns=4, title={Index of 漢字 by Stroke Count}, intoc, columnseprule]
\newcommand{\strindex}[2]{\index[stroke]{#1@#1!#2}}
%-------------------------------------------------------
%-------------------------------------------------------
%-------------------------------------------------------
\begin{document}
The kanji for dry, 干, consists of 3 strokes.\strindex{3}{干}
The kanji for gold, 金, consists of 8 strokes.\strindex{8}{金}
Words > 語 > 14 strokes.\strindex{14}{語}
Gentleman > 士 > 3 strokes.\strindex{3}{士}
Morning > 朝 > 12 strokes.\strindex{12}{朝}
Blue > 青 > 8 strokes.\strindex{8}{青}
Earth > 土 > 3 strokes.\strindex{3}{土}
Hang > 掛 > 11 strokes.\strindex{11}{掛}
Ten Thousand > 万 > 3 strokes.\strindex{3}{万}
\printindex[stroke]
\end{document}
Edit 1 on 2021/04/29:
In addition to the question above, it would also be very helpful to know a solution whose format conforms to the one given in this solution for the sake of consistency. What I'm specifically referring to includes:
- A 'Group Demarcation' that is bold and also a slightly larger font than the entries belonging to that group.
- Vertical whitespace between different groups.
- A configuration that prevents a column/page break between the 'Group Demarcation' and the first entry below it.
Please see the image below as a reference guide:
Edit 2 on 2021/05/01:
With reference to the image below: Is there a way I can modify item_x1
to prevent a break between a new category and its first entry?
mendex
orupmendex
. They aren't supported byimakeidx
for lack of knowledge about them, as the documentation formendex
is only in Japanese.