index entries postponed if sections are empty
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Hi, I‘m despairing about my index – some sections contain only an image (\externalfigure), but I need to set several index entries for the image contents. The index entries get postponed until after the next chapter. I guess the problem is that there’s no (text) content, but \par and \strut didn’t help. The MWE shows that index entries in empty sections are ignored, i.e. “Something” is supposedly only on p.6: \usemodule[visual] \starttext \dorecurse{5}{% \startchapter[title={\recurselevel}] \dorecurse{5}{% \startsection[title={\fakewords{3}{5}}] \index{Something}\index{A\recurselevel} } \stopchapter } \completeindex \stoptext What can I do? Hraban
![](https://secure.gravatar.com/avatar/5faea8b4fa0adb143383811dc94f0d22.jpg?s=120&d=mm&r=g)
Hi Hraban, Maybe you can add some « virtual » text in the section with an invisible color such as \startcolor[white] a \stopcolor I don't know whether the following can solve your problem, but the entries of the index appear correctly: \usemodule[visual] \starttext \dorecurse{5}{% \startchapter[title={\recurselevel}] \dorecurse{5}{% \startsection[title={\fakewords{3}{5}}] \startcolor[white] a \stopcolor \index{Something}\index{A\recurselevel} } \stopchapter } \completeindex \stoptext Best regards: OK
On 31 Oct 2020, at 17:56, Henning Hraban Ramm
wrote: Hi, I‘m despairing about my index – some sections contain only an image (\externalfigure), but I need to set several index entries for the image contents. The index entries get postponed until after the next chapter. I guess the problem is that there’s no (text) content, but \par and \strut didn’t help.
The MWE shows that index entries in empty sections are ignored, i.e. “Something” is supposedly only on p.6:
\usemodule[visual]
\starttext
\dorecurse{5}{% \startchapter[title={\recurselevel}]
\dorecurse{5}{% \startsection[title={\fakewords{3}{5}}]
\index{Something}\index{A\recurselevel}
}
\stopchapter }
\completeindex
\stoptext
What can I do?
Hraban ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/eade9bceb7f86f999178cd1b4ee3e500.jpg?s=120&d=mm&r=g)
Hello Hraban!
On Sat, 31 Oct 2020 at 17:56, Henning Hraban Ramm
Hi, I‘m despairing about my index – some sections contain only an image (\externalfigure), but I need to set several index entries for the image contents. The index entries get postponed until after the next chapter. I guess the problem is that there’s no (text) content, but \par and \strut didn’t help.
Add *\dontleavehmode*\index{Something}\index{A\recurselevel} before \index command. Regards, Jano
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Otared, Jano, thank you for your answers – what finally helped was putting the image and the index entries in a vbox together. Hraban
participants (3)
-
Henning Hraban Ramm
-
Jano Kula
-
Otared Kavian