0

I would like to build a LaTeX environment that could include a diagram to be rendered at full size, followed by a subsequent discussion of said diagram.

What I would really like to do here is have the digram be REPEATED if the discussion crosses an odd-numbered page boundary (so the reader doesn't have to flip back and forth between pages to refer to the diagram while reading the discussion).

Ideally I'd like to repeat the diagram at half-size and floating in the upper left corner, with text wrapping around it.

I don't know how to accomplish this. I'm somewhat familiar with creating custom output routines in plain TeX (although it's been years since I've done so), but I can't figure out any way to conditionally insert content at a page break, and reflow the text based on the insertion.

Can anyone think of a way to do this, or even to semi-automate it?

  • 1
    inserting content at a page break you could do with afterpage but you can not reflow text at that point, the paragraph that split over the page is broken into full width lines before the page break is considered and that can't be undone. It is possible to set things up in luatex with callbacks to retain and reset the paragarph or to set up multipass systems in classic tex so that you record where the page broke and fix up the linebreaking on the next run, but it is hard to ensure that ever converges.... so it depends how much you want the text wrap feature... – David Carlisle Aug 3 '16 at 15:45
  • 1
    if you allow yourself manual insertion of a command to force a page break and re-insert the last image, then it's easy of course. – David Carlisle Aug 3 '16 at 15:47
  • I see -- so if I'm willing to just have the diagram again at the top of the page, but not reflow any lines / paragraphs, I could do this without too much effort, is that accurate? – Greg Humphreys Aug 3 '16 at 16:58
  • 1
    well, certainly a lot less effort:-) – David Carlisle Aug 3 '16 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.