Following this question, I have a new challenge for you ! Quick summary :

For a given index entry appearing on pages 1 to 4, I need page ranges on my index to appear as " 1 s." and not "1--4".

This was the answer, using a .ist file with this piece of code :

suffix_2p " s"
suffix_3p " s"
suffix_mp " s"

BUT: here is the trick. If the page ranges are part of a longer list here is the wanted result :

Word, 1, 4, 7 s., 12, 15 s.

Right now, I can get :

Word, 1, 4, 7 s., 12, 15 s..

Or :

Word, 1, 4, 7 s, 12, 15 s.

Does anyone have any idea on this ?

Here is my code :


headings_flag 1
delim_0 "} , "
delim_1 ", "
delim_2 ", "
delim_t ". "
item_0 "\n  \\item \\textbf{"
item_1 "\n    \\subitem "
item_01 "\n    \\subitem "
item_x1 "}.\n    \\subitem "

suffix_2p " s."
suffix_3p " s."
suffix_mp " s."


\usepackage[paperheight=240mm,paperwidth=160mm, left=22mm, right = 20mm, top = 20mm, bottom = 22mm]{geometry}



\newcommand\numsubpara[1]{\vspace{0.5cm}\par\refstepcounter{subpara} \fontsize{10}{12}\selectfont \thesubpara. \fontsize{12}{12}\selectfont \space#1\space\vspace{0.3cm}\\  \fontsize{12}{12}\selectfont}



\renewcommand*{\alsoname}{V. aussi}



\makeindex[name=MyIndex, options= -s alphab.ist]%

  %level=\chapter,% <-- already default





\newpage bla \newpage bla \chapter{Test3} \numsubpara{title3} \Index{Bla} \chapter{Test4} \numsubpara{title4} \Index{Bla}




1 Answer 1


That's not difficult, actually. Change the .ist to have

suffix_2p " s\\maybeadddot"
suffix_3p " s\\maybeadddot"
suffix_mp " s\\maybeadddot"

and add the following in a \makeatletter context:


This way, s will be followed by \maybeadddot in the .ind file; if it is followed by a period, the macro does nothing, otherwise it prints a period.

  • You are too good... Well played and thank you !
    – Guliup
    May 7, 2020 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .