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: Sun, 27 Jul 2014 16:54:31 +0200	[thread overview]
Message-ID: <20140727165431.0f8deef1@medea1.site> (raw)
In-Reply-To: <53D26720.2020300@wxs.nl>

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
___________________________________________________________________________________


  reply	other threads:[~2014-07-27 14:54 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 [this message]
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

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=20140727165431.0f8deef1@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).