ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Willi Egger <context@boede.nl>
Subject: Re: Centering figures that extend into the margin
Date: Wed, 20 Apr 2022 22:44:03 +0200	[thread overview]
Message-ID: <149A9FC4-3F64-4258-BB7F-10BB233900E6@boede.nl> (raw)
In-Reply-To: <m2pmlcnlfk.fsf@Yanns-MacBook-Pro.local.mail-host-address-is-not-set>

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 <ntg-context@ntg.nl> 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
___________________________________________________________________________________

  reply	other threads:[~2022-04-20 20:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  9:39 yann--- via ntg-context
2022-04-20 20:44 ` Willi Egger via ntg-context [this message]
2022-04-20 21:01   ` Yann Herklotz via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=149A9FC4-3F64-4258-BB7F-10BB233900E6@boede.nl \
    --to=ntg-context@ntg.nl \
    --cc=context@boede.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).