Am 29.04.2013 um 09:33 schrieb Malte Stien <ma...@stien.de>:

> Hi,
> 
> I need to associate a bit of text with a figure in a book. The text is 
> not---and cannot be---the figure caption (it's providing some explanation 
> with respect to some labels in the figure). I have tried the following based 
> on some other post on the mailing list:
> 
> \definepapersize[eightsquare][width=8in, height=8in]
> \setuppapersize[eightsquare]
> 
> \setuplayout[
>       location=doublesided, marking=on, backspace=43mm, leftmargin=18mm,
>       leftmargindistance=4mm, rightmargin=35mm, rightmargindistance=4mm, 
> rightedgewidth=6mm,
>       topspace=12mm, header=15mm,     footer=15mm, height=179mm, width=115mm
> ]
> 
> \starttext
> 
> \startplacefigure[location=force, title={First dummy caption}]
> \inmargin{First margin dummy}
> \externalfigure[dummy][width=115mm]
> \stopplacefigure
> 
> \stoptext
> 
> However, that results in the text being down the bottom of the figure. I need 
> the text to be vertically aligned with the top of the figure. I have attached 
> the resulting PDF for illustration purposes (is that okay on this mailing 
> list? It's very small).
> 
> Any hints would be much appreciated.


You can set the text in the margin with the second argument of 
\startplacefigure.

\define\FigureText
  {\dowithnextbox
     {\startlinealignment[middle]
      
\copy\nextbox\rlap{\hskip\rightmargindistance\framed[frame=off,width=\rightmarginwidth,height=\nextboxht]{\floatuserdataparameter{text}}}
      \stoplinealignment}
     \hbox}

\setupfloat[figure][command=\FigureText]

\starttext

\startplacefigure[title=Dummy figure][text=Margin dummy]
\externalfigure[dummy][width=.8\textwidth]
\stopplacefigure

\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to