ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to make floats extend into the outer margin
@ 2014-07-23 15:48 Joshua Krämer
  2014-07-24  8:36 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Joshua Krämer @ 2014-07-23 15:48 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

Dear list,

I have some big-width floats, and want them to span the regular text
width plus the outer margin.  I can position them manually with \kern.
Is there a way to make them automatically extend into the outer
margin?  I have tried different options for location=... without
success.

Thanks and kind regards,
Joshua Krämer


Example with manual positioning:


\setuplayout [backspace=3cm, width=13.5cm, topspace=2cm, height=24.7cm,
margin=1.5cm, margindistance=0cm, header=0cm, footer=0cm,
footerdistance=0cm]

\newdimen\Bigtextwidth \Bigtextwidth=15cm

\setuppagenumbering [alternative=doublesided]

\showframe

\starttext

\startplacefigure
\leavevmode\kern-1.5cm\framed [width=\Bigtextwidth, framecolor=red] %
{Left margin}
\stopplacefigure

\startplacefigure
\leavevmode\kern0cm\framed [width=\Bigtextwidth, framecolor=red] %
{Right margin}
\stopplacefigure

\stoptext


___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-23 15:48 How to make floats extend into the outer margin Joshua Krämer
@ 2014-07-24  8:36 ` Wolfgang Schuster
  2014-07-24 13:41   ` Keith J. Schultz
  2014-07-24 16:37   ` Joshua Krämer
  0 siblings, 2 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2014-07-24  8:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 23.07.2014 um 17:48 schrieb Joshua Krämer <joshua.kraemer@gmail.com>:

> Dear list,
> 
> I have some big-width floats, and want them to span the regular text
> width plus the outer margin.  I can position them manually with \kern.
> Is there a way to make them automatically extend into the outer
> margin?  I have tried different options for location=... without
> success.
> 
> Thanks and kind regards,
> Joshua Krämer
> 
> 
> Example with manual positioning:
> 
> 
> \setuplayout [backspace=3cm, width=13.5cm, topspace=2cm, height=24.7cm,
> margin=1.5cm, margindistance=0cm, header=0cm, footer=0cm,
> footerdistance=0cm]
> 
> \newdimen\Bigtextwidth \Bigtextwidth=15cm
> 
> \setuppagenumbering [alternative=doublesided]
> 
> \showframe
> 
> \starttext
> 
> \startplacefigure
> \leavevmode\kern-1.5cm\framed [width=\Bigtextwidth, framecolor=red] %
> {Left margin}
> \stopplacefigure
> 
> \startplacefigure
> \leavevmode\kern0cm\framed [width=\Bigtextwidth, framecolor=red] %
> {Right margin}
> \stopplacefigure
> 
> \stoptext


You can use the command key for \setupfloat to apply a macro to the finished content of the float.

The purpose of this macro is to save the content and compare the width to the width of the text are,
when the figure is wider then the available space use the \leftaligned or \rightaligned commands
to let the content protrude to the outer margins.


\setuppagenumbering[alternative=doublesided]

\setuplayout[backspace=4cm,width=12cm]

\definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth]

\setupfloat[figure][command=\FigureCommand]

\define\FigureCommand
  {\dowithnextbox
     {\signalrightpage
      \ifdim\nextboxwd>\textwidth
        \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
      \else
        \midaligned{\flushnextbox}%
      \fi}
     \hbox}

\showframe

\starttext

\startplacefigure
\framed[width=.8\textwidth,framecolor=red]{Left margin}
\stopplacefigure

\page

\startplacefigure
\framed[width=\measure{Widefigure},framecolor=red]{Left margin}
\stopplacefigure

\input knuth

\page

\startplacefigure
\framed[width=\measure{Widefigure},framecolor=red]{Right margin}
\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
___________________________________________________________________________________


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

* Re: How to make floats extend into the outer margin
  2014-07-24  8:36 ` Wolfgang Schuster
