# How to draw a text box with shadow borders in LaTex

How do I draw a text box with shadow borders in LaTex? I have tried the following but it has errors:

\fbox{
\begin{minipage}[c]{5in}
\end{minipage}
}

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
– user31729
Jan 18 '15 at 10:29
• Which error does TeX spill out? Did you use \usepackage{fancybox} ? And do you really nead a frame around \shadowbox?
– user31729
Jan 18 '15 at 10:30
• i m not using \usepackage{fancybox}, i m new to latex and i want to draw a simple text-box having a shadow border at its left side. i m not understanding how to code this in latex. Jan 18 '15 at 10:39
• Try to use my provided answer as a starting point. And change \bf to \textbf{...} since \bf is deprecated syntax
– user31729
Jan 18 '15 at 10:43
• Other packages: mdframed or tcolorbox
– user31729
Jan 18 '15 at 10:48

The main question is: How should the box look like? The box can be drawn with unlimited variations using tikz, mdframed, tcolorbox, etc.

Here are some suggestions with tcolorbox:

\documentclass{article}
\usepackage[skins]{tcolorbox}
\begin{document}

sharp corners]{(A) text write here}

\begin{tcolorbox}[enhanced,width=5in,center upper,size=fbox,
(B) text write here
\end{tcolorbox}

sharp corners]{(C) text write here}

\begin{tcolorbox}[enhanced,width=5in,center upper,
(D) text write here
\end{tcolorbox}

colframe=red!50!black,colback=yellow!10]{(E) text write here}

\begin{tcolorbox}[enhanced,width=5in,center upper,
colframe=red!50!black,colback=yellow!10]
(F) text write here
\end{tcolorbox}

boxrule=0.4pt,sharp corners,colframe=yellow!80!black,
colback=yellow!10]{(G) text write here}

\begin{tcolorbox}[enhanced,width=5in,center upper,
boxrule=0.4pt,sharp corners,colframe=yellow!80!black,colback=yellow!10]
(H) text write here
\end{tcolorbox}

\end{document}

• Is there an easy way to use these boxes with a paragraph? Jun 24 '16 at 6:19
• @GlenWheeler Inside the tcolorbox examples, you could use paragraphs, but not inside the tcbox examples. Jun 24 '16 at 7:38

With tikz

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
fill=blue!20,draw=blue,thick,font=\bfseries] {text write here};
\end{tikzpicture}

\end{document}


This is highly customizable as can be seen below:

\documentclass{article}
\usepackage{tikz}