3

I have a section of text that contains several paragraphs, enumerated lists and possibly small tables (3 or 4 rows maximum), and where this section of text crosses a page boundary I'd like to put “continued…” at the bottom of the page and “…continued” at the top of the next page.

What I have so far is:

  1. Put it all into a \vbox
  2. Work out how much space is left on the page using \textheight - \pagetotal (and subtract a little but more for the “continued…” text)
  3. \vsplit the vbox based on the above calculation (or place the entire vbox if it will fit on the page and then “exit”).
  4. Put the split box on the page, then the “continued…” text, then put “…continued” on the next page.
  5. Repeat steps 2–4.

This seems to work but it doesn't split the text in very nice places. In some cases it splits I can post code if necessary but I'll have to try and clean it up first or you'll get nightmares.

I was just wondering if there was a simpler (or even built-in way) to do this in ConTeXt. I am trying to automate the production of some documents using ConTeXt but the specification that I have to match is unfortunately very strict (and ugly).

dreamlax
  • 619
  • related: http://tex.stackexchange.com/questions/148043/how-to-generate-a-section-continued-heading-after-page-break/166167#166167. It's not in ConTeXt but it shows a working version of the algorithm you have in mind. – Ruben Jul 23 '15 at 11:07
  • It it okay if "continued..." appears on the page footer, so that you don't have to do step 2? It so, then a simple solution is to add achors at the beginning and end of a paragraph, check if the page numbers of the anchors is the same, and if not, add "continued..." in the footer (or any fixed location on the page using layers). – Aditya Jul 23 '15 at 17:06
  • I meant, Is it okay ... – Aditya Jul 23 '15 at 18:49
  • 1
    @Aditya When you show the text in the footer there is a even simpler solution. What you have to do is to open a group with \start at the begin of the section and \stop at the end of it, now you can use \setupfootertexts to set a different text for the footer which appears only when there is a page break in this group. – Wolfgang Schuster Jul 23 '15 at 20:53
  • @Aditya there is already a footer present. I think I could change it on the fly though, but what will I do about putting "...continued" at the top of the next page? – dreamlax Jul 23 '15 at 22:23
  • @Metafox: That should work with layers as well, so you can position the text anywhere on the page. – Aditya Jul 24 '15 at 03:21
  • @dreamlax: Put the "...continued" in the header as well :-) – Aditya Jul 24 '15 at 03:21
  • @Metafox perhaps I'm not doing something right, but when I change the header and footer within the \start and \stop block, then I get "...continued" at the top of a page whenever there is also a "continued..." at the bottom of the page, which means, there are erroneous "...continued" appearing at the top of the page even though "...continued" was not supposed to appear until the next page. Am I making sense? – dreamlax Dec 18 '15 at 10:24
  • @Aditya after some time I think I may have to take on your suggestion. The \pagetotal value never seems to be very reliable, it seems I am battling TeX's paragraph building routine or something, as sometimes \pagetotal gives the expected value, but other times, it is as if most of the content has not yet been placed on the page (speaking of which, is there any way to force TeX to do this?). – dreamlax Dec 18 '15 at 10:38

0 Answers0