I'm not understanding in a much much larger document how I sold this, as I've tired placing \dontleavehmode in different places, but no success.

On Wednesday, March 13, 2024 at 04:46:54 PM MDT, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:


Joel via ntg-context schrieb am 13.03.2024 um 23:27:
> After many hours of trial-and-error, I was able to recreate the problem
> in a minimum working example:
>
> file main.tex only contains:
>
> \starttext
>
>      \index{birds}
>      \index{insects}
>
>      \input secondary
>
>      \placeindex
>
> \stoptext
>
> file secondary.tex only contains:
>
>
>     \index{turtles}
>
> For reasons I can't understand, the index produces the same [entry not
> flushed] error. It seems here happening when contents are input.

The message appears even without the external file.

> My code is so simple, I can't understand what I've typed wrong.

Indices need an anchor to be flushed. When you put \index entries
between environments the next anchor appears at the start of a new
paragraph (I used \dontleavehmode for this in the following example).

\starttext

\index{birds}
\index{insects}

\index{turtles}

\dontleavehmode % comment this line for [entry not flushed]


\placeindex

\stoptext


Wolfgang