#StackBounty: #color #tcolorbox #mdframed #ntheorem How do I create the same type of grey box with 'newtcolorbox' as 'newmd…

Bounty: 50

I wanna convert into using newtcolorbox instead of newmdtheoremv. Here I have a simple, indented, grey box:

enter image description here

  1. How do I achieve the same with newtcolorbox?
  2. How would I be able to adjust between having a custom title and not having a title with the begin{greybox} command? Some times I may want e.g. Example, … as title and sometimes I may not want any title at all.
  3. How would I do if I want the text to appear below the title and not directly after it?

.

documentclass{article}
usepackage{parskip}

usepackage{ntheorem} % greybox COMMAND
usepackage[framemethod=tikz]{mdframed} % greybox COMMAND

theoremstyle{nonumberplain}
newmdtheoremenv[
    backgroundcolor=gray!25,
    hidealllines=true,
    %leftline=false,
    %linewidth=10pt,
    %linecolor=white,
    leftmargin=15pt,
    rightmargin=15pt,
    innertopmargin=3pt,
    innerbottommargin=3pt,
    innerrightmargin=5pt,
    innerleftmargin=5pt,
    skipabove=12pt,
    skipbelow=20pt
]{greybox}{Example}

begin{document}

Here is some text before to show the indentation.

begin{greybox}
    Here is my grey box.
    
    With some text in it.
end{greybox}

Here is some text after to show the indentation.

end{document}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.