Consider the following Pandoc-generated ConTeXt document:
\setuppapersize [A4][A4]
\setuplayout [width=middle, backspace=1.5in, cutspace=1.5in,
height=middle, topspace=0.75in, bottomspace=0.75in]
\setuppagenumbering[location={footer,center}]
\setupexternalfigures[
order={svg,pdf,png,jpg},
location=global,
wfactor=fit,
]
\definedescription
[description]
[headstyle=bold, style=normal, location=hanging, width=4cm]
\starttext
\placefigure[here,nonumber]{Little kitten}{\externalfigure[http://placekitten.com/g/480/300][method=jpg]}
\startdescription{{\externalfigure[http://placekitten.com/g/640/400][method=jpg]}}
\input bryson
\stopdescription
\stoptext
Question
Little kitten should grow to \textwidth
. The other kitten should fit through a width of 4cm with text wrapped around it. Its picture should be flush at the top with the wrapped text.
The kittens may not be touched; only the setup before \starttext
may be changed. Furthermore, no references to the image URLs should appear in the preamble for this problem to be solved as generally as possible.
I tried something with \setupexternalfigures
and wfactor=fit
but it does not seem to work.
Best Answer
Solution
With
version: 2012.05.30 11:26
of ConTeXt,\setupexternalfigures[wfactor=fit]
has no effect. Hence, the following solution which also keeps in-line figures intact.This is all really nice, because LaTeX2e has not be found capable (yet) of pulling off a similar feat. In contrast to ConTeXt, float clearing is not automatic in LaTeX2e; instead, one needs to fuddle around with distance measurements.
Caveat
The cats have a caveat though; When the figure with the description occurs near the end of a page, its wrapped text will fall off the page like in the following example. I distilled a minimum working example out of it and linked it as a follow-up question.
Newer ConTeXt versions
Eventually, I found how to install ConTeXt Standalone under Debian. I can confirm that
\setupexternalfigures[wfactor=fit]
is now functional in ConTeXtversion: 2013.09.09 19:45
. This can significantly reduce the code when, like in the example above, no in-line images are used. However, when in a more general case in-line images are present,[wfactor=fit]
cannot be used because it acts also upon these.[wfactor=fit]
acting upon in-line images could be considered a ConTeXt bug. Therefore, above solution which also works with older ConTeXt versions, remains the more general solution.