1

I have written a LaTex file and used makeindex to print out the index. But it looks like that makeindex can not print the subsubsub index entry.

Here is a MWE

\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage{makeidx}

\makeindex

\makeatletter
\newcommand{\subsubsubitem}{\@idxitem \hspace *{40\p@ }}
\makeatletter

\begin{document}
The directed angle \index{directed angle}  different from pi, bases
\index{directed angle!bases},  bases line
\index{directed angle!bases!bases line},
number part. \index{directed angle!bases!bases line!number part}

Các phần tử của $B(Ox,Oy)$ được gọi là các tia cơ sở
\index{cơ sở! của góc định hướng giữa hai tia-khác bẹt!tia cơ sở}             
\index{góc định hướng giữa hai tia-khác bẹt!cơ sở!tia cơ sở} của 
$(Ox, Oy)$. Mỗi tia cơ sở của $(Ox, Oy)$ có hai thành phần, 
thành phần thứ nhất-phần hình,\index{cơ sở!của góc định hướng giữa hai tia-khác bẹt!tia cơ sở!phần hình} 
\index{góc định hướng giữa hai tia-khác bẹt!cơ sở!tia cơ sở!phần hình} 
thành phần thứ hai-phần số.\index{cơ sở!của góc định hướng giữa hai tia-khác bẹt!tia cơ sở!phần số}
\index{góc định hướng giữa hai tia-khác bẹt!cơ sở!tia cơ sở!phần số}

\printindex
\end{document}

The entries numberpart does not appear in the index. Why?

Please help me.

Thanks.

UPDATE Since I still get trouble with my original writing, I have to edit and provide the more accurate MWE. Sorry for this unconvinience and please help me. Thanks.

  • 1
    Only three levels are supported, I'm afraid. – egreg Aug 27 '14 at 9:45
  • 1
    xindy doesn't have a restriction on the number of nested levels, so if you're happy to switch from makeindex to xindy that may be an option. – Nicola Talbot Aug 27 '14 at 9:51
  • @NicolaTalbot Could you please modify my MWE in case of xindy? Thanks. – Knumber10 Aug 27 '14 at 15:16
3

Your example needs to be trimmed down to a minimal example:

\documentclass{article}

\usepackage{makeidx}

\makeindex

\begin{document}
The directed angle \index{directed angle}  different from pi, bases
\index{directed angle!bases},  bases line
\index{directed angle!bases!bases line},
number part. \index{directed angle!bases!bases line!number part}

\printindex
\end{document}

To switch from makeindex to xindy, instead of running makeindex, you need to run texindy. The simplest form (assuming your document is called myDoc.tex is):

texindy myDoc.idx

However in this case you need to do two things: first provide a xindy style that will add uses, say, \subsubsubitem for level 3 and second define this new command in your document.

For the first part, create a file called, say, mystyle.xdy that contains the line:

(markup-indexentry :open "~n        \subsubsubitem " :depth 3)

Now add a definition of \subsubsubitem to your document. For example:

\documentclass{article}

\usepackage{makeidx}

\makeindex

\makeatletter
\newcommand{\subsubsubitem}{\@idxitem \hspace *{40\p@ }}
\makeatletter

\begin{document}
The directed angle \index{directed angle}  different from pi, bases
\index{directed angle!bases},  bases line
\index{directed angle!bases!bases line},
number part. \index{directed angle!bases!bases line!number part}

\printindex
\end{document}

Now when you run texindy you need to specify the new style file (mystyle.xdy) using the -M switch (and omit the .xdy extension):

texindy -M mystyle myDoc.idx

The index now looks like:

Index with four levels

  • Thank you very much for your answer. In fact, I used Vietnamese in my document, and it happened that the fourth element like number part in Vietnamese doesnot go down the line but stay the same line as bases line as in the following picture: dropbox.com/s/yy0dbpm0soojw77/screenshot.png?dl=0 I guess it is the problem with Vietnamese character, and I will edit the MWE. Please help me. Thanks. – Knumber10 Aug 29 '14 at 3:19
  • @NguyễnDuyKhánh Your updated MWE works fine for me. Check that the .ind file contains \subsubsubitem. Did you try the MWE I provided in my answer (and, if so, did it match the image shown there)? – Nicola Talbot Aug 30 '14 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.