Hans Hagen wrote:

> <expertadvice>
>   ...
> </expertadvice>

Thank you. I have modified that code and it does what I want (see below).
There is however one generalization issue: the
line '\externalfigure[\XMLflush{graphic}][width=\textwidth]' should really 
be able to use scaling to '\textwidth' or \'textheight' depending on what
fills the page better without overflowing it. Is there any way I can make
ConTeXt check which one is better: 'width=\textwidth' or
height='\textheight'?

Thanks, Joh

\definefloat[caption]

\setupfloat[caption][location=right]

\defineframedtext
[captiontext]
[width=\textwidth,style={{\smallbodyfont}\setupinterlinespace[line=2.8ex]},frame=off,topframe=on]

\defineXMLenvironment 
  [fpfigure]
  {
    \bgroup
    \defineXMLsave[caption]
    \defineXMLsave[graphic]
  }
  {
    \placefigure
      [page,none]
      [\XMLpar{figure}{label}{}]
      {}
      {\externalfigure[\XMLflush{graphic}][width=\textwidth]}
    \placecaption
      [bottom,none]
      {}
      {\startcaptiontext
        \placefloatcaption
          [figure]
          {\XMLflush{caption}}
      \stopcaptiontext}
    \egroup
  }

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

Reply via email to