Re: [NTG-context] Centering figures that extend into the margin

2022-04-20 Thread Yann Herklotz via ntg-context
Hi Willi,

> I have not a solution for you but I would like to point you to the “details”
> manual, where many of special placements of floats are discussed.

Thanks a lot for the pointer, I'll have a look at that manual in more detail as
I had only had a cursory glance until now.

Kind regards,
Yann

-- 
Yann Herklotz
https://yannherklotz.com
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Centering figures that extend into the margin

2022-04-20 Thread Willi Egger via ntg-context
Hi Yann,

I have not a solution for you  but I would like to point you to the “details” 
manual, where many of special placements of floats are discussed.

Kind regards

Willi

> On 20 Apr 2022, at 11:39, yann--- via ntg-context  wrote:
> 
> Hi,
> 
> I've been playing around with 'marginnote' layout similar to tufte's books.  
> The
> main thing that I can't figure out is how to centre figures that extend into 
> the
> margin.  These should take over the whole page, but the content of the figure
> should be centred, which is normally the case in normal figures.
> 
> Below is my try of defining a marginnote that does this, by calculating the
> textarea size and setting the width to that.  However, I can't seem to then
> figure out how to center the externalfigure inside of the figure.
> 
> Thanks in advance!
> Yann
> 
> \useMPlibrary[dum]
> 
> \setuplayout[
> edgedistance=1cm,
> backspace=2cm,
> rightmargin=4.5cm,
> leftmargin=0cm,
> topspace=1cm,
> header=1cm,
> footer=1cm,
> headerdistance=0.5cm,
> width=fit,
> height=fit,
> ]
> 
> \newdimen\LeftMarginSize
> \LeftMarginSize=\dimexpr \backspace + \rightmarginwidth + 
> \rightmargindistance \relax
> \newdimen\TextAreaSize
> \TextAreaSize=\dimexpr \textwidth + \rightmarginwidth + \rightmargindistance 
> \relax
> \definefloat[marginfigure][marginfigures][figure]
> \setupfloat[marginfigure][location=inner,default=top,width=\TextAreaSize]
> \setupcaptions[marginfigure][
> leftmargin=\dimexpr \LeftMarginSize / 2 \relax,
> location=bottom,
> width=\textwidth,
> ]
> \setuplabeltext[marginfigure=Figure~]
> \showframe
> 
> \starttext
> 
> \startplacemarginfigure
> \externalfigure[][width=13cm]
> \stopplacemarginfigure
> 
> \stoptext
> 
> -- 
> Yann Herklotz
> https://yannherklotz.com
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Centering figures that extend into the margin

2022-04-20 Thread yann--- via ntg-context
Hi,

I've been playing around with 'marginnote' layout similar to tufte's books.  The
main thing that I can't figure out is how to centre figures that extend into the
margin.  These should take over the whole page, but the content of the figure
should be centred, which is normally the case in normal figures.

Below is my try of defining a marginnote that does this, by calculating the
textarea size and setting the width to that.  However, I can't seem to then
figure out how to center the externalfigure inside of the figure.

Thanks in advance!
Yann

\useMPlibrary[dum]

\setuplayout[
  edgedistance=1cm,
  backspace=2cm,
  rightmargin=4.5cm,
  leftmargin=0cm,
  topspace=1cm,
  header=1cm,
  footer=1cm,
  headerdistance=0.5cm,
  width=fit,
  height=fit,
]

\newdimen\LeftMarginSize
\LeftMarginSize=\dimexpr \backspace + \rightmarginwidth + \rightmargindistance 
\relax
\newdimen\TextAreaSize
\TextAreaSize=\dimexpr \textwidth + \rightmarginwidth + \rightmargindistance 
\relax
\definefloat[marginfigure][marginfigures][figure]
\setupfloat[marginfigure][location=inner,default=top,width=\TextAreaSize]
\setupcaptions[marginfigure][
  leftmargin=\dimexpr \LeftMarginSize / 2 \relax,
  location=bottom,
  width=\textwidth,
]
\setuplabeltext[marginfigure=Figure~]
\showframe

\starttext

\startplacemarginfigure
\externalfigure[][width=13cm]
\stopplacemarginfigure

\stoptext

-- 
Yann Herklotz
https://yannherklotz.com
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___