Force all floats on opposite even pages
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
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)
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 -----------------------------------------------------------------
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
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
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
On Fri, 30 Mar 2007 17:15:20 +0200
Taco Hoekwater
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
participants (5)
-
Hans Hagen
-
Luuk Beurskens
-
Sanjoy Mahajan
-
Taco Hoekwater
-
Wolfgang Schuster