Here is the specs of the box.
Color of the bar rule should be:
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}Radius of the 4 corners of the box:
4pt- Thick line =
0.5pt - Text should be
6ptindention on all sides
Here is the specs of the box.
Color of the bar rule should be:
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}
Radius of the 4 corners of the box: 4pt
0.5pt6pt indention on all sidesI come here looking for the answer to the same question. I wanted it to look nice as well, have colour on the inside too, but unfortunately when trying to implement the suggestions above it didn't seem to work for multiple lines.
What I did was go to the tcolorbox manual http://get-software.net/macros/latex/contrib/tcolorbox/tcolorbox.pdf and had a quick read through the beginning. It tells you how to make very nice looking textboxes very quickly (all of which with rounded corners).
The simplest thing to do is just to include the \usepackage{tcolorbox} and then where you want the coloured textbox you just type
\begin{tcolorbox}
A physical explanation the \emph{dynamic matrix}\\
lots of text\\
a new line\\
equation
\begin{equation}
%\label{eq:dynamic_diag}
\nonumber
\bm C \bm D \bm C^{\dagger}=\bm \Omega = \left(\begin{array}{cccc}
\omega^2_1 & 0 & ... & 0\\
0 & \omega^2_2 & ... & 0\\
\vdots & & \ddots & \vdots \\
0 & 0 & ... & \omega^2_{Nd}
\end{array}\right),
\end{equation}
where $\bm C$ is a unitary matrix (each column is one of the eigenvectors of the dynamic matrix $\bm D$), $Nd$ is the product of the number of particlces, $N$, and the number of dimensions, $d$.
\end{tcolorbox}
Which gives you something like

One can also customise it, either with "[options]" after the the "\begin{tcolorbox}" or one can create a "mybox" environment. So, if I want it to be a clear red background with a darker red frame then I type
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=red!5!white,colframe=red!75!black}
where the "newtcolorbox" creates a new environment, "mybox" is the name, "colback" is the background colour of the box, "colframe" is the colour of the frame. See the manual for a huge number of further customisations. Then include the "mybox" environment somewhere in the tex document
\begin{mybox}
A physical explanation the \emph{dynamic matrix}\\
lots of text\\
a new line\\
equation
\begin{equation}
%\label{eq:dynamic_diag}
\nonumber
\bm C \bm D \bm C^{\dagger}=\bm \Omega = \left(\begin{array}{cccc}
\omega^2_1 & 0 & ... & 0\\
0 & \omega^2_2 & ... & 0\\
\vdots & & \ddots & \vdots \\
0 & 0 & ... & \omega^2_{Nd}
\end{array}\right),
\end{equation}
where $\bm C$ is a unitary matrix (each column is one of the eigenvectors of the dynamic matrix $\bm D$), $Nd$ is the product of the number of particlces, $N$, and the number of dimensions, $d$.
\end{mybox}
Which gives you something like:

It looks really cool! Adding titles to the boxes is straightforward too.
This time use \newtcolorbox{mybox}[1]{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,title=#1},
where the "1" means one argument is to be expected after "\begin{mybox}", "fonttitle" is the font type and "title=#1" tell it that the first argument after "\begin{mybox}" is the title, i.e.
\begin{mybox}{A physical explanation of the \emph{dynamic matrix}}
This looks like

The tcolorbox package does a beautiful job of setting coloured boxes:

\documentclass{article}
\usepackage{tcolorbox}% http://ctan.org/pkg/tcolorbox
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}% Rule colour
\makeatletter
\newcommand{\mybox}[1]{%
\setbox0=\hbox{#1}%
\setlength{\@tempdima}{\dimexpr\wd0+13pt}%
\begin{tcolorbox}[colframe=mycolor,boxrule=0.5pt,arc=4pt,
left=6pt,right=6pt,top=6pt,bottom=6pt,boxsep=0pt,width=\@tempdima]
#1
\end{tcolorbox}
}
\makeatother
\begin{document}
\mybox{Here is some fancy box text.}
\end{document}
The tcolorbox options are:
color=mycolorarc=4ptboxrule=0.5ptleft=6pt, right=6pt, top=6pt, bottom=6ptThe macro \mybox will always set the box on a single line. If you want more than one line, some changes are required. To remove the background colour, add the option colback=white.
\mybox command with \makeatletter ... \makeatother.
– Werner
Aug 08 '12 at 04:22
Have a look at the mdframed package:
\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}
\newmdenv[innerlinewidth=0.5pt, roundcorner=4pt,linecolor=mycolor,innerleftmargin=6pt,
innerrightmargin=6pt,innertopmargin=6pt,innerbottommargin=6pt]{mybox}
\begin{document}
\lipsum[2]
\begin{mybox}
\lipsum[4]
\end{mybox}
\lipsum[2]
\end{document}

Update:
tcbox raise base,nobeforeafterreplaced byon line.
Since version 2.02 (2013/03/13), the package tcolorbox contains the \tcbox and \newtcbox (version 2.22) macros which allow to give an alternative answer. I also added some text around the box example to demonstrate the usage of the option on line.
\documentclass{article}
\usepackage{tcolorbox}
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}
\newtcbox{\mybox}{on line,
colframe=mycolor,colback=mycolor!10!white,
boxrule=0.5pt,arc=4pt,boxsep=0pt,left=6pt,right=6pt,top=6pt,bottom=6pt}
\begin{document}
Some text. \mybox{Here is some fancy box text.} More text.
\end{document}

nobeforeafter to get the box inline like your picture.
– Nate Glenn
Jul 08 '13 at 05:41
nobeforeafter has to be set. I corrected the the example. Thanks again! :-)
– Thomas F. Sturm
Jul 08 '13 at 06:35
on line should be put instead of nobeforeafter to get the box inline
– sound wave
Aug 03 '19 at 09:07
What does e.g. red!5!white mean?
– lpnorm Oct 13 '21 at 08:54