0

THIS IS NOT A DUPLICATE OF THE FOLLOWING ANSWERS!

  1. Makeindex cannot generate subsubsub.. index entries

  2. How to Permit 4-Level Deep Index Entries (was, "Why are Index Entries Rejected?"}

  3. Creating an index with sub-sub-subentries

I am writing an index using imakeidx package and I require of additional level into index: I tried to implement or use the solutions into the above linked answers but they do not work strangely so that I thought to put a specific question where I ask a solution pointing out the following items:

  • I have to compile with XelaTeX or LualaTeX since I uploaded fontspec package;
  • I use TeXstudio;
  • I tried to switch to texindy executable without successful;
  • I require the index must be divided (as into a dictionary) into "alphabetical" sections ordered by usual lexicographic (alphabetical) order.

So I tried to use the code below which use markup command but it does not work since it does not print the following nested sequence.

\index{Animal! Mammals! Primates! Humans}

Could someone help me, please?

MY ATTEMPT

\documentclass[10pt]{report}

\usepackage{imakeidx}

\usepackage{filecontents} \begin{filecontents*}{index_style.ist} headings_flag 1

(markup-locref :open "\hyperpage{" :close "}")

(markup-index :open  "~n\begin{theindex}~n"
    :close "~n\end{theindex}~n"
:tree
)
(markup-indexentry :open "~n \def\tedLevel{0} \item "            :depth 0)
(markup-indexentry :open "~n \def\tedLevel{1}     \subitem "      :depth 1)
(markup-indexentry :open "~n \def\tedLevel{2}       \subsubitem " :depth 2)
(markup-indexentry :open "~n \def\tedLevel{3}           \subsubsubitem " :depth 3)

heading_prefix "\n\\large\\bfseries

\\normalfont\\noindent\\textbf{"heading_suffix "}\\par\\nopagebreak\n"

item_0 "\n \\item \\normalsize "

delim_0 " \\dotfill "
delim_1 " \\dotfill "
delim_2 " \\dotfill "

\end{filecontents*}

\makeatletter \providecommand{\subsubsubitem}{@idxitem\hspace*{40\p@}} \makeatother

\makeindex[title = Analytical index, columns = 2, columnseprule = true, options = -s index_style.ist, intoc = true]

\begin{document} This is a Texts.

\index{Animal}
\index{Animal!Mammals}
\index{Animal!Mammals!Primates}
\index{Animal!Mammals!Primates!Humans}
\printindex

\end{document}

N.B.

If you need, here you can see my complete preamble.

  • 1
    Do not show lots of small snippets make a small, complete example. Remove all irrelevant packages (like skak or bbding and others). – Ulrike Fischer Feb 11 '24 at 22:27
  • @UlrikeFischer I just edited the question: I hope it is more clear now. – Antonio Maria Di Mauro Feb 12 '24 at 14:44
  • 1
    that is still not a complete example that one can compile. – Ulrike Fischer Feb 12 '24 at 14:50
  • @UlrikeFischer I put a complete executable code putting at the end a mega-link where it is possibile to download my complete preamble, provided you need it: I hope now the question it is complete; forgive my previous roughness. – Antonio Maria Di Mauro Feb 12 '24 at 15:08
  • 2
    @AntonioMariaDiMauro, you probably can reduce your MWE to 10-20 lines of code ... For guidance, kindly run through this checklis: https://tex.meta.stackexchange.com/a/10137/245790 . Please remove all those distracting thingies we really don't need to understand, reproduce and solve your problem. Thank you. – MS-SPO Feb 12 '24 at 15:52
  • 1
    @MS-SPO I think now I deleted all unnecessary packages to run the code, fontspec included. Forgive for my mistake: I hope now the code is more readble. Thanks for the linked rulebook! – Antonio Maria Di Mauro Feb 12 '24 at 16:07
  • @AntonioMariaDiMauro, thank you, code-wise this looks better now. // However, why do you touch index_style.ist at all? – MS-SPO Feb 12 '24 at 16:40
  • @MS-SPO If you refer to the extension I can say that I originally used makeindex program and this is my "original" code: however using xindy and so .xdy extesion nothing changes unfortunately. – Antonio Maria Di Mauro Feb 12 '24 at 16:48

0 Answers0