Text Formatting ⇒ makeidx
-
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
makeidx
I'm considering trying makeidx, but from a quick look at the documentation, it doesn't seem to allow for specification of the beginning and end of the indexed material. For instance, if it begins on p. 6 and ends of p. 7, the index should read 6 sq. or 6 f. Is this possible?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: makeidx
Yes, i think it is the standard.
Never had to work with indexes myself, so cannot be more specific without an example.
Never had to work with indexes myself, so cannot be more specific without an example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
makeidx
This is possible but not the default:
However, the makeindex program knows options for customization. The ones you're looking for here are
Here is an example:
I suggest you try to read the manual of the makeindex program for more information on customization.
Regards
Code: Select all
\documentclass{article}
\usepackage{imakeidx}% takes care of the call to the makeindex program; also
% provides a number of useful options for customization
\makeindex
\begin{document}
foo\index{foo}\newpage
foo\index{foo}
\printindex
\end{document}
suffix_2p
and suffix_3p
. Those need to be set in an index style file (ending ist
) and makeindex needs to be calledCode: Select all
makeindex -s name-of-style-file.ist
Code: Select all
\documentclass{article}
\usepackage{imakeidx}% takes care of the call to the makeindex program; also
% provides a number of useful options for customization
\usepackage{filecontents}
\begin{filecontents}{\jobname.ist}
suffix_2p "\\,f."
suffix_3p "\\,ff."
\end{filecontents}
\makeindex[options={-s \jobname.ist}]
\begin{document}
foo\index{foo}\newpage
foo\index{foo}
\printindex
\end{document}
Regards
site moderator & package author
-
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
Re: makeidx
Thank you. As I suspected this requires one to know beforehand where the pagebreaks are going to be. Besides, there is a difference between 7, 8 and 7 sq.; the former indicates two separate metions, the latter one continuous. Similarly with larger ranges, e.g. 7--9 ≠ 7, 8, 9.
makeidx
Why would that be? All pages where an item is indexed is recorded and makeindex formats the pagelist afterwards according to the specifications in the style file.Laurentius wrote:Thank you. As I suspected this requires one to know beforehand where the pagebreaks are going to be.
I don't think so but anyway… However, a page number is not mentioned more than once. So as how do you actually (from a reader's perspective as well as from makeindex's perspective) distinguish between the two cases?Laurentius wrote:Besides, there is a difference between 7, 8 and 7 sq.; the former indicates two separate metions, the latter one continuous. Similarly with larger ranges, e.g. 7--9 ≠ 7, 8, 9.
If an item occurs on page seven and eight and you haven't used
suffix_2p
then both pages are mentioned separately and if you have set it then this value is used. The same goes for suffix_3p
.If you actually want to indicate a range you usually input
Code: Select all
\index{foo|(}
...
\index{foo|)}
suffix_3p
then that value is used.Maybe xindy can distinguish between those two cases (I don't know as I've never used it) but makeindex can't.
Regards
site moderator & package author
-
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
Re: makeidx
Thanks again. I don't know what the traditional practice is, but the distinction is made in The Oxford Guide to Style.