# Customising theorem style

I wish to customise my theorem style to something like the one shown, but I couldn,t figure a universal definition of parameters. Some suggestions?

The code:

\documentclass{article}
\usepackage{tikz}

\tikzstyle{titregris} =
[draw=gray, thick, fill=white, shading = exersicetitle, %
text=black, rectangle, rounded corners, right,minimum height=.7cm]
{color(0bp)=(white); color(100bp)=(white!5)}
{color(0bp)=(white);color(100bp)=(black!5)}
\newcounter{exercise}
\renewcommand*\theexercise{Example:~\arabic{exercise}}
\makeatletter
\def\mdf@@exercisepoints{}%new mdframed key:
\define@key{mdf}{exercisepoints}{%
\def\mdf@@exercisepoints{#1}
}
\mdfdefinestyle{exercisestyle}{%
outerlinewidth=1em,outerlinecolor=white,%
leftmargin=-1em,rightmargin=-1em,%
middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
apptotikzsetting={\tikzset{mdfbackground/.append style ={%
innertopmargin=1.2\baselineskip,
skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
skipbelow={-1em},
needspace=3\baselineskip,
frametitlefont=\sffamily\bfseries,
settings={\global\stepcounter{exercise}},
singleextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{\theexercise}~};
\ifdefempty{\mdf@@exercisepoints}%
{}%
{\node[titregris,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
},
firstextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{\theexercise}~};
\ifdefempty{\mdf@@exercisepoints}%
{}%
{\node[titregris,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
},
}
\makeatother

\begin{document}

\begin{mdframed}[style=exercisestyle]
Near what I want
\end{mdframed}

\end{document}

-
Hi. See e.g.: mdframed. The package provides a lot of examples. You can also use the search function of tex.sx to find more examples. BTW: Your name irritates me. The typesetting system is written LaTeX. – Marco Daniel Feb 8 at 21:20
Maybe another interesting package would be the thmbox-package. It doesn't exactly the style you showed as an example but something similar. – Stephan Lukasczyk Feb 9 at 9:29
@user21778 A small number of account names are 'not a great plan', and as Marco says 'LaTeX' is one of them. I've reset your account name to the default: feel free to edit it, but do bear in mind that there are a few names that don't really work! – Joseph Wright Feb 12 at 14:17
@MarcoDaniel, I have included my attempt in my question,I cant figure out how to do the line breaking on the sides. – user21778 Feb 12 at 14:18