[NTG-context] Float control
Max Chernoff
mseven at telus.net
Thu Mar 2 00:22:45 CET 2023
Hi Denis,
> The floats where jumping around, appearing in a different order than
> in the source file
Tables and figures can appear in different orders than each other, and a
top float could appear at the top of the page that it is mentioned, but
if you ever see Figure 2 before Figure 1 or a float appearing before it
is placed in the source (with the exception of the top issue), then
you've probably found a bug.
> some positioning keys had not the intended effect (e.g. top)
I've had mixed results with some of the positioning keys too, but "top"
should generally work okay. If you're using columns, weird stuff can
sometimes happen with top/bottom floats, but you should still be able to
make them work. You can also try adding
\setupfloat[ntop=100]
at the start of you're document. I've had that fix an otherwise-
unexplainable bug once.
> I know, TeX's float positioning algorithm should be rather reliable
> and stable
Not as much as you would expect. The TeX page breaking algorithm is
greedy, single-pass, and dependant on every page prior, so you can get
some pretty chaotic results in pathological situations. "Typical"
documents don't usually have any issues, but you can (even accidentally)
make a document that gives some really weird results.
> Anyway, I'd like to learn more about the whole float issue. Is there anything particular I could read to learn more about the whole thing?
The only float documentation for ConTeXt that I'm aware of is a short
section in It's in the Details
https://www.pragma-ade.nl/general/manuals/details.pdf#%5B%7B%22num%22%3A39%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22Fit%22%7D%5D
and another short section in the old Reference Manual
http://pmrb.free.fr/contextref.pdf#aut%3A957
There's also the Wiki page
https://wiki.contextgarden.net/Floating_Objects
and the source code
https://source.contextgarden.net/tex/context/base/mkxl/strc-flt.mklx
I haven't been able to find anything that really goes into the details
though. (If there's something that I'm missing here, please let me know!
I've been looking for awhile now)
> Maybe I'm missing out on something fundamental...
At the TeX level, floats are known as \insert's/insertions. The end of
Chapter 15 in The TeXbook goes into detail here. TeX By Topic also has a
good description in Chapter 29
https://texdoc.org/serve/texbytopic/0#chapter.29
Then there's also Low Level TeX which documents the changes in LMTX
https://www.pragma-ade.com/general/manuals/lowlevel-inserts.pdf
Inserts are (in my opinion) the most complicated part of TeX. Even at an
engine level, they aren't that well documented. When writing the
footnote code for lua-widow-control, I had to read through "TeX the
program" since some of the details weren't documented anywhere else.
And as Peter mentioned, if you post a specific example someone will
probably come along and help.
-- Max
More information about the ntg-context
mailing list