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.
\documentclass[12pt,oneside]{book}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{savesym}
\usepackage[useindex]{splitidx}
\savesymbol{newindex}
\makeindex
\orignewindex[My custom index]{stl}
\AtWriteToIndex{stl}{\let\thepage\thesongnum}
\usepackage{idxlayout}
\usepackage[lyric]{songs}
\newindex{reltitleidx}{cbreltitle}
\begin{document}
\showindex{{\normalfont\bfseries My songs index}}{reltitleidx}
\begin{songs}{reltitleidx}
\beginsong{Funny song}[by={},sr={}]
\sindex[stl]{Cool@\textbf{Cool}!Stuff}
\beginchorus
This is my chorus.
\endchorus
\beginverse
Verse 1.
\endverse
\beginverse
Verse 2.
\endverse
\beginverse
Verse 3.
\endverse
\endsong
\end{songs}
\printindex*
\end{document}
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
and
! 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.