I'm trying to create a theoremstyle whith a shaded background. As I already have a working preamble I'd like to change as less as possible. Previously I defined an own theoremstyle 'selfdefined' which I used for theorems and such. However as this is not shading my theorems it's not an option anymore.
Now I tried to define a new theoremstyle 'shaded' which is supposed to do this. Unfortunately it's not working the way I want it to work. Instead of using the newly defined theoremstyle it just uses some kind of default theoremstyle. I hope somebody can help me to fix this (with as few changes as possible and detailed explanations, as I'm pretty much a beginner when it comes to latex).
I'm aware that this is not really a 'minimum working' example, I hope it's still alright.
\documentclass[a4paper,12pt]{scrartcl} \usepackage[utf8]{inputenc} % input encoding \usepackage[T1]{fontenc} % use T1 fonts for font encoding \usepackage{amsfonts} % math font \usepackage{color} \usepackage{dsfont} % math font for number spaces etc. \usepackage{helvet} % sans serif font \usepackage{inconsolata} \usepackage{tikz} % for drawings. \usepackage{latexsym} \usepackage{stmaryrd} \usepackage{mathtools} \usepackage{parskip} % vertical space instead of indentation \usepackage[colorlinks=true,linkcolor=blue]{hyperref} \usepackage{thmtools} \usepackage{mdframed} % shaded environments \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsthm} \newtheoremstyle{selfdefined} {12pt}% Space above {12pt}% Space below {}% Body font \itshape =italian style {}% Indent amount {\bfseries}% Theorem head font {}% Punctuation after theorem heading {\newline}% Space after theorem heading, 0.5em => in gleicher zeile weiter {}% Theorem head spec (can be left empty, meaning ‘normal’) \definecolor{shadecolor}{gray}{0.65} \declaretheoremstyle[ headfont=\normalfont\bfseries, notefont=\mdseries, notebraces={(}{)}, bodyfont=\normalfont, postheadspace=0.5em, mdframed={ skipabove=\topsep, skipbelow=\topsep, hidealllines=true, backgroundcolor={shadecolor}, innerleftmargin=0pt, innerrightmargin=0pt} ]{shaded} %\swapnumbers \theoremstyle{shaded} \newtheorem{definition}{Definition}[section] \newtheorem{theorem}[definition]{Theorem} \newtheorem{conjecture}[definition]{Conjecture} \newtheorem{corollary}[definition]{Corollary} \newtheorem{lemma}[definition]{Lemma} \newtheorem{example}[definition]{Example} \newtheorem*{algorithm}{Algorithm} \begin{document} \begin{definition}[\textbf{Definition 1}] This is supposed to be a definition in shaded style. \end{definition} \begin{theorem} This is supposed to be a theorem in shaded style. \end{theorem} \end{document} 