0

See the following minimal working example

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{imakeidx}
\makeindex
\begin{document}
Hello world
\index{A@$A$ without norm of $A$}
\index{lAl@$|A|$ norm of $A$}
\printindex
\end{document}

My problem is that imakeidx and makeidx both ignore absolute values and norms in indexes. If you run this example, you will see that the index where the absolute value apears is just ignored by makeidx and does not appear in the index at the end. But I am making a symbol index, so this would be most necessary to include. How can I make it work?

2

It is not ignored, it is a syntax error reported in the makeindex log (ilg) file

!! Input index error (file = file.idx, line = 2):
   -- Extra `|' at position 8 of first argument.

By default | is a special character used to apply formatting to the output, you either need to quote the | or use a makeindex style that assigns some other character as the escape character.

enter image description here

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{imakeidx}
\makeindex
\begin{document}
Hello world
\index{A@$A$ without norm of $A$}
\index{lAl@$"|A"|$ norm of $A$}
\printindex
\end{document}
1

as an alternative to david carlisle's answer, using \lvert ... \rvert will avoid the syntax error.

(sorry i can't produce code or an image; the platform i'm on doesn't have tex available.)

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.