In the index of my Japanese document, I want each entry to consist of:
- The English name of the Japanese character (left-aligned)
- The Japanese character itself (left-aligned)
- The page number on which the associated entry can be found (right-aligned)
The information inside the parentheses above gives the horizontal alignment of each entry.
After fiddling with the code provided in this solution, I made some progress but stumbled into other problems:
- The index is not splitting over 4 columns as stipulated in the \makeindex command.
- There is a pagebreak between the index title and contents.
I'm not very fluent in constructing style files, and would really appreciate a solution accompanied with clear explanations (as far as possible). I also find the bottom table in this link a bit difficult to interpret.
In the code block below is my MWE. For the sake of thoroughness, I included many index entries to test the robustness of my code.
\documentclass[10pt, a4paper]{ltjbook}
\usepackage{luatexja}
\usepackage[left=1.9cm,right=1.9cm,bottom=1.5cm,top=1.5cm]{geometry}
\usepackage{array,longtable,supertabular,booktabs,multicol,multirow}
\usepackage{tabularx}
\usepackage{hhline}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage{imakeidx}
\setlength{\columnseprule}{0.4pt}
\begin{filecontents}{general.ist}
headings_flag 5
heading_prefix "\n\rmfamily\textbf{"heading_suffix "} "
preamble "\chapter{\indexname}%
\newcommand\ignoreNL[1]{}%
\begin{tabular}{llr} "
postamble " \end{tabular} "
item_0 "\\\n "
delim_0 "&"
delim_1 "\hfill "
group_skip "\n \\[5pt] \ignoreNL "
\end{filecontents*}
\makeindex[name=gen, title={Index of Kanji}, columns=4, columnseprule, options=-s general.ist]
\newcommand{\gindex}[2]{\index[gen]{#1 & #2}}
\begin{document}
\Blindtext
\gindex{One}{一}
\gindex{Two}{二}
\gindex{Three}{三}
\Blindtext
\gindex{Four}{四}
\gindex{Five}{五}
\gindex{Six}{六}
\gindex{Seven}{七}
\gindex{Eight}{八}
\gindex{Nine}{九}
\blindtext
\gindex{Ten}{十}
\gindex{Eleven}{十一}
\gindex{Twelve}{十二}
\gindex{Thirteen}{十三}
\gindex{Fourteen}{十四}
\gindex{Fifteen}{十五}
\gindex{Sixteen}{十六}
\gindex{Seventeen}{十七}
\gindex{Eighteen}{十八}
\gindex{Nineteen}{十九}
\gindex{Twenty}{二十}
\gindex{Mouth}{口}
\gindex{Neck}{首}
\gindex{Head}{頭}
\gindex{Lips}{唇}
\gindex{Arms}{腕}
\gindex{Feet}{足}
\gindex{Sunday}{日曜日}
\gindex{Monday}{月曜日}
\gindex{Tuesday}{火曜日}
\gindex{Wednesday}{水曜日}
\gindex{Thursday}{木曜日}
\gindex{Friday}{金曜日}
\gindex{Saturday}{土曜日}
\gindex{Wind}{風}
\gindex{Water}{水}
\gindex{Fire}{火}
\gindex{Flower}{花}
\blindtext
\gindex{East}{東}
\gindex{South}{南}
\gindex{North}{北}
\blindtext
\gindex{West}{西}
\printindex[gen]
\end{document}
>>EDIT: 29 January 2022<<
After working with the entire document, the first page of the index is producing an anomaly as seen below. Any help?



longtableruins the internal LaTeX parameter\@colroom, whichmulticolsneeds to break the text into columns. So save\@colroombefore thelongtableand restore it after. See my update. Don't forget to deletegeneral.istbefore running this otherwise you will still use the old version. – Pieter van Oostrum Jan 30 '22 at 18:53clonethis GitHub link and work with the tuttle.tex file... Please give met your GitHub profile name so that I may add you as a collaborator. – Henri Branken Jan 31 '22 at 07:21