Wrong float numbering with default=top
Hi, The setting \setupfloat [figure] [default=top] not only places the figures at the top of the page, but also messes up the float numbering (the float placement is fine). In the following example “Figure 2” comes after “Figure 3”. How to fix that? \useMPlibrary [dum] \setupfloat [figure] [default=top] \starttext \input knuth \startplacefigure \externalfigure [dummy] \stopplacefigure \startplacefigure \externalfigure [dummy] [width=10cm, height=16cm] \stopplacefigure \startplacefigure \externalfigure [dummy] \stopplacefigure \stoptext Marco
On 12/4/2012 1:21 PM, Marco Patzer wrote:
Hi,
The setting
\setupfloat [figure] [default=top]
not only places the figures at the top of the page, but also messes up the float numbering (the float placement is fine). In the following example “Figure 2” comes after “Figure 3”. How to fix that?
\useMPlibrary [dum]
\setupfloat [figure] [default=top]
\starttext \input knuth
\startplacefigure \externalfigure [dummy] \stopplacefigure
\startplacefigure \externalfigure [dummy] [width=10cm, height=16cm] \stopplacefigure
\startplacefigure \externalfigure [dummy] \stopplacefigure
\stoptext
In MKII we had a mechanism that took care of that (out of line flushing of floats) but it never made it into mkiv (if only because some folks didn't like it). As an experiment I've added some trickery. But keep in mind that messing with numbers is never 100% foolproof. So, for the moment you can say \ctxlua{structures.lists.autoreorder = true} till we're sure about what level of control is needed. Beta later today. ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2012-12-04 Hans Hagen: Hi Hans,
As an experiment I've added some trickery. But keep in mind that messing with numbers is never 100% foolproof. So, for the moment you can say
\ctxlua{structures.lists.autoreorder = true}
till we're sure about what level of control is needed. Beta later today.
Thank you for the quick fix. It works for the minimal example, but it fails in my document. Defining custom float types seems to break the auto reordering. \useMPlibrary [dum] \setupfloat [figure] [default=top] \definefloat [newfigure] [newfigures] [figure] \ctxlua{structures.lists.autoreorder = true} \starttext \input knuth \startplacefigure \externalfigure [dummy] \stopplacefigure \startplacenewfigure \externalfigure [dummy] [width=10cm, height=16cm] \stopplacenewfigure \startplacefigure \externalfigure [dummy] \stopplacefigure \stoptext Marco
On 2012-12-04, Marco Patzer wrote:
2012-12-04 Hans Hagen:
Hi Hans,
As an experiment I've added some trickery. But keep in mind that messing with numbers is never 100% foolproof. So, for the moment you can say
\ctxlua{structures.lists.autoreorder = true}
till we're sure about what level of control is needed. Beta later today.
Thank you for the quick fix. It works for the minimal example, but it fails in my document. Defining custom float types seems to break the auto reordering.
New defined floats are still wrongly enumerated. Is there a workaround for this? Marco
On 12/6/2012 12:43 PM, Marco Patzer wrote:
On 2012-12-04, Marco Patzer wrote:
2012-12-04 Hans Hagen:
Hi Hans,
As an experiment I've added some trickery. But keep in mind that messing with numbers is never 100% foolproof. So, for the moment you can say
\ctxlua{structures.lists.autoreorder = true}
till we're sure about what level of control is needed. Beta later today.
Thank you for the quick fix. It works for the minimal example, but it fails in my document. Defining custom float types seems to break the auto reordering.
New defined floats are still wrongly enumerated. Is there a workaround for this?
adapted ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 12/8/2012 3:34 PM, Marco Patzer wrote:
On 2012–12–06 Hans Hagen wrote:
New defined floats are still wrongly enumerated. Is there a workaround for this?
adapted
Thanks. It does not break anything in the final document and all numbers are correct.
ok, if it keeps working, remind me in a few months to make an option key/value at the tex end ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2012–12–08 Marco Patzer wrote:
Thanks. It does not break anything in the final document and all numbers are correct.
Referring to the figures is messed up: \useMPlibrary [dum] \setupfloat [figure] [default=top] \ctxlua{structures.lists.autoreorder = true} \starttext \input knuth alpha: \in{figure}[alpha] \par beta: \in{figure}[beta] \par gamma: \in{figure}[gamma] \par \startplacefigure [title=Alpha, reference=alpha] \externalfigure [dummy] \stopplacefigure \startplacefigure [title=Beta, reference=beta] \externalfigure [dummy] [width=10cm, height=16cm] \stopplacefigure \startplacefigure [title=Gamma, reference=gamma] \externalfigure [dummy] \stopplacefigure \stoptext For the moment I would actually be happy with a workaround to get the numbers right. With autoreorder the referencing is wrong, without autoreorder the float numbers are not in order. Marco
On 12/18/2012 6:13 PM, Marco Patzer wrote:
On 2012–12–08 Marco Patzer wrote:
Thanks. It does not break anything in the final document and all numbers are correct.
Referring to the figures is messed up:
\useMPlibrary [dum]
\setupfloat [figure] [default=top]
\ctxlua{structures.lists.autoreorder = true}
\starttext \input knuth
alpha: \in{figure}[alpha] \par beta: \in{figure}[beta] \par gamma: \in{figure}[gamma] \par
\startplacefigure [title=Alpha, reference=alpha] \externalfigure [dummy] \stopplacefigure
\startplacefigure [title=Beta, reference=beta] \externalfigure [dummy] [width=10cm, height=16cm] \stopplacefigure
\startplacefigure [title=Gamma, reference=gamma] \externalfigure [dummy] \stopplacefigure
\stoptext
For the moment I would actually be happy with a workaround to get the numbers right. With autoreorder the referencing is wrong, without autoreorder the float numbers are not in order.
this kind of messy stuff needs some time to get right (apart from messing up de code) you cna try to patch this in strc-ref.lua function filters.generic.number(data,what,prefixspec) -- todo: spec and then no stopper if data then -- local numberdata = data.numberdata numberdata = lists.reordered(data) if numberdata then helpers.prefix(data,prefixspec) sections.typesetnumber(numberdata,"number",numberdata) else local useddata = data.useddata if useddata and useddsta.number then context(useddata.number) end end end end ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Marco Patzer