ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Joshua Krämer" <joshua.kraemer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: ntg-context-wvrSQK3plZs@public.gmane.org
Subject: Re: How to make floats extend into the outer margin
Date: Thu, 24 Jul 2014 18:37:01 +0200	[thread overview]
Message-ID: <20140724183701.34e79927@medea1.site> (raw)
In-Reply-To: <2FB7FAD6-68F3-4B92-BAB3-D608FCD3E4AB@gmail.com>

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
___________________________________________________________________________________

      parent reply	other threads:[~2014-07-24 16:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 15:48 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 message]

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=20140724183701.34e79927@medea1.site \
    --to=joshua.kraemer-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ntg-context-wvrSQK3plZs@public.gmane.org \
    /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).