ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Force all floats on opposite even pages
@ 2007-03-29 17:36 Luuk Beurskens
  2007-03-29 20:02 ` Sanjoy Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Luuk Beurskens @ 2007-03-29 17:36 UTC (permalink / raw)
  To: ntg-context

Dear all,

For the document I am currently working on I would like to have some
control on the placing of the floats.

What I would like is that all text is put on the odd pages (n), and that
all floats are put on the opposite even pages (n-1).

This can result in sub-optimal breaking of pages, but that depends on
the ratio of the amount of floats versus the amount of text.

Does anyone have an idea how to tackle this? Has something similar been
done already?

Thanks in advance for suggestions.

Best regards,

Luuk Beurskens
The Netherlands

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-29 17:36 Force all floats on opposite even pages Luuk Beurskens
@ 2007-03-29 20:02 ` Sanjoy Mahajan
  2007-03-29 22:14   ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Sanjoy Mahajan @ 2007-03-29 20:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> What I would like is that all text is put on the odd pages (n), and
> that all floats are put on the opposite even pages (n-1).

One option is to use a big papersize, e.g. A3, equivalent to two
regular pages side by side.  Then put the floats in the new left
"margin", where the new left margin is the old even-numbered page.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-29 20:02 ` Sanjoy Mahajan
@ 2007-03-29 22:14   ` Hans Hagen
  2007-03-30  9:09     ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2007-03-29 22:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Sanjoy Mahajan wrote:
>> What I would like is that all text is put on the odd pages (n), and
>> that all floats are put on the opposite even pages (n-1).
>>     
>
> One option is to use a big papersize, e.g. A3, equivalent to two
> regular pages side by side.  Then put the floats in the new left
> "margin", where the new left margin is the old even-numbered page.
>   
ah, interesting idea! 

Hans 


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-29 22:14   ` Hans Hagen
@ 2007-03-30  9:09     ` Taco Hoekwater
  2007-03-30 14:54       ` Luuk Beurskens
  0 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2007-03-30  9:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Hans Hagen wrote:
> Sanjoy Mahajan wrote:
>>> What I would like is that all text is put on the odd pages (n), and
>>> that all floats are put on the opposite even pages (n-1).
>>>     

It would be nice if this was supported by the output routine,
but it is not all that easy. I remember I had a document that had
the same requirement years ago, but I do not recall anoymore how
I solved it. Since it was short, possible I just did it all by
hand. The idea of that approach is that you do a test run to see
where TeX breaks the page, then force a page break at that point,
by breaking the input:

         bla bla bla bla

into

	bla bla{\parfillskip0pt\par\page}

         \noindent bla bla

Inbetween those two lines, you can now do anything you like.

Taco

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-30  9:09     ` Taco Hoekwater
@ 2007-03-30 14:54       ` Luuk Beurskens
  2007-03-30 15:15         ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Luuk Beurskens @ 2007-03-30 14:54 UTC (permalink / raw)
  To: ntg-context

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?

My document is rather long, so manual page breaking is not my preferred 
way of doing it.

Myself I was thinking that the floats belonging to odd page n could be 
put on even page n+1, and then try to renumber the pages (i.e. PDF page 
n+1 gets page number n-1 printed) and then reshuffle the PDF pages. 
Would that work?

Kind regards,

Luuk Beurskens
The Netherlands


Taco Hoekwater wrote:
> 
> Hans Hagen wrote:
>> Sanjoy Mahajan wrote:
>>>> What I would like is that all text is put on the odd pages (n), and
>>>> that all floats are put on the opposite even pages (n-1).
>>>>     
> 
> It would be nice if this was supported by the output routine,
> but it is not all that easy. I remember I had a document that had
> the same requirement years ago, but I do not recall anoymore how
> I solved it. Since it was short, possible I just did it all by
> hand. The idea of that approach is that you do a test run to see
> where TeX breaks the page, then force a page break at that point,
> by breaking the input:
> 
>          bla bla bla bla
> 
> into
> 
> 	bla bla{\parfillskip0pt\par\page}
> 
>          \noindent bla bla
> 
> Inbetween those two lines, you can now do anything you like.
> 
> Taco
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-30 14:54       ` Luuk Beurskens
@ 2007-03-30 15:15         ` Taco Hoekwater
  2007-03-31 13:53           ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Taco Hoekwater @ 2007-03-30 15:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Force all floats on opposite even pages
  2007-03-30 15:15         ` Taco Hoekwater
@ 2007-03-31 13:53           ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2007-03-31 13:53 UTC (permalink / raw)
  To: ntg-context

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-31 13:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-29 17:36 Force all floats on opposite even pages 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 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).