Is it possible to redefine certain \section or \subsection to have custom pagecolor?

There are certain solutions like:

How to change the background color only for the current page?,

underline and background color for section or subsection

Change background color for only a section of the page?

and so on.

However, this does not quite solve what I want. Some of these solutions need predefined color boxes at fixed positions etc.

What would be nice to have is, whenever this section (say \newsection) starts, the page color from that point onwards including the section title becomes different until the section ends (which means a new normal \section starts. Basically within the environment of the \newsection ). For that, the whole page does not need to be a different color and the texts in this \newsection might continue over the next page and so does the background color. The complete page in the range of \newsection can have a different background including possibly the page numbers, left-right margins, etc. or, it will also be sufficient to have the text and equations area in \newsection.

The second example link above is much similar but that is only on the name of the section not on the content of the section.

1 Answer 1


You can do this with snugshade of frame package. You need to define the desired color just before the use of snugshade. This way yo can change color for all one section or one fraction of this one. You can apply this method to a chapter. Here is un example of code:

    \chapter{Test chapter}

This is the result: enter image description here

Your Answer

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

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