index entries postponed if sections are empty
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
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 ___________________________________________________________________________________
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
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