Text Formatting ⇒ makeidx
-
Laurentius
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
makeidx
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: makeidx
Never had to work with indexes myself, so cannot be more specific without an example.
makeidx
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.istCode: 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
-
Laurentius
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
Re: makeidx
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
-
Laurentius
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm