### Breaking boxes of text

(La)TeX boxes may not be broken, in ordinary usage: once you’ve typeset something into a box, it will stay there, and the box will jut out beyond the side or the bottom of the page if it doesn’t fit in the typeset area.

If you want a substantial portion of your text to be framed (or coloured), the restriction starts to seem a real imposition. Fortunately, there are ways around the problem.

The framed package provides `framed` and `shaded` environments; both put their content into something which looks like a framed (or coloured) box, but which breaks as necessary at page end. The environments “lose” footnotes, marginpars and head-line entries, and will not work with multicol or other column-balancing macros. The memoir class includes the functionality of the framed package.

The boites package provides a `breakbox` environment; examples of its use may be found in the distribution, and the package’s README file contains terse documentation. The environments may be nested, and may appear inside `multicols` environments; however, floats, footnotes and marginpars will be lost.

For Plain TeX users, the facilities of the backgrnd package may be useful; this package subverts the output routine to provide vertical bars to mark text, and the macros are clearly marked to show where coloured backgrounds may be introduced (this requires shade, which is distributed as tex macros and device-independent Metafont for the shading). The author of backgrnd claims that the package works with LaTeX 2.09, but there are reasons to suspect that it may be unstable working with current LaTeX.

`backgrnd.tex`
  macros/generic/misc/backgrnd.tex
`boites.sty`
  macros/latex/contrib/boites (gzipped tar, browse)
`framed.sty`
  macros/latex/contrib/misc/framed.sty
`memoir.cls`
  macros/latex/contrib/memoir (gzipped tar, browse)
`shade.tex`
  macros/generic/shade (gzipped tar, browse)

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=breakbox