Flexible text flow (threaded columns) on folded card
Hello everyone, I am trying to create a study script in ConTeXt where each topic fits onto a folded A4 sheet in landscape orientation, so that when folded it becomes an A5 card. I would like to layout the (double-sided) card in its opened form (A4 landscape), but think of it as having four pages (A5). In this layout, I would like the text to flow across my four pages in a flexible way: - start on the left half of the front page, - then continue on the left half of the back page, - continue on the right half of the back page, - and finally continue on the right half of the front page. If working in a page layout software I would simply link four text frames in this order. Now, working in ConTeXt, I thought there could be something like threaded columns... so, I found the manual on *Columns* and played around, think that somehow \definecolumnsetarea could be useful. Alas, I couldn't even manage to make the examples look correct. And I'm failing to understand most of the parameters, as they don't seem to do what they are supposed to do (according to information found online or in the manual): Is ConTeXt suitable for this kind of workflow at all? And if so, what is the recommended mechanism to link such custom areas and have text flow across them? Below is a first minimal MWE... Of course, this is static and does not yet provide the automatic text flow I am looking for: --- \showgrid \setuppapersize[A4,landscape] \setuplayout[location=middle, marking=off] % columnset with two comumns (I'm guessing this is per page?) \definecolumnset[card][n=2] \setupcolumnset[card][distance=1.5\bodyfontsize] % trying to define a column set area \definecolumnsetarea [frontleft] [both] % what is ``both'' supposed to do? [ x=1, y=0, nx=1, ny=10, % try 10 lines for a start ] \setupcolumnsetareatext [frontleft] [both] % this doesn't seem to work at all!? Is ``both'' necessary? What should it do? [\dorecurse{1}{\input knuth\par}] % \definetextflow [myflow] % Am I supposed to define and use a textflow? \starttext \startcolumnset[card] \dorecurse{8}{\input knuth\par} \stopcolumnset \stoptext --- Could anyone point me to a proper approach or more information about this kind of layout with linked text areas in ConTeXt (LMTX)? Thanks a lot in advance! Best regards, Marcus
Am 28.08.2025 um 21:27 schrieb Marcus Christopher Ludl:
Hello everyone,
I am trying to create a study script in ConTeXt where each topic fits onto a folded A4 sheet in landscape orientation, so that when folded it becomes an A5 card.
I would like to layout the (double-sided) card in its opened form (A4 landscape), but think of it as having four pages (A5). In this layout, I would like the text to flow across my four pages in a flexible way: - start on the left half of the front page, - then continue on the left half of the back page, - continue on the right half of the back page, - and finally continue on the right half of the front page.
The normal position for the first page is on the right side for left to right document and left for right to left documents.
If working in a page layout software I would simply link four text frames in this order. Now, working in ConTeXt, I thought there could be something like threaded columns... so, I found the manual on *Columns* and played around, think that somehow \definecolumnsetarea could be useful. Alas, I couldn't even manage to make the examples look correct. And I'm failing to understand most of the parameters, as they don't seem to do what they are supposed to do (according to information found online or in the manual):
Is ConTeXt suitable for this kind of workflow at all? And if so, what is the recommended mechanism to link such custom areas and have text flow across them? Below is a first minimal MWE... Of course, this is static and does not yet provide the automatic text flow I am looking for:
You can take a look at the imposition mechanism. \setuppapersize[A5][A4,landscape] \setuparranging[2*2] \starttext \dorecurse{6}{\samplefile{lorem}} \stoptext Wolfgang
Thank you, Wolfgang. That's an interesting suggestion... I have worked with that imposition mechanism before, so I will indeed have a look into it again. However, in this case, I was actually looking for a way to achieve a kind of flexible linking or threading between "pages" or "frames" or "columnsetareas"... My folded card will not be folded exactly in the middle, there will be some space left for ring binding. So, I think, I need a way to specify the exact positions for the four text areas... Thank you for your help. Marcus Am 28.08.25 um 21:51 schrieb Wolfgang Schuster:
Am 28.08.2025 um 21:27 schrieb Marcus Christopher Ludl:
Hello everyone,
I am trying to create a study script in ConTeXt where each topic fits onto a folded A4 sheet in landscape orientation, so that when folded it becomes an A5 card.
I would like to layout the (double-sided) card in its opened form (A4 landscape), but think of it as having four pages (A5). In this layout, I would like the text to flow across my four pages in a flexible way: - start on the left half of the front page, - then continue on the left half of the back page, - continue on the right half of the back page, - and finally continue on the right half of the front page.
The normal position for the first page is on the right side for left to right document and left for right to left documents.
If working in a page layout software I would simply link four text frames in this order. Now, working in ConTeXt, I thought there could be something like threaded columns... so, I found the manual on *Columns* and played around, think that somehow \definecolumnsetarea could be useful. Alas, I couldn't even manage to make the examples look correct. And I'm failing to understand most of the parameters, as they don't seem to do what they are supposed to do (according to information found online or in the manual):
Is ConTeXt suitable for this kind of workflow at all? And if so, what is the recommended mechanism to link such custom areas and have text flow across them? Below is a first minimal MWE... Of course, this is static and does not yet provide the automatic text flow I am looking for:
You can take a look at the imposition mechanism.
\setuppapersize[A5][A4,landscape]
\setuparranging[2*2]
\starttext \dorecurse{6}{\samplefile{lorem}} \stoptext
Wolfgang
On 30 Aug 2025, at 19:50, Marcus Christopher Ludl
wrote: Thank you, Wolfgang. That's an interesting suggestion... I have worked with that imposition mechanism before, so I will indeed have a look into it again.
However, in this case, I was actually looking for a way to achieve a kind of flexible linking or threading between "pages" or "frames" or "columnsetareas"... My folded card will not be folded exactly in the middle, there will be some space left for ring binding. So, I think, I need a way to specify the exact positions for the four text areas...
Thank you for your help. Marcus
Hi Marcus, The following MWE meets your original request, if I understood it correctly: \setuppapersize[A5][A4,landscape] \installpagearrangement 1*4*2*3 {\dosetuparrangement{2}{1}{4}{0}{0}% X,Y,Total,hcutmarks,vcutmarks \pusharrangedpageONEFOURTWOTHREE\poparrangedpagesAtoB\relax} \def\pusharrangedpageONEFOURTWOTHREE#1% {\advancearrangedpageN \reportarrangedpage\arrangedpageN \ifcase\arrangedpageN \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 rot,hskip,vskip \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 \or \handlearrangedpageXandY{#1}010\arrangedpageB % 3 \or \handlearrangedpageXandY{#1}010\arrangedpageA % 4 \poparrangedpages \fi} \def\poparrangedpagesAtoB {\ifnum\arrangedpageN>\zerocount \paperwidth\arrangedpageX\paperwidth \paperheight\arrangedpageY\paperheight \outputarrangedbox\arrangedpageA \outputarrangedbox\arrangedpageB \global\arrangedpageN\zerocount \fi} \setuparranging[1*4*2*3] \starttext \dorecurse{8} { \centeraligned{\tfd Page \recurselevel} \input knuth \page } \stoptext I'm not sure how this will react to different page sizes (for the ring binder space etc) so you may need to use a completely different approach whereby you print a "normal" document to PDF in regular page order, and then process that PDF using a separate Context file and /insertpages to achieve the layout you want. Regards, — Bruce Horrocks Hampshire, UK
Am 31.08.2025 um 20:11 schrieb Bruce Horrocks:
[...]
I'm not sure how this will react to different page sizes (for the ring binder space etc) so you may need to use a completely different approach whereby you print a "normal" document to PDF in regular page order, and then process that PDF using a separate Context file and /insertpages to achieve the layout you want.
The imposition mechanism isn't the best solution in this case to achieve something like the result from the example with a wide left margin. A two step mechanism with with one document for the content and a second for the page placement is the simples solution. With the help of a buffer and \typesetbuffer it should be possible to combine both in a single document. %% begin example \setuppapersize[A4,landscape] \setuppagenumbering[alternative=doublesided] \setuplayout[backspace=6cm] \starttext \showboxes \startcolumns Second page\column Third page\column First page\column Fourth page\column \stopcolumns \stoptext %% end example Wolfgang
Am 31.08.2025 um 22:08 schrieb Wolfgang Schuster:
Am 31.08.2025 um 20:11 schrieb Bruce Horrocks:
[...]
I'm not sure how this will react to different page sizes (for the ring binder space etc) so you may need to use a completely different approach whereby you print a "normal" document to PDF in regular page order, and then process that PDF using a separate Context file and / insertpages to achieve the layout you want.
The imposition mechanism isn't the best solution in this case to achieve something like the result from the example with a wide left margin.
A two step mechanism with with one document for the content and a second for the page placement is the simples solution. With the help of a buffer and \typesetbuffer it should be possible to combine both in a single document.
A simple example for the buffer method: \startbuffer[content] \definepapersize[column][width=100mm,height=210mm] \setuppapersize[column] \dorecurse{200}{Line \recurselevel\par} \stopbuffer \setuppapersize[A4,landscape] \setuplayout[page] \starttext \setupTABLE [start] [frame=off, offset=0pt, height=th, align={middle,lohi}, textwidth=tw, option=stretch] \bTABLE \bTR \bTD \eTD \bTD \typesetbuffer[content][page=2] \eTD \bTD \typesetbuffer[content][page=3] \eTD \eTR \eTABLE \bTABLE \bTR \bTD \typesetbuffer[content][page=1] \eTD \bTD \typesetbuffer[content][page=4] \eTD \bTD \eTD \eTR \eTABLE \stoptext Wolfgang
Thank you, Wolfgang, for the suggestion using the buffer. This seems like a very good solution, indeed. I hadn't thought of that. I noticed that this buffer even respects headlines starting on a new page... %% begin: section test \startbuffer[content] \definepapersize[column][width=100mm,height=210mm] \setuppapersize[column] \setuphead[section][ page=yes ] \startsection[title={First Section}] \dorecurse{15}{Line \recurselevel\par} \startsection[title={Second Section}] \dorecurse{17}{Line \recurselevel\par} \startsection[title={Third Section}] \dorecurse{200}{Line \recurselevel\par} \stopbuffer (...) %% end: section test So, this will work well, I think. Thanks a lot! :D Marcus Am 31.08.25 um 22:22 schrieb Wolfgang Schuster:
Am 31.08.2025 um 22:08 schrieb Wolfgang Schuster:
Am 31.08.2025 um 20:11 schrieb Bruce Horrocks:
[...]
I'm not sure how this will react to different page sizes (for the ring binder space etc) so you may need to use a completely different approach whereby you print a "normal" document to PDF in regular page order, and then process that PDF using a separate Context file and / insertpages to achieve the layout you want.
The imposition mechanism isn't the best solution in this case to achieve something like the result from the example with a wide left margin.
A two step mechanism with with one document for the content and a second for the page placement is the simples solution. With the help of a buffer and \typesetbuffer it should be possible to combine both in a single document.
A simple example for the buffer method:
\startbuffer[content] \definepapersize[column][width=100mm,height=210mm] \setuppapersize[column] \dorecurse{200}{Line \recurselevel\par} \stopbuffer
\setuppapersize[A4,landscape]
\setuplayout[page]
\starttext
\setupTABLE [start] [frame=off, offset=0pt, height=th, align={middle,lohi}, textwidth=tw, option=stretch]
\bTABLE \bTR \bTD \eTD \bTD \typesetbuffer[content][page=2] \eTD \bTD \typesetbuffer[content][page=3] \eTD \eTR \eTABLE
\bTABLE \bTR \bTD \typesetbuffer[content][page=1] \eTD \bTD \typesetbuffer[content][page=4] \eTD \bTD \eTD \eTR \eTABLE
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________
participants (3)
-
Bruce Horrocks -
Marcus Christopher Ludl -
Wolfgang Schuster