I want to have my index (using imakeidx) at the beginning of my document, so for that I need to use the nonewpage option. I also want to right-align the page numbers in the index with dots in-between, so I created the .ist file
delim_0 "\\dotfill"
However, the nonewpage option prevents the .ist file from running properly. For example:
\documentclass{article}
\usepackage[nonewpage]{imakeidx} % taking out nonewpage lets the ist file put dots in
\makeindex[options=-s debugging]
\begin{document}
Some text
\index{refer}
\index{Howsit}
\printindex
\end{document}
Can I achieve both an index at the front of the document, as well as having dots leading up to right-aligned page numbers?

nonewpageyou have to runmakeindexmanually. – egreg Sep 11 '17 at 20:43nonewpageputs the dots in without running themakeindexseparately. – ahorn Sep 11 '17 at 20:48makeindex -s debugging <filename>in the second step: when you runmakeindexmanually it knows nothing about the options given to\makeindex. – egreg Sep 11 '17 at 20:49makeindex -s debuggingon the second line of the .ist file? I also named the .tex file debugging. – ahorn Sep 11 '17 at 21:02-s debuggingbit should go on the command line you callmakeindexwith. – egreg Sep 11 '17 at 21:05pdflatexagain. – egreg Sep 11 '17 at 21:21debugging(the file name is also debugging). It then worked. It's the first time I'm doing this, so thank you. – ahorn Sep 11 '17 at 21:33