## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Forcing a blank index line alphabetically Topic is solved

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
gossett
Posts: 5
Joined: Thu Sep 17, 2015 11:11 pm

### Forcing a blank index line alphabetically

There are times when makeindex leaves some unfortunate page or column breaks. I know that it is possible to edit the .ind file and add a \indexspace entry.

However, I would like a solution that is handled at the source file level. Something like \indexspace{masquerades as} where "masquerades as" would indicate where, in alphabetical order, the blank space should reside.

For example, I have the index entries

cable
cat
coin

but want a space between cable and cat. I would like to add this to my source file:

\indexspace{cac}

(cac is not a valid word, but it lands where I want a blank line).

Tags:

rais
Posts: 209
Joined: Sun Nov 16, 2014 8:51 pm
I'm not sure what you may need this for, but here's an idea:

KR
Rainer

gossett
Posts: 5
Joined: Thu Sep 17, 2015 11:11 pm
Thank you so much. This almost does what I need. If I run it on a typical latex file it works great. Unfortunately, I have the following .ist file:

IndexTest.ist:
preamble"\\thispagestyle{empty}\n\\begin{theindex}\n"postamble"\\end{theindex}\n"

When I run your code in conjunction with this, the commas are not suppressed on the blank index line.

Index
cable, 1
,
cat, 1
coin, 1

the revision replaces \makeindex with
\makeindex[options=-s IndexTest.ist]

(I am using the imakeindex package.)

gossett
Posts: 5
Joined: Thu Sep 17, 2015 11:11 pm
I found a way to avoid using the .ist file. So your solution works just fine. Thanks again.

rais
Posts: 209
Joined: Sun Nov 16, 2014 8:51 pm
gossett wrote:Unfortunately, I have the following .ist file:

IndexTest.ist:
preamble"\\thispagestyle{empty}\n\\begin{theindex}\n"postamble"\\end{theindex}\n"

so what? Can't you just add the three lines from my .mst file (delim...) to your .ist file?
Or was your .ist file automagically created?

KR
Rainer

gossett
Posts: 5
Joined: Thu Sep 17, 2015 11:11 pm
Adding your code into my .ist file did not eliminate the extra commas. I am not sure why the two don't play well together.

Attachments
IndexTest.tex
The main file

rais
Posts: 209
Joined: Sun Nov 16, 2014 8:51 pm
gossett wrote:Adding your code into my .ist file did not eliminate the extra commas.

well, I still don't see the problem you're describing---after merging the three lines from my .mst into your .ist, that is.
preamble"\\thispagestyle{empty}\n\\begin{theindex}\n"postamble"\\end{theindex}\n"delim_0 "\\idxcomma"delim_1 "\\idxcomma"delim_2 "\\idxcomma"`

Of course, you won't be needing the filecontents* environment any longer (by using the -s option, a .mst file would be ignored, anyway...but I wrote sth. to that regard already, didn't I?)

KR
Rainer

gossett
Posts: 5
Joined: Thu Sep 17, 2015 11:11 pm
That did fix the test file. I think I was pasting too much into the .ist file. Thanks for the help.