ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Wrong float numbering with default=top
@ 2012-12-04 12:21 Marco Patzer
  2012-12-04 15:59 ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Patzer @ 2012-12-04 12:21 UTC (permalink / raw)
  To: context

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

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-04 12:21 Wrong float numbering with default=top Marco Patzer
@ 2012-12-04 15:59 ` Hans Hagen
  2012-12-04 18:18   ` Marco Patzer
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-12-04 15:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-04 15:59 ` Hans Hagen
@ 2012-12-04 18:18   ` Marco Patzer
  2012-12-06 11:43     ` Marco Patzer
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Patzer @ 2012-12-04 18:18 UTC (permalink / raw)
  To: context

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

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-04 18:18   ` Marco Patzer
@ 2012-12-06 11:43     ` Marco Patzer
  2012-12-06 16:31       ` Hans Hagen
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Patzer @ 2012-12-06 11:43 UTC (permalink / raw)
  To: context

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

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-06 11:43     ` Marco Patzer
@ 2012-12-06 16:31       ` Hans Hagen
  2012-12-08 14:34         ` Marco Patzer
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-12-06 16:31 UTC (permalink / raw)
  To: context

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
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-06 16:31       ` Hans Hagen
@ 2012-12-08 14:34         ` Marco Patzer
  2012-12-08 23:23           ` Hans Hagen
  2012-12-18 17:13           ` Marco Patzer
  0 siblings, 2 replies; 10+ messages in thread
From: Marco Patzer @ 2012-12-08 14:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.


Marco

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-08 14:34         ` Marco Patzer
@ 2012-12-08 23:23           ` Hans Hagen
  2012-12-18 17:13           ` Marco Patzer
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2012-12-08 23:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-08 14:34         ` Marco Patzer
  2012-12-08 23:23           ` Hans Hagen
@ 2012-12-18 17:13           ` Marco Patzer
  2012-12-19  0:53             ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Marco Patzer @ 2012-12-18 17:13 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen


[-- Attachment #1.1: Type: text/plain, Size: 947 bytes --]

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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-18 17:13           ` Marco Patzer
@ 2012-12-19  0:53             ` Hans Hagen
  2012-12-19 13:30               ` Marco Patzer
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2012-12-19  0:53 UTC (permalink / raw)
  To: ntg-context

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
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Wrong float numbering with default=top
  2012-12-19  0:53             ` Hans Hagen
@ 2012-12-19 13:30               ` Marco Patzer
  0 siblings, 0 replies; 10+ messages in thread
From: Marco Patzer @ 2012-12-19 13:30 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 248 bytes --]

On 2012–12–19 Hans Hagen wrote:

> 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

This seems to fix it. Thanks for the quick patch, Hans.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-19 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 12:21 Wrong float numbering with default=top Marco Patzer
2012-12-04 15:59 ` Hans Hagen
2012-12-04 18:18   ` Marco Patzer
2012-12-06 11:43     ` Marco Patzer
2012-12-06 16:31       ` Hans Hagen
2012-12-08 14:34         ` Marco Patzer
2012-12-08 23:23           ` Hans Hagen
2012-12-18 17:13           ` Marco Patzer
2012-12-19  0:53             ` Hans Hagen
2012-12-19 13:30               ` Marco Patzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).