Text Formatting ⇒ makeidx
-
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm
makeidx
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- 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.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
-
- 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
-
- Posts: 132
- Joined: Wed Feb 11, 2009 11:38 pm