This question already has an answer here:

How could I create a new environment to automated the following code?

\noindent\fcolorbox{white}{lightgray}{ \begin{minipage}{0.96\textwidth}
 some text in here
\end{minipage} }

marked as duplicate by user36296, Phelype Oleinik, Troy, user31729, Sebastiano Apr 23 '18 at 20:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.Stackexchange! – user36296 Apr 23 '18 at 17:01
  • 1
    Stupid question: if you make the frame white, why using a framed colour box in the first place and not a \colorbox? – user36296 Apr 23 '18 at 17:03

Maybe a simple new command can also do the job:





\foo{some text}


Needless to reinvent the wheel: you already have the shaded(*)} environment from the framed package. . Furthermore, these environments can break across pages. The shaded* environment makes the shaded area fit exactly the margin, whereas shaded makes the text justified between the margins and the shaded area overflows the margin:



\noindent\fcolorbox{white}{lightgray}{ \begin{minipage}{0.96\textwidth}
some text in here


enter image description here

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