Is there a way to create a gray box around text that will split upon a page break? For example, using tcolorbox I can get the following:

enter image description here

However, it will shift onto the next page if it does not fit on the current page, and if it does not fit on a single page, it will run past the end of the page. I also do not want to manually do it because changing the content on previous pages would mess up the exact lining.


1 Answer 1


tcolorbox provides library breakable for automatically breaking boxes:







two pages of document with box across two pages

See section 19 of the user manual for more information about breakable.

There are alternatives like mdframed or framed which provide similar feature for boxes with background across pages.

  • When I used breakable, the border where it breaks has very weird behavior, regardless of the tool I am using to view the pdf. At certain zoom levels, I will see a solid border, and at other levels I do not see it. I thought this might just be a result of pixel use, but it doesn't happen for other borders. Upon extreme zoom, I can see the slightest color change at the border. Is there a way to fix this?
    – Mike Smith
    Apr 18 at 11:43
  • @MikeSmith If you have a new question, please ask a new question. Currently I do not understand, whether you are talking about a viewer issue or problems in setting the color and width of a border or shadown.
    – cabohah
    Apr 19 at 5:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .