4

For this MWE, run with xelatex in TexLive 2020 on Windows 10:

\documentclass{article}
\usepackage{makeidx}
\usepackage{hyperref}
\makeindex
\begin{document}
\index{foo} % OK, but without this line, the .idx file is empty
\index{Sibelius!Difference between Sibelius "| First and Sibelius "| Ultimate}
\printindex
\end{document}

The .idx file (given below) is wrong. Apparently something has misinterpreted the second "| as a " character followed by a pagenumber-formatting | command.

\indexentry{foo|hyperpage}{1}
\indexentry{Sibelius!Difference between Sibelius "|hyperindexformat{\ First and Sibelius "}}{1}

makeindex then gives the error message

!! Input index error (file = test.idx, line = 2):
   -- Incomplete first argument (premature LFD).

(Note: IMHO the decision of a software company to name three versions of an app as "Sibelius", "Sibelius | First" and "Sibelius | Ultimate", using the vertical bar characters and spaces exactly as shown, is moronic, but that's what they have done!)

1 Answer 1

2

Quite unfortunate, but on the other hand | doesn't necessarily print a bar.

\documentclass{article}
\usepackage{imakeidx}
\usepackage{hyperref}

\makeindex
\begin{document}

x % something to make the index entry to be processed

\index{foo} % OK, but without this line, the .idx file is empty
\index{a}\index{b}\index{c}\index{d}
\index{Sibelius!Difference between Sibelius~\textbar~First and Sibelius~\textbar~Ultimate}

\printindex

\end{document}

enter image description here

5
  • What does the \sibbar definition do in this MWE?
    – Marijn
    Jul 8, 2021 at 12:06
  • @Marijn A left-over. Thanks for noting it.
    – egreg
    Jul 8, 2021 at 13:01
  • What circumstances would make | not print a bar in text mode? I don't want to pollute the whole document with dozens of \textbars even if a few are necessary in index entries
    – alephzero
    Jul 8, 2021 at 13:22
  • @alephzero Try \documentclass{article}\begin{document}|\end{document}
    – egreg
    Jul 8, 2021 at 13:27
  • @egreg That works fine for me, creating a PDF. But in any case, my "real" document doesn't use the article class or the default CM fonts, so if it is a font or font encoding issue, it's going down a different rabbit hole.
    – alephzero
    Jul 8, 2021 at 13:43

You must log in to answer this question.

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