Hi, I want to place my figures flush right, so that they are aligned with the right border of my text area. Captions should be in the right margin, flush left, ragged right. It is a one-sided document. I've tried \setupfloats[ location=right] \setupcaptions[ location=rightmargin, align=flushleft, headstyle=\tfx, style=\tfx] \usemodule[tikz] \starttext \placefigure{Test figure caption with a pretty long text which might eventually require a line break.}{ \starttikzpicture \draw (0,0) rectangle (2,2); \stoptikzpicture } \stoptext and the figure is placed left, and no caption is shown. When I remove location=rightmargin, the caption is visible. Other settings I've tried: outermargin - invisible righthanging - invisible right - caption is typeset in the gap between text and margin I found this old thread: http://archive.contextgarden.net/message/20090707.065101.8175a86c.en.html, but it is not very enlightening. I'm taking the options from http://pmrb.free.fr/contextref.pdf. My ConTeXt version is 2011.06.11. How can I place figures flush right? How can I place the captions in the right margin? Regards Christoph
On 13.06.2011 16:14, Christoph Redecker wrote:
Hi,
I want to place my figures flush right, so that they are aligned with the right border of my text area. Captions should be in the right margin, flush left, ragged right. It is a one-sided document.
I've tried
\setupfloats[ location=right] \setupcaptions[ location=rightmargin, align=flushleft, headstyle=\tfx, style=\tfx]
Considering the overall activity on the list since I posted the question, can I assume that these options simply have not been implemented yet? Regards Christoph
On 14-6-2011 5:03, Christoph Redecker wrote:
On 13.06.2011 16:14, Christoph Redecker wrote:
Hi,
I want to place my figures flush right, so that they are aligned with the right border of my text area. Captions should be in the right margin, flush left, ragged right. It is a one-sided document.
I've tried
\setupfloats[ location=right] \setupcaptions[ location=rightmargin, align=flushleft, headstyle=\tfx, style=\tfx]
Considering the overall activity on the list since I posted the question, can I assume that these options simply have not been implemented yet?
Did you check the details.pdf manualal? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 15.06.2011 10:17, schrieb Hans Hagen:
On 14-6-2011 5:03, Christoph Redecker wrote:
On 13.06.2011 16:14, Christoph Redecker wrote:
Hi,
I want to place my figures flush right, so that they are aligned with the right border of my text area. Captions should be in the right margin, flush left, ragged right. It is a one-sided document.
I've tried
\setupfloats[ location=right] \setupcaptions[ location=rightmargin, align=flushleft, headstyle=\tfx, style=\tfx]
Considering the overall activity on the list since I posted the question, can I assume that these options simply have not been implemented yet?
Did you check the details.pdf manualal?
Hello Hans, I now checked details.pdf, but I can only find (many!) placement options for placing figures - not for the captions. I also noticed that the wiki command reference does _not_ list the following options for \setupcaptions: left middle right lefthanging righthanging leftmargin rightmargin innermargin outermargin They _are_ included in the pdf command reference (ref-en.pdf) dated June 13, 2011. Regards Christoph
Am 15.06.2011 um 10:17 schrieb Hans Hagen:
Did you check the details.pdf manualal?
This won’t help because it’s ConTeXt’s fault. This is a quick fix for strc-flt.mkiv but the leftmargin etc. keys are then ignored when the caption is placed in the margin. %\def\locatefloatbox % {\alignstrutmode\zerocount % \shiftalignedline % {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% % {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}% % \alignedline{\floatparameter\c!location}\v!middle} \def\locatefloatbox {\alignstrutmode\zerocount \doifnotcommon{\floatcaptionparameter\c!location}{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin} {\shiftalignedline {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}}% \alignedline{\floatparameter\c!location}\v!middle} The reason why the caption disappears is that you put it in \everyrightofalignedline and the content is replaced with the rightmargin skip in the \shiftalignedline command. Wolfgang
Am 15.06.2011 15:15, schrieb Wolfgang Schuster:
Am 15.06.2011 um 10:17 schrieb Hans Hagen:
Did you check the details.pdf manualal?
This won’t help because it’s ConTeXt’s fault.
This is a quick fix for strc-flt.mkiv but the leftmargin etc. keys are then ignored when the caption is placed in the margin.
%\def\locatefloatbox % {\alignstrutmode\zerocount % \shiftalignedline % {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% % {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}% % \alignedline{\floatparameter\c!location}\v!middle}
\def\locatefloatbox {\alignstrutmode\zerocount \doifnotcommon{\floatcaptionparameter\c!location}{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin} {\shiftalignedline {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}}% \alignedline{\floatparameter\c!location}\v!middle}
The reason why the caption disappears is that you put it in \everyrightofalignedline and the content is replaced with the rightmargin skip in the \shiftalignedline command.
Wolfgang
Thank you Wolfgang, I'll try this as soon as I have access to my ConTeXt. Christoph
On 15.06.2011 15:15, Wolfgang Schuster wrote:
Am 15.06.2011 um 10:17 schrieb Hans Hagen:
Did you check the details.pdf manualal?
This won’t help because it’s ConTeXt’s fault.
This is a quick fix for strc-flt.mkiv but the leftmargin etc. keys are then ignored when the caption is placed in the margin.
%\def\locatefloatbox % {\alignstrutmode\zerocount % \shiftalignedline % {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% % {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}% % \alignedline{\floatparameter\c!location}\v!middle}
\def\locatefloatbox {\alignstrutmode\zerocount \doifnotcommon{\floatcaptionparameter\c!location}{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin} {\shiftalignedline {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}% {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}}% \alignedline{\floatparameter\c!location}\v!middle}
Your solution doesn't seems to work, I still don't see a caption anywhere when using location=rightmargin. When I inserted your fix I stumbled upon the fact that there is \def\locatebcaptionbox below \def\locatefloatbox. You provided a fix for \locatefloatbox, but shouldn't it be for \locatecaptionbox? I have no clues about the internals of ConTeXt, but I tried the following: \def\locatecaptionbox {\alignstrutmode\zerocount \doifnotcommon{\floatcaptionparameter\c!location}{\v!outermargin,\v!innermargin,\v!leftmargin,\v!rightmargin} {\shiftalignedline {\floatcaptionparameter\c!leftmargin }{\floatcaptionparameter\c!rightmargin}% {\floatcaptionparameter\c!innermargin}{\floatcaptionparameter\c!outermargin}}% \alignedline{\floatparameter\c!location}\v!middle} Note that I just translated your fix to \locatecaptionbox. At least it didn't throw an error!
The reason why the caption disappears is that you put it in \everyrightofalignedline and the content is replaced with the rightmargin skip in the \shiftalignedline command.
Wolfgang
My attempt at understanding that explanation: The caption is placed to the right of aligned line (because it is supposed to got into the margin?), and for all things that are placed that way, \everyrightofalignedline is called. And that macro replaces the caption with a skip, but should instead skip across the margin skip and then place the caption? Regards Christoph
Am 16.06.2011 um 11:28 schrieb Christoph Redecker:
Your solution doesn't seems to work, I still don't see a caption anywhere when using location=rightmargin. When I inserted your fix I stumbled upon the fact that there is \def\locatebcaptionbox below \def\locatefloatbox. You provided a fix for \locatefloatbox, but shouldn't it be for \locatecaptionbox? I have no clues about the internals of ConTeXt, but I tried the following:
No, my fix was correct but it’s not a final solution because it disables the “leftmargin” and “rightmargin” keys when you place the caption in the margin. Wolfgang
Your solution doesn't seems to work, I still don't see a caption anywhere when using location=rightmargin. When I inserted your fix I stumbled upon the fact that there is \def\locatebcaptionbox below \def\locatefloatbox. You provided a fix for \locatefloatbox, but shouldn't it be for \locatecaptionbox? I have no clues about the internals of ConTeXt, but I tried the following:
No, my fix was correct but it’s not a final solution because it disables the “leftmargin” and “rightmargin” keys when you place the caption in the margin.
Wolfgang
In that case I don't understand how I can place a caption in the margin. Should the MWE I included in my first post work now, or not? Regards Christoph
Am 16.06.2011 um 18:14 schrieb Christoph Redecker:
In that case I don't understand how I can place a caption in the margin. Should the MWE I included in my first post work now, or not?
Hans included the patch in the core, update your installation in this will work: \setuplayout [width=11cm, rightmargin=6cm] \setupcaption [figure] [width=\rightmarginwidth, location={rightmargin,high}] \starttext \placefigure{\input ward }{\externalfigure[cow]} \stoptext You can control the vertical position of the caption with the three values “high”, “low” and “middle” for the location key. Wolfgang
Hans included the patch in the core, update your installation in this will work:
\setuplayout [width=11cm, rightmargin=6cm]
\setupcaption [figure] [width=\rightmarginwidth, location={rightmargin,high}]
\starttext \placefigure{\input ward }{\externalfigure[cow]} \stoptext
You can control the vertical position of the caption with the three values “high”, “low” and “middle” for the location key.
Wolfgang
Thank you very much! The importance of explicitly setting the caption width was not obvious to me. Regards Christoph
participants (3)
-
Christoph Redecker
-
Hans Hagen
-
Wolfgang Schuster