Re: [NTG-context] slithering captions

2006-05-22 Thread Hans Hagen
Sanjoy Mahajan wrote:
 From: Hans Hagen [EMAIL PROTECTED], Mon, 17 Apr 2006 10:48:29 +0200
   
 [question about placing figures differently according to their widths]
   
 best use closed floats and set their characteristics (see details.pdf)
 

 I haven't found closed floats in details.pdf, though it's teaching me
   
oeps, cloned,

\definefloat[myfigure][figure]
\setupfloat[myfigure][]
\setupcaption[myfigure][]

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] slithering captions

2006-05-22 Thread Sanjoy Mahajan
 oops, cloned [figures],

Ah, thanks.

For inline figures, 'here' will place it here if possible, otherwise
float to the next page.  Is there an equivalent of 'here' for margin
figures ('marginhere'?)?  

With 'margin', they float completely so are not attached to a
paragraph.  With 'inmargin', they are attached to the paragraph and
can drag the paragraph to the next page, which leaves whitespace at
the bottom of the page.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
 --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] slithering captions

2006-05-21 Thread Sanjoy Mahajan
From: Hans Hagen [EMAIL PROTECTED], Mon, 17 Apr 2006 10:48:29 +0200
 [question about placing figures differently according to their widths]
 best use closed floats and set their characteristics (see details.pdf)

I haven't found closed floats in details.pdf, though it's teaching me
much useful stuff about floats meanwhile.  Are closed floats the ones
attached to text (e.g. \placefigure[inmargin]), rather than ones that
can move up and down?  Though that's the opposite of floating.

Mixing mixing inmargin and margin locations produces lots of collisions,
I've found (an example is below).  If TeX had a decent programming
language, it might be possible to implement lots more float-position
optimizations.  The user could write:

  \placefigure[inmargin][someref]{}{\externalfigure[somefig.pdf]}

  In the diagram \attachto[someref] the long arrows mean blah and the
  short arrows mean blahblah...

Then the optimizer would favor placing each margin figure with its top
aligned to the top of the attachment point, but if it couldn't do that,
it would move them up and down to minimize (say) the sum of the squared
vertical offsets (using a larger penalty if the figure had to be
postponed to the next page, and insert (p. 27) where
\attachto[someref] is).  The first pass can do greedy optimization on
the fly, and subsequent runs could analyze the figure locations and
their attachment points to find the best solution for a whole chapter.
But it would be miserable to do all of that in a macro language (which
are ghastly).

Here is the collision example.  As the doctor says when you say It
hurts when I do X: So don't do that!

\starttext
\dorecurse{6}{
We thrive in information-thick worlds because of our
marvelous and everyday capacity to select, edit,
single out, structure, highlight, group, pair, merge,
harmonize, synthesize, focus, organize, condense,
reduce, boil down, choose, categorize, catalog, classify,

\placefigure[inmargin]{A caption goes here}
{\framed[height=1in,width=1.5in]{!}}

list, abstract, scan, look into, idealize, isolate,
discriminate, distinguish, screen, pigeonhole, pick over,
sort, integrate, blend, inspect, filter, lump, skip,
smooth, chunk, average, approximate, cluster, aggregate,

\placefigure[margin]{float}
{\framed[height=1in,width=1.5in]{!}}

outline, summarize, itemize, review, dip into,
flip through, browse, glance into, leaf through, skim,
refine, enumerate, glean, synopsize, winnow the wheat
from the chaff and separate the sheep from the goats.
}
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] slithering captions

2006-04-17 Thread Hans Hagen
Sanjoy Mahajan wrote:
 So the first step in doing the placement automatically is to get the
 width of the figure.  Assuming that I've done

   \useexternalfigure[fig_a][f-1.pdf]

 is there an easy way to get fig_a's dimensions?  After using the figure,
 e.g. with

   \placefigure[margin][]{some caption}{\externalfigure[fig_a]}
   
\getfiguredimensions[...] % same args as \externalfigure

after that you have

\figureheight
\figurewidth

 And, but this is trying to do too much at once, the next problem is that
 margin caption below the widest figures (case 3 above) shouldn't overlap
 other floats in the margin and also shouldn't count toward the figure's
 height in the text block.  But maybe that's done automatically -- I'll
 make some experiments.
   
limit the caption widths - maxwidth

best use closed floats and set their characteristics (see details.pdf)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context