# How to customize shadow box?

I have the following text box:

\documentclass{article}
\usepackage{xcolor}
\usepackage{fancybox}

\makeatletter
\setbox\@fancybox\hbox{\fbox{#1}}%
\leavevmode\vbox{%
\offinterlineskip
\vskip\dimexpr-\dimen@+0.5\fboxrule\relax
\makeatother

\begin{document}

\end{document}


How should I do to customize it equal to the following figure:

• Will all the boxes contain code listings? – Gonzalo Medina Oct 10 '15 at 16:09
• Hello Gonzalo Medina, in fact must enter a String with the text very large identical to the figure with the Boolean operators in bold. Can you help me? – ricardoramos Oct 10 '15 at 18:40

No shadowbox solution (admitted) but I suggest the tcolorbox package and its extreme bunch of options

\documentclass{article}
\usepackage{xcolor}
\usepackage{fancybox}

\usepackage[most]{tcolorbox}

\makeatletter
\setbox\@fancybox\hbox{\fbox{#1}}%
\leavevmode\vbox{%
\offinterlineskip
\vskip\dimexpr-\dimen@+0.5\fboxrule\relax
\makeatother

\begin{document}

String1 = String2
\end{tcolorbox}

And as listing box:


• @ricardoramos: You can use the colback=white option (replace the colorname by your favourite one) in the tcolorbox or tcblisting options. (Sorry for the late answer -- I was at the cinema ;-) – user31729 Oct 10 '15 at 21:02