0

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 :)

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

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.
2
  • Thanks that also works :)
    – Armani42
    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
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.