TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Friends, I'm stuck with the following issue: I have a document with several indices. The splitidx package deals with them with no problems. It happens that I have some very long index entries, so I decided to make them look more aesthetic:

Styling very long index entries to look more aesthetic

lockstep provided an amazing solution that works like a charm. This solution works in my other documents. Unfortunately, when I try to use it in my "production document", it does not work. egreg suggested me to reduce my document to a minimal example, so here it is. Thankfully it still does not work:

% since the first example was full of "package noise",
% I left only the needed ones.



\orignewindex[My custom index]{stl}




\showindex{{\normalfont\bfseries My songs index}}{reltitleidx}


\beginsong{Funny song}[by={},sr={}]


This is my chorus.

Verse 1.

Verse 2.

Verse 3.





Any help is really appreciated.

EDIT 1: I forgot to mention. \pfill seems to raise the errors. If I remove it from my ist style file, the document is successfully compiled.

There are the commands: pdflatex mydocument.tex, splitindex mydocument.idx, makeindex -s mystyle.ist mydocument-stl.idx, pdflatex mydocument.tex.

EDIT 2: Errors raised:

! Undefined control sequence. <recently read> \efill l.4 \item \textbf{Cool}\efill


! Undefined control sequence. \pfill ...ll \penalty 500 \strut \nobreak \dotfil ~\ignorespaces l.5 \subitem Stuff\pfill 1

EDIT 3: I owe egreg a drink. The first error is gone! The index is properly generated, but this annoying error still bugs me:

! Undefined control sequence. \pfill ...ll \penalty 500 \strut \nobreak \dotfil ~\ignorespaces l.5 \subitem Stuff\pfill 1

EDIT 4: It's now solved, thanks to egreg's fantastic solution. =)

EDIT 5: For completeness sake, my style file is based on gind.ist. Since those commands were not defined in terms of others, the above errors raised. Once you correctly define them, the errors are gone.

share|improve this question
up vote 3 down vote accepted

\pfill is a macro from ltxdoc

  \strut\nobreak\leaders\hbox to.6em{\hss.\hss}\hfil~\ignorespaces}

You might need also \efill:


\dotfil is defined just as

\def\dotfil{\leaders\hbox to.6em{\hss.\hss}\hfil}
share|improve this answer
Thanks, egreg! But for some reason, it still does not work. Two errors were raised: ! Undefined control sequence. <recently read> \efill l.4 \item \textbf{Cool}\efill and ! Undefined control sequence. \pfill ...ll \penalty 500 \strut \nobreak \dotfil ~\ignorespaces l.5 \subitem Stuff\pfill 1. Did it work for you? – Paulo Cereda Jul 18 '11 at 10:45
Thanks! Now one of the errors is gone! It works (my index is displayed correctly), but this error is still raised: ! Undefined control sequence. \pfill ...ll \penalty 500 \strut \nobreak\dotfil \ignorespaces l.5 \subitem Stuff\pfill 1. Any ideas? – Paulo Cereda Jul 18 '11 at 11:05
What's the undefined control sequence? It's the last in the first line of the error message. – egreg Jul 18 '11 at 11:08
I think it's l.5 \subitem Stuff\pfill. The last line has only a 1. =P – Paulo Cereda Jul 18 '11 at 11:16
Thanks a million! Sorry for the trouble. – Paulo Cereda Jul 18 '11 at 11:22

Paulo: Regarding your MWE -- I had to change the four \renewcommand{\idx...} commands to \newcommand and also had to comment out the \songpos command (line 50) as it doesn't seem to be defined in songs.sty. After running the MWE through latex and makeindex, the following text shows up in the song.ilg file:

This is makeindex, version 2.15 [TeX Live 2011] (kpathsea + Thai support).
Scanning input file song.idx...
!! Input index error (file = song.idx, line = 1):
   -- Unknown index keyword \indexentry[stl].
done (0 entries accepted, 1 rejected).
Nothing written in song.ind.
Transcript written in song.ilg.

Is this the error you're getting as well?

share|improve this answer
Sorry, I forgot to mention, the four \renewcommand commands are optional. =) I just kept them for testing purposes. The CTAN version of songs is very outdated, the one I use is the last stable one available here. Anyway, I updated my question and put the errors I'm getting. I'm running splitindex then makeindex. The errors seem not to be in those parsers per se (nothing is rejected, and if I keep the default style for makeindex, everything works), but in my source itself. =( – Paulo Cereda Jul 18 '11 at 11:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.