Micha Feigin wrote:
I'm trying to set a colored background for some definitions in my document (course notes and I want to get the effect of using a marker to highlight some things).using the package xcolor and the \colorbox{gray!30}{text} inside the definition mostly achieves the desired effect, although it fails if I have nested environments definition: \colorbox{gray}{ blah balh enumerate: 1. text 2. text \end enumerate } \end definition throws errors (this is not the actual latex ...) it says, something wrong, perhaps missing \item
I think the problem is that a colorbox is the wrong kind of box (does not allow enumerations inside) (maybe).
Is there a good way to achieve this?
You can nest a minipage or parbox inside the colorbox, but unless you want the color to extend to the margin, you'll need to fiddle with the width of the minipage manually. I've attached a small example.
There may be better ways to do this. (I'm no TeXpert.) /Paul
newfile1.lyx
Description: application/lyx