Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I answered a question last week about creating a continuous but breakable rule next to an arbitrary number of paragraphs in Plain TeX. My solution gathered the paragraphs to rule in a vbox; my output routine put that content into an hbox and added a vrule. If the content overflowed, I used vsplit to place as much as a I could, then deferred the rest to the next page.

Could I have done this (in Plain TeX) without a custom output routine?

share|improve this question
    
Learning if there is way to solve this problem without a output routine. –  Justin Bailey Dec 22 '11 at 16:29
    
You can hook into the \shipout with Heiko Oberdiek's atbegshi package. That's after the OR, and thus doesn't interfere with it. To know where to place the rule, you need to save the position, perhaps using the zpos package (just a vague recollection)? –  Bruno Le Floch Dec 22 '11 at 17:51
    
@JustinBailey Yes, you could the solution was rather overcomplicated. You could after placing the par in a vbox, split it per line iteratively at baselineskip, add rule and then release into stream. –  Yiannis Lazarides Dec 22 '11 at 17:54
    
@YiannisLazarides as egreg is pointing out on chat, whatsits are not removable, so you may have some trouble doing that if the text contains marks (used for indices?). –  Bruno Le Floch Dec 22 '11 at 18:14
1  
@JustinBailey: I am sorry, I was thinking of the zref-pos package, which provides commands \zsavepos, \zposx, and \zposy, which store the current position on the page, and access it. The idea would be to (1) store the position and page at the start of the block and the position and page at the end, (2) catch pages when they are shipped out to the pdf/dvi, thanks to the atbegshi package, (3) on each such page, check if there is a highlighted block (perhaps several), using info from zref-pos, and add the appropriate vertical rules in the margin (overlayed on the page). –  Bruno Le Floch May 26 '13 at 8:44

1 Answer 1

up vote 6 down vote accepted

Unless you are prepared to support only a limited number of situations (and even then ...) the answer is no. It is true that you could split collected vertical material using a suitable loop and \vsplit, however, in comparison to an OR the \vsplit operation lacks the following:

  • no handling of insertion material (could be ok for this application)
  • no record of the penalty associated with the split (available in the OR via \outputpenalty)

The latter at least is important if you want to disect a vertical list, add something to it and then rebuild it again so that normal break points can be found in the same places.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.