I need to show the numbering of Theorems, Lemmas,... as follows:
Theorem 3.5.2 (Theorem 2 in section 5 in chapter 3).
Fore more information, you can visit Fancy boxes for theorem, lemma, and proof with mdframed
How can I do that?
MWE
\newcounter{thm}[chapter]\setcounter{thm}{0}
\renewcommand{\thethm}{\arabic{chapter}.\arabic{thm}}
\newenvironment{thm}[2][]{%
\refstepcounter{thm}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Theorem~\thethm};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=green!20]
{\strut Theorem~\thethm:~#1};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=green!20,%
linewidth=3pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}