Re: [NTG-context] Automatic margin floats using the criterium parameter

2012-09-05 Thread Hans Hagen

On 5-9-2012 09:43, Marco Patzer wrote:

Hi,

I am working on some float placement code for a project. To
not reinvent the wheel I like to know what is currently possible in
ConTeXt.


fyi: As I often need conditional placement in projects (mostly width 
related), it's likely that there will be a pluggable system some day 
(some snippets are in place but not a coherent framework). It's somewhat 
complicated by the fact that one has to decide what to do with delayed 
placement.  No time now, so it will happen next year or so.


Hans


-
  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
___


Re: [NTG-context] Automatic margin floats using the criterium parameter

2012-09-05 Thread Marco Patzer
On 2012-09-05 Hans Hagen pra...@wxs.nl wrote:

Hi Hans,

  I am working on some float placement code for a project. To
  not reinvent the wheel I like to know what is currently possible in
  ConTeXt.
 
 fyi: As I often need conditional placement in projects (mostly width 
 related), it's likely that there will be a pluggable system some day 

I already consider the entire float mechanism very flexible and
feature rich.

 It's somewhat complicated by the fact that one has to decide what
 to do with delayed placement.

I'm quite happy with the placement in general. The exact problem
here is that if the \setupfloat[criterium=…] value is exceeded, it
seems that ConTeXt adjusts the values “location” and “default” to
place the float in the text. A solution would be to be able to state
a fallback float class in case criterium is exceeded. Idea:

\definefloat
  [marginfigure]
  [marginfigures]

\definefloat
  [marginfigurefallback]
  [marginfiguresfallbacks]
  [marginfigure]

\setupfloat
  [marginfigure]
  [criterium=\marginwidth,
   criteriumfallback=marginfigurefallback]

This way full control is being maintained, since the float and
caption style of the fallback class can be individually adjusted.


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
___