@ 2014-07-24 13:41   ` Keith J. Schultz
  2014-07-25 11:10     ` Hans Hagen
  2014-07-24 16:37   ` Joshua Krämer
  1 sibling, 1 reply; 12+ messages in thread
From: Keith J. Schultz @ 2014-07-24 13:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2554 bytes --]

Hello,

I assume others might have need for this, so it might be a good idea to put this into the
core with a name of something like \widefigure or \ placewidefigure!

Just, a thought!

regards
	Keith. 

Am 24.07.2014 um 10:36 schrieb Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> 
> Am 23.07.2014 um 17:48 schrieb Joshua Krämer <joshua.kraemer@gmail.com>:
> 
>> Dear list,
>> 
>> I have some big-width floats, and want them to span the regular text
>> width plus the outer margin.  I can position them manually with \kern.
>> Is there a way to make them automatically extend into the outer
>> margin?  I have tried different options for location=... without
>> success.
> 
{snip, snip}
> 
> You can use the command key for \setupfloat to apply a macro to the finished content of the float.
> 
> The purpose of this macro is to save the content and compare the width to the width of the text are,
> when the figure is wider then the available space use the \leftaligned or \rightaligned commands
> to let the content protrude to the outer margins.
> 
> 
> \setuppagenumbering[alternative=doublesided]
> 
> \setuplayout[backspace=4cm,width=12cm]
> 
> \definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth]
> 
> \setupfloat[figure][command=\FigureCommand]
> 
> \define\FigureCommand
>  {\dowithnextbox
>     {\signalrightpage
>      \ifdim\nextboxwd>\textwidth
>        \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
>      \else
>        \midaligned{\flushnextbox}%
>      \fi}
>     \hbox}
> 
> \showframe
> 
> \starttext
> 
> \startplacefigure
> \framed[width=.8\textwidth,framecolor=red]{Left margin}
> \stopplacefigure
> 
> \page
> 
> \startplacefigure
> \framed[width=\measure{Widefigure},framecolor=red]{Left margin}
> \stopplacefigure
> 
> \input knuth
> 
> \page
> 
> \startplacefigure
> \framed[width=\measure{Widefigure},framecolor=red]{Right margin}
> \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
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 4119 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-24  8:36 ` Wolfgang Schuster
  2014-07-24 13:41   ` Keith J. Schultz
@ 2014-07-24 16:37   ` Joshua Krämer
  1 sibling, 0 replies; 12+ messages in thread
From: Joshua Krämer @ 2014-07-24 16:37 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

Thank you, Wolfang, it works great.

There's only one problem:  I also have even bigger floats which I need
to turn.  For these turned floats, the left/right alignment leads to
undesired shifting, see the attached example.

How can I avoid the shifting for those?  I've tried to set command={}
manually, but it doesn't work.

May it be even possible to let Context automatically determine if the
float is to be turned right or left, depending on its page?

By the way, is \definemeasure meant as a replacement for \newdimen and
\dimexpr?  Are there caveats about switching to it?

Thanks and kind regards,
Joshua Krämer


\setuppagenumbering[alternative=doublesided]

\setuplayout[backspace=4cm,width=12cm]

\definemeasure[Widetext][\textwidth+\rightmargindistance+\rightmarginwidth]

\setupfloats[command=\FloatCommand]

\define\FloatCommand
  {\dowithnextbox
     {\signalrightpage
      \ifdim\nextboxwd>\textwidth  
        \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
      \else
        \midaligned{\flushnextbox}%
      \fi}
     \hbox}

\showframe

\starttext

\startplacefigure[location={270, page}]
\framed[width=\textheight,framecolor=red]{Turned}
\stopplacefigure

\startplacefigure
\framed[width=\measure{Widetext},framecolor=red]{Left margin}
\stopplacefigure

\input knuth

\page

\startplacefigure
\framed[width=\measure{Widetext},framecolor=red]{Right margin}
\stopplacefigure

\stoptext



