In LaTeX, how can I set a background color of the paper such that it has left margin as gray and the center and right part of the paper has background white?


1 Answer 1


Very simple with eso-picif you use the relevant parameters:

\AddToShipoutPictureBG{\color{Gainsboro!40!Lavender}\AtPageLowerLeft{\rule{\dimexpr 1in + \oddsidemargin-\marginparsep\relax}{\paperheight}}}

 \title{Colouring Left Margin}
 \author{Wassily Kandinsky}


\marginpar{Some text}

\marginpar{Some text}


enter image description here

  • That looks good. I would like to be able to write text also to margins. So my idea is to write a CV using \usepackage[absolute]{textpos} such that I can write my text to the gray background and to the white background.
    – guest
    Commented Jul 12, 2020 at 18:46
  • I've just tested a simple \marginpar and it works fine (the colouring is only a background , and it can ve overwritten)I'm not sure you need textpos: for the right margin, you have the command \reversemarginpar if necessary, and anyway, eso-pic can take care of absolute positions. Take a look at the documentation for details.
    – Bernard
    Commented Jul 12, 2020 at 18:59
  • I've updated my answer with two \marginpars. Please see if the result corresponds to what you want.
    – Bernard
    Commented Jul 12, 2020 at 19:08

You must log in to answer this question.

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