ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Placing figures flush right and captions in the margin
@ 2011-06-13 14:14 Christoph Redecker
  2011-06-14 15:03 ` Christoph Redecker
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Redecker @ 2011-06-13 14:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-13 14:14 Placing figures flush right and captions in the margin Christoph Redecker
@ 2011-06-14 15:03 ` Christoph Redecker
  2011-06-15  8:17   ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Redecker @ 2011-06-14 15:03 UTC (permalink / raw)
  To: ntg-context

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-14 15:03 ` Christoph Redecker
@ 2011-06-15  8:17   ` Hans Hagen
  2011-06-15  9:03     ` Christoph Redecker
  2011-06-15 13:15     ` Wolfgang Schuster
  0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2011-06-15  8:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Christoph Redecker

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-15  8:17   ` Hans Hagen
@ 2011-06-15  9:03     ` Christoph Redecker
  2011-06-15 13:15     ` Wolfgang Schuster
  1 sibling, 0 replies; 11+ messages in thread
From: Christoph Redecker @ 2011-06-15  9:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen



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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-15  8:17   ` Hans Hagen
  2011-06-15  9:03     ` Christoph Redecker
@ 2011-06-15 13:15     ` Wolfgang Schuster
  2011-06-15 13:41       ` Christoph Redecker
  2011-06-16  9:28       ` Christoph Redecker
  1 sibling, 2 replies; 11+ messages in thread
From: Wolfgang Schuster @ 2011-06-15 13:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


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

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-15 13:15     ` Wolfgang Schuster
@ 2011-06-15 13:41       ` Christoph Redecker
  2011-06-16  9:28       ` Christoph Redecker
  1 sibling, 0 replies; 11+ messages in thread
From: Christoph Redecker @ 2011-06-15 13:41 UTC (permalink / raw)
  To: ntg-context

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-15 13:15     ` Wolfgang Schuster
  2011-06-15 13:41       ` Christoph Redecker
@ 2011-06-16  9:28       ` Christoph Redecker
  2011-06-16 16:11         ` Wolfgang Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: Christoph Redecker @ 2011-06-16  9:28 UTC (permalink / raw)
  To: ntg-context

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-16  9:28       ` Christoph Redecker
@ 2011-06-16 16:11         ` Wolfgang Schuster
  2011-06-16 16:14           ` Christoph Redecker
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-06-16 16:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-16 16:11         ` Wolfgang Schuster
@ 2011-06-16 16:14           ` Christoph Redecker
  2011-06-16 16:28             ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Redecker @ 2011-06-16 16:14 UTC (permalink / raw)
  To: ntg-context

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-16 16:14           ` Christoph Redecker
@ 2011-06-16 16:28             ` Wolfgang Schuster
  2011-06-16 17:26               ` Christoph Redecker
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2011-06-16 16:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Placing figures flush right and captions in the margin
  2011-06-16 16:28             ` Wolfgang Schuster
@ 2011-06-16 17:26               ` Christoph Redecker
  0 siblings, 0 replies; 11+ messages in thread
From: Christoph Redecker @ 2011-06-16 17:26 UTC (permalink / raw)
  To: ntg-context

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-16 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-13 14:14 Placing figures flush right and captions in the margin Christoph Redecker
2011-06-14 15:03 ` Christoph Redecker
2011-06-15  8:17   ` Hans Hagen
2011-06-15  9:03     ` Christoph Redecker
2011-06-15 13:15     ` Wolfgang Schuster
2011-06-15 13:41       ` Christoph Redecker
2011-06-16  9:28       ` Christoph Redecker
2011-06-16 16:11         ` Wolfgang Schuster
2011-06-16 16:14           ` Christoph Redecker
2011-06-16 16:28             ` Wolfgang Schuster
2011-06-16 17:26               ` Christoph Redecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).