ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: ntg-context@ntg.nl
Subject: Re: Force all floats on opposite even pages
Date: Sat, 31 Mar 2007 15:53:43 +0200	[thread overview]
Message-ID: <20070331155343.86253297.schuster.wolfgang@googlemail.com> (raw)
In-Reply-To: <460D2988.4020108@elvenkind.com>

On Fri, 30 Mar 2007 17:15:20 +0200
Taco Hoekwater <taco@elvenkind.com> wrote:

> 
> 
> Luuk Beurskens wrote:
> > Thank you Sanjoy, Hans and Taco for the suggestions made.
> > 
> > My interpretation of Taco's remark is that Sanjoy's solution might not 
> > work as expected, is that correct?
> 
> Mostly for practical reasons: it depends on how complex your pages
> really are. In a document with complicated headers and footers and
> different margin widths, it could become quite a challenge to make
> everything in the final printed pages come out in the right spot.
> Other issues are things like: you 'll have to fool the page number
> conversion, and such pages will frustrate impositioning software
> completely (putting all float pages at the end results in the same
> practical problems).
> 
> But if such things are not a concern, then it will definately beat
> my solution especially for a long document. Manual page breaking
> is tedious at best, and really only workable for static texts.
> 
> Taco
> 

Hi all,

there is a way to move all text to the right page and put the figures
on the left page. The hard thing is to get all figures before the text
and not on the following one. You can do this by manipulating the
pagefloats macro. I created a minimum example that shows the results
and effects.

\setupfloat[figure][default=leftpage]
\setupframed[width=8cm,height=12cm]

\def\flushpagefloats
  {\doifoddpageelse
     {\ifvoid\collectedleftpagefloats
        \ifvoid\collectedrightpagefloats\else
           \unvbox\collectedrightpagefloats
           \page
          %\the\everytopofpage
        \fi
      \fi}
     {\ifvoid\collectedleftpagefloats
        \dontleavehmode\page % added
      \else
        \unvbox\collectedleftpagefloats
        \page
       %\the\everytopofpage
      \fi
      \ifvoid\collectedrightpagefloats\else
         \unvbox\collectedrightpagefloats
         \page
        %\the\everytopofpage
      \fi}%
   \ifvoid\collectedpagefloats\else
     % message
     \unvbox\collectedpagefloats
   \fi}

\def\oddpagenumbers#1{\ifodd\pageno\the\numexpr(\pageno-1)/2+1\relax
\else\fi} \defineconversion [oddpagenumber][\oddpagenumbers]
%\setuppagenumbering[conversion=oddpagenumber]

\starttext

\dorecurse
  {10}
  {\dorecurse
     {12}
     {\section{Knuth}\input knuth\par}
   \placefigure{}{\framed{}}
   %\page[right]
   \midaligned{Figure \recurselevel}
   \dorecurse
     {4}
     {\section{Knuth}\input knuth\par}}

\stoptext

You can try to start with this and adapt it to your own requirements.
It would be also better to write a macro that did all the dirty things
like place the figure on the left page, make a page break etc.

Wolfgang

      reply	other threads:[~2007-03-31 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29 17:36 Luuk Beurskens
2007-03-29 20:02 ` Sanjoy Mahajan
2007-03-29 22:14   ` Hans Hagen
2007-03-30  9:09     ` Taco Hoekwater
2007-03-30 14:54       ` Luuk Beurskens
2007-03-30 15:15         ` Taco Hoekwater
2007-03-31 13:53           ` Wolfgang Schuster [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=20070331155343.86253297.schuster.wolfgang@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.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).