0

Consider the following code

\documentclass{article}
\usepackage{makeidx}
\makeindex
\usepackage{filecontents}

\begin{filecontents}{\jobname.mst}
suffix_2p "~sq."
suffix_3p "~sqq."
\end{filecontents}

\begin{document}
Text.\index{A word}
\clearpage
Text.\index{A word}

Text2.\index{Another word}
\clearpage
Text2.\index{Another word}
\clearpage
Text2.\index{Another word}

\printindex
\end{document}

which produces the index:

enter image description here

Question: How may I modify the code in order to have a comma follow each page number in the index? i.e., 1, sq.' and 2, sqq.'

4
  • suffix_2p ",~sq." and same for _3p or do you mean something else? Commented Jun 21, 2021 at 21:05
  • @David Carlisle I'm not sure what you mean. If the index entry spans two pages, I would like sq. to appear; and over three pages, sqq. to appear---which the output already produces. Is there something I am not seeing? Thank you.
    – DDS
    Commented Jun 21, 2021 at 21:28
  • I just added a comma before your ~ in the makindex style so that you get a comma before the space in the output, but that seemed too simple, so I wasn't sure if I understood the question. Commented Jun 21, 2021 at 21:41
  • @David Carlisle Many thanks! That seems to work just fine.
    – DDS
    Commented Jun 21, 2021 at 21:48

1 Answer 1

0

You can simply add the commas to your makeindex style so

\begin{filecontents}{\jobname.mst}
suffix_2p ",~sq."
suffix_3p ",~sqq."
\end{filecontents}

You must log in to answer this question.

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