As Aditya mentioned, using hanging is the wrong approach here. In
the thread he linked to Hans and Wolfgang already provide two
solutions. I'll present a third one, based on Wolfgang's solution, with the following features:
- The additional text is typeset in the margin, not just close to the
- It uses the margindata interface. This allows the margin text to
be manipulated using the usual ConTeXt interface.
- I attempted to avoid low-level commands as much as possible.
- The additional figure text is optional.
- Additional margin texts are centred by default. If the its height
exceeds the figure height, they are top aligned.
\useMPlibrary [dum] %% only for the screenshot
First, an individual margin data set is defined. To correctly align
the margin text, it uses a frame with the all the
settings that frames usually accept.
Then the command
FigureText is defined, which typesets the figure
content and the additional margin text. It is not responsible for
the caption. The command
FigureText takes one argument, which is
the figure content. The
dowithnextbox trickery allows easy access
to the dimensions of the box, which is used to properly align the
margin text. This allows the definition of the macro without a parameter.
The margin text is passed as a second argument to
and picked up using
Here is an example how to use it:
[text=Some additional text for the margin.]
[text=Some more margin text for the other figure.]
\externalfigure [dum] [width=\textwidth]
The height of the margin texts is not taken into account. If floats
are placed consecutively, margin texts might overlap. Example: