1

I use the following to have shaded definitions:

\colorlet{shadecolor}{orange!15}

\declaretheoremstyle[
headfont=\normalfont\bfseries,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=0.5em,
spaceabove=4pt,
mdframed={
  skipabove=8pt,
  skipbelow=6pt,
  hidealllines=true,
  backgroundcolor={shadecolor},
  innerleftmargin=2pt,
  innerrightmargin=2pt}
]{shaded}

\declaretheorem[style=shaded,numberlike=theorem]{definition}

What do I have to change in order to start every definition with a line break, i.e. so it looks something like this:

Defintion 2.15.
Some definition...

I know that you can do this with

\theoremstyle{break}

for usual theorems. But I haven't figured out how to do it in this case.

1

1 Answer 1

1

In the theorem style, you can add a \newline after the title using the postheadhook key.

\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{amsthm}
\usepackage{thmtools}
\colorlet{shadecolor}{orange!15}

\declaretheoremstyle[
headfont=\normalfont\bfseries,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadhook=\leavevmode\newline,
spaceabove=4pt,
mdframed={
  skipabove=8pt,
  skipbelow=6pt,
  hidealllines=true,
  backgroundcolor={shadecolor},
  innerleftmargin=2pt,
  innerrightmargin=2pt}
]{shaded}

\declaretheorem[style=shaded]{definition}
\begin{document}
\begin{definition}
Some definition...
\end{definition}
\end{document}
1
  • Thanks alot! Didn't know this and was looking for exactly something like this.
    – mc.math
    Dec 23, 2022 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .