[Tex/LaTex] Customize the size of the shaded box

framedmarginsshading

I am using \begin{shaded} from \usepackage{framed}.

The problem is I am using it for examples which come inside \begin{itemize}, the shaded box's margin does not begin with the \item margin instead the shaded color begins from far left.

The screenshot from my document

I would like to have it like the below image –

enter image description here

Best Answer

The package framed uses the command \centerline which always starts at the outer left margin. I recommend to switch to the new package tcolorbox.

Related Question