# Change numbering in MD Framed

I want to change the numbering using mdframed.

The code is:

\mdfdefinestyle{theoremstyle}{%
linecolor=black,
linewidth=1pt,
frametitlerule=true,
frametitlefont=\sffamily\bfseries,
frametitlebackgroundcolor=gray!20,
innertopmargin=\topskip,
}


If I now use

 \mdtheorem[style=theoremstyle]{definition}{Definition}
\begin{definition}[Defbla]

blubb

\end{definition}


It is numbered as Definition 1. But I want to have it as Definition 1.1 and then 1.2 etc. ...

How can I achieve that?

Thanks :)

• Does \mdtheorem[style=theoremstyle]{definition}{Definition}[section] work? May 31 '19 at 11:07
• Yeah, thank you :) May 31 '19 at 11:09

Since you did not provide much information, I am guessing:

1. Load the amsmath package.
2. Put \numberwithin{section}{theorem} (or chapter instead of section or ...) in your preamble.
• Thanks that also works :) May 31 '19 at 11:09
• @Armani42 If the answer is useful, then consider accepting it (check mark on the left hand side). Jun 10 '19 at 12:36

The \mdtheorem command is very similar to \newtheorem, except that it has a further optional argument:

\mdtheorem[style=theoremstyle]{definition}{Definition}[section]
\mdtheorem[style=theoremstyle]{theorem}[definition]{Theorem}


would define the definition environment with numbering subordinate to section. Moreover the theorem environment is defined, sharing the numbering with definition.