___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-24 13:41   ` Keith J. Schultz
@ 2014-07-25 11:10     ` Hans Hagen
  2014-07-25 14:06       ` Rik Kabel
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2014-07-25 11:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/24/2014 3:41 PM, Keith J. Schultz wrote:
> Hello,
>
> I assume others might have need for this, so it might be a good idea to
> put this into the
> core with a name of something like \widefigure or \ placewidefigure!
>
> Just, a thought!
>
> regards
> Keith.
>
> Am 24.07.2014 um 10:36 schrieb Wolfgang Schuster
> <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>>:
>
>>
>> Am 23.07.2014 um 17:48 schrieb Joshua Krämer <joshua.kraemer@gmail.com
>> <mailto:joshua.kraemer@gmail.com>>:
>>
>>> Dear list,
>>>
>>> I have some big-width floats, and want them to span the regular text
>>> width plus the outer margin.  I can position them manually with \kern.
>>> Is there a way to make them automatically extend into the outer
>>> margin?  I have tried different options for location=... without
>>> success.
>>
> {snip, snip}


\starttext

\startplacefigure
     \framed[width=.8\textwidth,framecolor=red]{one}
\stopplacefigure

\setupfloat[figure][location=flushleft]

\startplacefigure
     \framed[width=1.2\textwidth,framecolor=blue]{two}
\stopplacefigure

\stoptext

>> You can use the command key for \setupfloat to apply a macro to the
>> finished content of the float.
>>
>> The purpose of this macro is to save the content and compare the width
>> to the width of the text are,
>> when the figure is wider then the available space use the \leftaligned
>> or \rightaligned commands
>> to let the content protrude to the outer margins.
>>
>>
>> \setuppagenumbering[alternative=doublesided]
>>
>> \setuplayout[backspace=4cm,width=12cm]
>>
>> \definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth]
>>
>> \setupfloat[figure][command=\FigureCommand]
>>
>> \define\FigureCommand
>>  {\dowithnextbox
>>     {\signalrightpage
>>      \ifdim\nextboxwd>\textwidth
>>        \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
>>      \else
>>        \midaligned{\flushnextbox}%
>>      \fi}
>>     \hbox}
>>
>> \showframe
>>
>> \starttext
>>
>> \startplacefigure
>> \framed[width=.8\textwidth,framecolor=red]{Left margin}
>> \stopplacefigure
>>
>> \page
>>
>> \startplacefigure
>> \framed[width=\measure{Widefigure},framecolor=red]{Left margin}
>> \stopplacefigure
>>
>> \input knuth
>>
>> \page
>>
>> \startplacefigure
>> \framed[width=\measure{Widefigure},framecolor=red]{Right margin}
>> \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 <mailto: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
>> ___________________________________________________________________________________
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-25 11:10     ` Hans Hagen
@ 2014-07-25 14:06       ` Rik Kabel
  2014-07-25 14:18         ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Rik Kabel @ 2014-07-25 14:06 UTC (permalink / raw)
  To: ntg-context

On 2014-07-25 07:10, Hans Hagen wrote:
> Am 24.07.2014 um 10:36 schrieb Wolfgang Schuster
>> <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>>:
>>
>
> \starttext
>
> \startplacefigure
>     \framed[width=.8\textwidth,framecolor=red]{one}
> \stopplacefigure
>
> \setupfloat[figure][location=flushleft]
>
> \startplacefigure
>     \framed[width=1.2\textwidth,framecolor=blue]{two}
> \stopplacefigure
>
> \stoptext
>
>>> You can use the command key for \setupfloat to apply a macro to the
>>> finished content of the float.
>>>
>>> The purpose of this macro is to save the content and compare the width
>>> to the width of the text are,
>>> when the figure is wider then the available space use the \leftaligned
>>> or \rightaligned commands
>>> to let the content protrude to the outer margins.
>>>
>>>
>>> \setuppagenumbering[alternative=doublesided]
>>>
>>> \setuplayout[backspace=4cm,width=12cm]
>>>
>>> \definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth] 
>>>
>>>
>>> \setupfloat[figure][command=\FigureCommand]
>>>
>>> \define\FigureCommand
>>>  {\dowithnextbox
>>>     {\signalrightpage
>>>      \ifdim\nextboxwd>\textwidth
>>> \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
>>>      \else
>>>        \midaligned{\flushnextbox}%
>>>      \fi}
>>>     \hbox}
>>>
>>> \showframe
>>>
>>> \starttext
>>>
>>> \startplacefigure
>>> \framed[width=.8\textwidth,framecolor=red]{Left margin}
>>> \stopplacefigure
>>>
>>> \page
>>>
>>> \startplacefigure
>>> \framed[width=\measure{Widefigure},framecolor=red]{Left margin}
>>> \stopplacefigure
>>>
>>> \input knuth
>>>
>>> \page
>>>
>>> \startplacefigure
>>> \framed[width=\measure{Widefigure},framecolor=red]{Right margin}
>>> \stopplacefigure
>>>
>>> \stoptext
>>>
>>> Wolfgang
>>> ___________________________________________________________________________________ 
>>>
With Wolfgang's solution, the captions remain centered on the page. With 
Hans's solution, the captions move with the center of the frame. I 
expect that, if captions are used and there are other figures that are 
not placed with this mechanism, Wolfgang's solution will result in a 
better looking page.

-- 
Rik
___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-25 14:06       ` Rik Kabel
@ 2014-07-25 14:18         ` Hans Hagen
  2014-07-27 14:54           ` Joshua Krämer
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2014-07-25 14:18 UTC (permalink / raw)
  To: ntg-context

