Text FormattingText Font Family Specification in Index

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
tedc
Posts: 1
Joined: Wed Sep 14, 2011 2:44 am

Text Font Family Specification in Index

Post by tedc »

I'm trying to create an index that preserves the font families used in the body of the document. For example, the keyword AlphaClass appears in Typewriter in the body of the document, and the corresponding entries in the index should be

Code: Select all

AlphaClass, 20
  parameters, 25
where AlphaClass is in Typewriter and parameters is in Roman.
\index{AlphaClass@texttt{AlphaClass}}
generates the entry for page 20, and
\index{AlphaClass@texttt{AlphaClass}!parameters}
generates the entry for page 25.
BUT the index looks like this:

Code: Select all

AlphaClass, 20
AlphaClass
  parameters, 25
Both "AlphaClass"es are in Typewriter, and "parameters" is in Roman, but sorting is not correct. How can I fix this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Text Font Family Specification in Index

Post by nlct »

The following works fine for me:

Code: Select all

\documentclass{article}

\usepackage{makeidx}

\makeindex

\begin{document}
AlphaClass\index{AlphaClass@\texttt{AlphaClass}}.

\newpage
AlphaClass parameters\index{AlphaClass@\texttt{AlphaClass}!parameters}.

\printindex
\end{document}
Can you produce a minimal example that reproduces the problem?

Regards
Nicola Talbot
Post Reply