[Tex/LaTex] How to make a framebox around paragraph title

boxesformattingframedparagraphs

I would like to have a framebox around some paragraph titles. Something like the diagram below. I would like the framebox to have a background color (e.g. cyan), round corners, and shade if possible.

+-----------------------+
|   Paragraph one       | Paragraph text starts here. 
+-----------------------+

I have been searching over the internet but only found solutions to wrap the entire paragraph or the section title which occupies a single line.

Best Answer

Without any fancy colors.

\documentclass{article}
\usepackage{titlesec}
\newcommand{\mypara}[1]{\hspace*{-\fboxsep}\fbox{\theparagraph\hskip1em #1}}
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}{}{0em}{\mypara}

\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{0.5em}
\setcounter{secnumdepth}{5}

\begin{document}
\section{some section}
\subsection{some subsection}
\subsubsection{some subsubsection}
\paragraph{A test paragraph}
Some test text.


\end{document}

enter image description here

With colors and powers of tikz

\documentclass{article}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{tikz}
\newcommand{\mypara}[1]{%
\begin{tikzpicture}[baseline=(a.base)]
 \node[draw=red,line width=0.5pt,rounded corners=1ex,inner sep=2pt,fill=cyan] (a) {#1};
\end{tikzpicture}
}

\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{0.5em}

\newcommand\bparagraph[1]{%
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}{}{0em}{\mypara}
\paragraph{#1}
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
}

\begin{document}
\section{some section}
\subsection{some subsection}
\subsubsection{some subsubsection}
\bparagraph{A test paragraph}
\lipsum[1]
\paragraph{A test paragraph}
\lipsum[1]


\end{document}

enter image description here