On 7/25/2014 4:06 PM, Rik Kabel wrote:
> On 2014-07-25 07:10, Hans Hagen wrote:
>> Am 24.07.2014 um 10:36 schrieb Wolfgang Schuster
>>> <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>>:
>>>
>>
>> \starttext
>>
>> \startplacefigure
>>     \framed[width=.8\textwidth,framecolor=red]{one}
>> \stopplacefigure
>>
>> \setupfloat[figure][location=flushleft]
>>
>> \startplacefigure
>>     \framed[width=1.2\textwidth,framecolor=blue]{two}
>> \stopplacefigure
>>
>> \stoptext
>>
>>>> You can use the command key for \setupfloat to apply a macro to the
>>>> finished content of the float.
>>>>
>>>> The purpose of this macro is to save the content and compare the width
>>>> to the width of the text are,
>>>> when the figure is wider then the available space use the \leftaligned
>>>> or \rightaligned commands
>>>> to let the content protrude to the outer margins.
>>>>
>>>>
>>>> \setuppagenumbering[alternative=doublesided]
>>>>
>>>> \setuplayout[backspace=4cm,width=12cm]
>>>>
>>>> \definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth]
>>>>
>>>>
>>>> \setupfloat[figure][command=\FigureCommand]
>>>>
>>>> \define\FigureCommand
>>>>  {\dowithnextbox
>>>>     {\signalrightpage
>>>>      \ifdim\nextboxwd>\textwidth
>>>> \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
>>>>
>>>>      \else
>>>>        \midaligned{\flushnextbox}%
>>>>      \fi}
>>>>     \hbox}
>>>>
>>>> \showframe
>>>>
>>>> \starttext
>>>>
>>>> \startplacefigure
>>>> \framed[width=.8\textwidth,framecolor=red]{Left margin}
>>>> \stopplacefigure
>>>>
>>>> \page
>>>>
>>>> \startplacefigure
>>>> \framed[width=\measure{Widefigure},framecolor=red]{Left margin}
>>>> \stopplacefigure
>>>>
>>>> \input knuth
>>>>
>>>> \page
>>>>
>>>> \startplacefigure
>>>> \framed[width=\measure{Widefigure},framecolor=red]{Right margin}
>>>> \stopplacefigure
>>>>
>>>> \stoptext
>>>>
>>>> Wolfgang
>>>> ___________________________________________________________________________________
>>>>
> With Wolfgang's solution, the captions remain centered on the page. With
> Hans's solution, the captions move with the center of the frame. I
> expect that, if captions are used and there are other figures that are
> not placed with this mechanism, Wolfgang's solution will result in a
> better looking page.

maybe some day i come up with a cleaner caption handler ...

\showframe

\starttext

\startplacefigure
     \framed[width=.8\textwidth,framecolor=red]{one}
\stopplacefigure

\definefloat[widefigure][figure][figure]
\setupfloat   [widefigure][location=flushleft]
\setupcaptions[widefigure][width=\textwidth,align=middle]

\startplacewidefigure
     \framed[width=1.2\textwidth,framecolor=blue]{two}
\stopplacewidefigure

\stoptext

