# [texhax] multipage framed boxes?

Morten Høgholm morten.hoegholm at gmail.com
Thu Aug 11 11:04:22 CEST 2005

On Wed, 10 Aug 2005 18:42:05 +0200, William F. Adams <wadams at atlis.com>
wrote:

> On Aug 10, 2005, at 11:23 AM, Morten Høgholm wrote:
>
>> framed environment will do that kind of thing, only it doesn't allow
>> the boxes to be open like those verbatim examples do. Also it won't do
>> floating material like footnotes, marginpars and figures. For that you
>> have to do something else.
>
> Another alternative here is to use the framed environment and ensure
> that the frame will extend down beyond the normal area for the text
> block.
>
> Then, set a flag when one starts a framed environment so that a white
> block to remove the bottom edge of the frame will be set at the top and
> bottom of the page (say using the afterpage package). Then, clear the
> flag when the framed environment ends.

Yes, this works for the framed environment but not for the floating parts,
which was what I meant. I just wasn't able to express myself very well...
;-)

I did some hacks a while ago to make framed work with color (and colors in
pdftex in particular) and continuation texts. In order to make that work I
introduced different frame types depending on whether there were page
breaks or not. However it doesn't solve the real problem of floating
objects that might occur in the text, which is why I searched for a
different solution. Using eso-pic to draw the frame or shading behind the
text seems to work very well, but the hardest part is getting the correct
positioning information out from LaTeX. I used \pdfsavepos and friends to
do this together with ntheorem and empheq, where the endmark algorithm was
abused to write its position to a file. Blasted authors - think they can
have all their wishes come true... But since they pay then...

I imagine this sort of thing would be much easier with the LaTeX3 output
routine in a combination with the galley2 package. I'm reading up on the
latter these days - rather intricate stuff but it's that kind of approach
we need to get things right (and colors and all that hyperref stuff to
work flawlessly).
--
Morten