-----------------------------------------------------------------
                                           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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-25 14:18         ` Hans Hagen
@ 2014-07-27 14:54           ` Joshua Krämer
  2014-07-27 14:57             ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Joshua Krämer @ 2014-07-27 14:54 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

On 2014-07-25, 16:18, Hans Hagen wrote:

> \showframe
> 
> \starttext
> 
> \startplacefigure
>      \framed[width=.8\textwidth,framecolor=red]{one}
> \stopplacefigure
> 
> \definefloat[widefigure][figure][figure]
> \setupfloat   [widefigure][location=flushleft]
> \setupcaptions[widefigure][width=\textwidth,align=middle]
> 
> \startplacewidefigure
>      \framed[width=1.2\textwidth,framecolor=blue]{two}
> \stopplacewidefigure
> 
> \stoptext

Thanks, but this doesn't seem to be a solution to my problem, because
the figures extend into the right margin always, and I want them to
extend into the outer margin (i. e. left margin on left pages, right
margin on right pages).

I'm now using the following semi-automatic solution, but there is one
problem left:  The alignment is not applied to tikz pictures.  Does
somebody have an idea how to resolve this?

Thank you and kind regards,
Joshua


\setuppagenumbering[alternative=doublesided]

\setuplayout[backspace=4cm,width=12cm]

\definemeasure[Widetext][\textwidth+\rightmargindistance+\rightmarginwidth]

\define\WideFloatCommand
  {\dowithnextbox
     {\signalrightpage
      \ifdim\nextboxwd>\textwidth  
        \doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
      \else
        \midaligned{\flushnextbox}%
      \fi}
     \hbox}

\definefloat [widefigure] [figure] [figure]
\setupfloat [widefigure] [command=\WideFloatCommand]

\usemodule[tikz]

\showframe

\starttext

x

\page

\startplacewidefigure
\framed[width=\measure{Widetext}]{One}
\stopplacewidefigure

\startplacewidefigure
\framed[width=3cm]{Two}
\stopplacewidefigure

\startplacewidefigure
\starttikzpicture
\node [draw, minimum width=\measure{Widetext}] {Three};
\stoptikzpicture
\stopplacewidefigure

\startplacewidefigure
\starttikzpicture
\node [draw, minimum width=3cm] {Four};
\stoptikzpicture
\stopplacewidefigure

\startplacewidefigure
\rightaligned{%
\starttikzpicture
\node [draw, minimum width=\measure{Widetext}] {Five};
\stoptikzpicture}
\stopplacewidefigure

\startplacewidefigure
\midaligned{%
\starttikzpicture
\node [draw, minimum width=3cm] {Six};
\stoptikzpicture}
\stopplacewidefigure

\stoptext


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context-wvrSQK3plZs@public.gmane.org / 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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-27 14:54           ` Joshua Krämer
@ 2014-07-27 14:57             ` Wolfgang Schuster
  2014-07-27 17:19               ` Joshua Krämer
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2014-07-27 14:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 27.07.2014 um 16:54 schrieb Joshua Krämer <joshua.kraemer@gmail.com>:

> On 2014-07-25, 16:18, Hans Hagen wrote:
> 
>> \showframe
>> 
>> \starttext
>> 
>> \startplacefigure
>>     \framed[width=.8\textwidth,framecolor=red]{one}
>> \stopplacefigure
>> 
>> \definefloat[widefigure][figure][figure]
>> \setupfloat   [widefigure][location=flushleft]
>> \setupcaptions[widefigure][width=\textwidth,align=middle]
>> 
>> \startplacewidefigure
>>     \framed[width=1.2\textwidth,framecolor=blue]{two}
>> \stopplacewidefigure
>> 
>> \stoptext
> 
> Thanks, but this doesn't seem to be a solution to my problem, because
> the figures extend into the right margin always, and I want them to
> extend into the outer margin (i. e. left margin on left pages, right
> margin on right pages).

\setupfloat[widefigure][location=inner]

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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-27 14:57             ` Wolfgang Schuster
@ 2014-07-27 17:19               ` Joshua Krämer
  2014-07-27 18:13                 ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Joshua Krämer @ 2014-07-27 17:19 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

On 2014-07-27, 16:57, Wolfgang Schuster wrote:
> Am 27.07.2014 um 16:54 schrieb Joshua Krämer
> > Thanks, but this doesn't seem to be a solution to my problem,
> > because the figures extend into the right margin always, and I want
> > them to extend into the outer margin (i. e. left margin on left
> > pages, right margin on right pages).
> 
> \setupfloat[widefigure][location=inner]

Thank you.  But this solution has the problem, too, that the alignment
is ignored for tikz pictures (see example below).

Kind regards,
Joshua


\setuppagenumbering[alternative=doublesided]

\definefloat [widefigure] [figure] [figure]
\setupfloat [widefigure] [location=inner]

\usemodule[tikz]

\showframe

\starttext

x

\page

\startplacewidefigure
\framed[width=1.2\textwidth]{One}
\stopplacewidefigure

\startplacewidefigure
\framed[width=3cm]{Two}
\stopplacewidefigure

\startplacewidefigure
\starttikzpicture
\node [draw, minimum width=1.2\textwidth] {Three};
\stoptikzpicture
\stopplacewidefigure

\startplacewidefigure
\starttikzpicture
\node [draw, minimum width=3cm] {Four};
\stoptikzpicture
\stopplacewidefigure

\startplacewidefigure
\rightaligned{%
\starttikzpicture
\node [draw, minimum width=1.2\textwidth] {Five};
\stoptikzpicture}
\stopplacewidefigure

\startplacewidefigure
\midaligned{%
\starttikzpicture
\node [draw, minimum width=3cm] {Six};
\stoptikzpicture}
\stopplacewidefigure

\stoptext


___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-27 17:19               ` Joshua Krämer
@ 2014-07-27 18:13                 ` Aditya Mahajan
  2014-07-28 18:51                   ` Joshua Krämer
  0 siblings, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2014-07-27 18:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 703 bytes --]

On Sun, 27 Jul 2014, Joshua Krämer wrote:

> On 2014-07-27, 16:57, Wolfgang Schuster wrote:
>> Am 27.07.2014 um 16:54 schrieb Joshua Krämer
>> > Thanks, but this doesn't seem to be a solution to my problem,
>> > because the figures extend into the right margin always, and I want
>> > them to extend into the outer margin (i. e. left margin on left
>> > pages, right margin on right pages).
>> 
>> \setupfloat[widefigure][location=inner]
>
> Thank you.  But this solution has the problem, too, that the alignment
> is ignored for tikz pictures (see example below).

This is a known issue. Wrap your tikz pictures inside a \hbox:

\hbox{\starttikzpicture ... \stoptikzpicture}

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 12+ messages in thread

* Re: How to make floats extend into the outer margin
  2014-07-27 18:13                 ` Aditya Mahajan
@ 2014-07-28 18:51                   ` Joshua Krämer
  0 siblings, 0 replies; 12+ messages in thread
From: Joshua Krämer @ 2014-07-28 18:51 UTC (permalink / raw)
  To: ntg-context-wvrSQK3plZs

On 2014-07-27, 14:13, Aditya Mahajan wrote:
> On Sun, 27 Jul 2014, Joshua Krämer wrote:
> > Thank you.  But this solution has the problem, too, that the
> > alignment is ignored for tikz pictures (see example below).
> This is a known issue. Wrap your tikz pictures inside a \hbox:
> \hbox{\starttikzpicture ... \stoptikzpicture}

Great, thank you!

Kind regards,
Joshua


___________________________________________________________________________________
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] 12+ messages in thread

end of thread, other threads:[~2014-07-28 18:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 15:48 How to make floats extend into the outer margin Joshua Krämer
2014-07-24  8:36 ` Wolfgang Schuster
2014-07-24 13:41   ` Keith J. Schultz
2014-07-25 11:10     ` Hans Hagen
2014-07-25 14:06       ` Rik Kabel
2014-07-25 14:18         ` Hans Hagen
2014-07-27 14:54           ` Joshua Krämer
2014-07-27 14:57             ` Wolfgang Schuster
2014-07-27 17:19               ` Joshua Krämer
2014-07-27 18:13                 ` Aditya Mahajan
2014-07-28 18:51                   ` Joshua Krämer
2014-07-24 16:37   ` Joshua Krämer

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).