定理具有单独的 tikz 环境用于标头和主体

定理具有单独的 tikz 环境用于标头和主体

我最初的问题是:

我用 LaTeX 写讲义,到目前为止使用了一些带有 amsthm 的自定义定理环境。现在我想借助 tikzpicture 重新设计这些定理。

这就是我想要做的:

  • 我希望定理标题(定理名称、编号、标题)位于 tikzpicture 节点内。具体来说,我想使用 tikzpicture 的倒角矩形选项。
  • 我希望定理内容/主体也位于 tikzpicture 节点内。目前应该只有灰色背景颜色。但有些定理我也想自定义此区域(例如另一个倒角矩形选项)。
  • 标题和正文之间不应有白色间距(目前它们之间存在一些不必要的间距),但我希望获得一个可定义(可定制)的线选项,以将标题与内容分开。

这是一个描述我的问题的有效代码示例。你有什么想法吗?

% DOCUMENT
\documentclass[twoside]{scrbook}
\parindent0pt
\parskip6pt
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{scrhack}
\renewcommand*\familydefault{\sfdefault}

% GRAPHICS
\usepackage{xcolor, tikz}
\usetikzlibrary{shapes}
\definecolor{lightgray}{RGB}{215,215,215}
\definecolor{blue}{RGB}{17,94,140}

% MATH
\usepackage{amsmath, amsfonts, amssymb, amsthm}

% THEOREMS
\usepackage{environ}
\newtheoremstyle{defstyle}   
    {2em}
    {1em}
    {}
    {}
    {\sffamily\bfseries\large\color{white}}
    {\newline}{2ex}      
    {\tikz\node[fill=blue, inner sep=0, chamfered rectangle, chamfered rectangle corners=north east, text width=\textwidth] {
        \thmname{#1}\thmnumber{ #2}\thmnote{\quad(#3)}
    };}

\NewEnviron{definition}[1][]{
    \begin{deftmp}[#1]
    \tikz\node[fill=lightgray, rectangle, text width=\textwidth] {
        \BODY
    };
    \end{deftmp}
}

\NewEnviron{lemma}[1][]{
    \begin{lemmatmp}[#1]
    \tikz\node[fill=lightgray, inner sep=0, chamfered rectangle, chamfered rectangle corners=south east, text width=\textwidth] {
        \BODY
    };
    \end{lemmatmp}
}

\theoremstyle{defstyle}
\newtheorem{deftmp}{Definition}[chapter]
\newtheorem{lemmatmp}[deftmp]{Lemma}

% BEGIN
\begin{document}

Here's a working definition, but with some unwanted spacing between header and body:

\begin{definition}[One definition]
Text without enumerations and with simple things like formulas:
\begin{align*}
S_n = \frac{1}{n} \sum_{i=1}^n X_i
\end{align*}
\end{definition}

Here's the problem I have with enumerate within the body:

\begin{definition}[Problem definition]
Text with a enumeration:
\begin{enumerate}
\item One
\item Two
\item $\ldots$
\end{enumerate}
\end{definition}

There could also be a theorem like:

\begin{lemma}[Another theorem]
With some text.
\end{lemma}

Additionally there is a small offset on the right margin of both tikzpictures: The upper header tikzpicture is longer than the body tikzpicture though both are set to textwidth.

\end{document}

在此处输入图片描述

更新 1:对 Gonzalo Medina 法典的修改:

感谢 Gonzalo Medina,我能够按照自己想要的方式重新修改我的定理。但以下 MWE 显示了分页定理的问题。有没有办法避免这些显示错误?我希望我的定理保持可分解性,但它们应该被正确地分解。

\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{chngcntr}
\usepackage{amssymb}
\usepackage{aliascnt}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{shapes.misc,calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins,theorems,breakable}
\renewcommand*\familydefault{\sfdefault}

\definecolor{hellgrau}{RGB}{215,215,215}
\definecolor{blau}{RGB}{17,94,140}
\definecolor{orange}{RGB}{229,94,30}

\makeatletter
\tcbset{
  mytheorem/.code args={#1#2#3#4}{
    \refstepcounter{#2}\label{#4}
    \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname\ }(#3)}}},
}

\newcommand{\mtcbmaketheorem}[5]{
  \newtcolorbox{#1}[3][]{#3,mytheorem={#2}{#4}{##2}{#5:##3},##1}
}
\makeatother

\newcounter{defi}
\newaliascnt{lemm}{defi}
\counterwithin{defi}{chapter}
\counterwithin{lemm}{chapter}

\tcbset{
defstyle/.style={
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=blau]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily
},
satzstyle/.style={
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=orange]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily
}
}

\mtcbmaketheorem{defi}{Definition}{defstyle}{defi}{df}
\mtcbmaketheorem{lemm}{Lemma}{satzstyle}{lemm}{lm}

\begin{document}

\chapter{A test chapter}

\begin{defi}{Partially ordered set}{poset}
A partial order is a binary relation $\preccurlyeq$ over a set $P$ which is antisymmetric, transitive, and reflexive. A set with a partial order is called a partially ordered set (also called a poset). 
\end{defi}

\begin{lemm}{Zorn's Lemma}{zorn}
Suppose a non-empty partially ordered set $P$ has the property that every non-empty chain has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{lemm}

\lipsum[1-2]

\begin{lemm}{Poissonpunktprozess}{PoissPunktProzess}
Wir nehmen an, unser System zuf"alliger Punkte erf"ullt folgende Bedingungen:
\begin{enumerate}
\item $N_{a,b}$ und $N_{c,d}$ sind stochastisch unabh"angig und $[a,b] \cap [c,d] = \emptyset$. \label{item1:satz:PoissPunktProzess}
\item $N_{a+s,b+s}$ und $N_{a,b}$ haben f"ur alle $s \in [0,\infty)$ die gleiche Verteilung. \label{item2:satz:PoissPunktProzess}
\item Es existiert ein $\lambda > 0$, so dass $\lim_{\Delta t \downarrow 0} \frac{P_1(\Delta t)}{\Delta t} = \lambda$. \label{item3:satz:PoissPunktProzess}
\item Es ist $\lim_{\Delta t \downarrow 0} \frac{P(N_{\Delta t} \geq 2)}{\Delta t} = 0$. \label{item4:satz:PoissPunktProzess}
\end{enumerate}
Dann gilt f"ur $t \geq 0$ bzw. $a,b \in [0,\infty)$, $b > a \geq 0$:
\begin{itemize}
\item $N_t$ ist Poissonverteilt zum Parameter $\lambda t$,
\item $N_{a,b}$ ist Poissonverteilt zum Parameter $\lambda(b-a)$.
\end{itemize}
\end{lemm}

\end{document}

在此处输入图片描述

答案1

我建议你采用稍微不同的方法,使用tcolorbox包及其\tcbmaketheorem来自库的命令theorems;自由皮肤让您可以完全自由地使用 TikZ 的功能来设计标题和正文的形状。

这种方法满足了您的三个要求并为您提供了许多定制可能性。

下面是一个我轻松制作倒角矩形的示例;定义了两种可用于各种结构的样式:

\documentclass{scrbook}
\usepackage[svgnames]{xcolor}
\usepackage{chngcntr}
\usepackage{amssymb}
\usepackage{aliascnt}
\usepackage{tikz}
\usetikzlibrary{shapes.misc,calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins,theorems,breakable}

\definecolor{mygray}{RGB}{215,215,215}
\definecolor{myblue}{RGB}{17,94,140}

\makeatletter
\tcbset{
  mytheorem/.code args={#1#2#3#4}{%
    \refstepcounter{#2}\label{#4}%
    \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname\ }(#3)}}},%
}

\newcommand{\mtcbmaketheorem}[5]{%
  \newtcolorbox{#1}[3][]{#3,mytheorem={#2}{#4}{##2}{#5:##3},##1}%
}
\makeatother

\newcounter{defi}
\newaliascnt{lemm}{defi}
\counterwithin{defi}{chapter}
\counterwithin{lemm}{chapter}

\tcbset{
thmstyle/.style={
  breakable,
  freelance,
  boxrule=2pt,
  width=\linewidth,
  frame code={%
  \path[fill=myblue,draw=myblue!75!black]
    (frame.north west) -- ([xshift=-8pt]frame.north east) --
    ([yshift=-8pt]frame.north east) -- (frame.north east|-interior.north east) --
   (frame.north west|-interior.north west) -- cycle;
  },
  interior titled code={
  \path[fill=mygray!80,draw=mygray]
    (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
    ([yshift=8pt]frame.east|-interior.south east) -- 
    ([xshift=-8pt]frame.east|-interior.south east) --
    (frame.west|-interior.south west) -- cycle;
  },
  fonttitle=\bfseries\sffamily
},
defstyle/.style={
  breakable,
  freelance,
  boxrule=2pt,
  width=\linewidth,
  frame code={%
  \path[top color=myblue!50,bottom color=myblue!50,
    middle color=myblue!50]
    ([xshift=8pt]frame.north west) -- ([xshift=-8pt]frame.north east) --
    ([yshift=-8pt]frame.north east) -- 
    (frame.north east|-interior.north east) --
    (frame.north west|-interior.north west) -- 
    ([yshift=-8pt]frame.north west) -- cycle;
  },
  interior titled code={
  \path[fill=mygray!80]
    (frame.west|-interior.north west) -| 
    ([yshift=8pt]frame.east|-interior.south east) -- 
    ([xshift=-8pt]frame.east|-interior.south east) -- 
    ([xshift=8pt]frame.west|-interior.south west) -- 
    ([yshift=8pt]frame.west|-interior.south west) -- cycle;
  \path[fill=myblue] 
    ([xshift=0.5\pgflinewidth,yshift=1.5pt]frame.west|-interior.north west) 
    rectangle 
    ([xshift=-0.5\pgflinewidth,yshift=-1.5pt]frame.east|-interior.north east);
  },
  fonttitle=\bfseries\sffamily\normalcolor
}
}

\mtcbmaketheorem{defi}{Definition}{defstyle}{defi}{df}
\mtcbmaketheorem{lemm}{Lemma}{thmstyle}{lemm}{lm}

\begin{document}

\chapter{A test chapter}

\begin{defi}{Partially ordered set}{poset}
A partial order is a binary relation $\preccurlyeq$ over a set $P$ which is antisymmetric, transitive, and reflexive. A set with a partial order is called a partially ordered set (also called a poset). 
\end{defi}

\begin{lemm}{Zorn's Lemma}{zorn}
Suppose a non-empty partially ordered set $P$ has the property that every non-empty chain has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{lemm}

\begin{lemm}{A list test}{lsit}
\begin{itemize}
\item First.
\item Second.
\item Third.
\end{itemize}
\end{lemm}

\end{document}

为了获得定理头部所需的格式,我使用了一点变化\tcbmaketheorem

定义所用的样式清楚地表明您可以独立定制三个元素(标题、正文、分隔符)。

在此处输入图片描述

对问题进行编辑后,需要进行以下修改:

\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{chngcntr}
\usepackage{amssymb}
\usepackage{aliascnt}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{shapes.misc,calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins,theorems,breakable}
\renewcommand*\familydefault{\sfdefault}

\definecolor{hellgrau}{RGB}{215,215,215}
\definecolor{blau}{RGB}{17,94,140}
\definecolor{orange}{RGB}{229,94,30}

\makeatletter
\tcbset{
  mytheorem/.code args={#1#2#3#4}{
    \refstepcounter{#2}\label{#4}
    \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname\ }(#3)}}},
}

\newcommand{\mtcbmaketheorem}[5]{
  \newtcolorbox{#1}[3][]{#3,mytheorem={#2}{#4}{##2}{#5:##3},##1}
}
\makeatother

\newcounter{defi}
\newaliascnt{lemm}{defi}
\counterwithin{defi}{chapter}
\counterwithin{lemm}{chapter}

\tcbset{
defstyle/.style={
    enhanced,
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=blau]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    interior code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily,
    toprule at break=0pt,
},
satzstyle/.style={
    enhanced,
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=orange]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    interior code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily,
    toprule at break=0pt,
}
}

\mtcbmaketheorem{defi}{Definition}{defstyle}{defi}{df}
\mtcbmaketheorem{lemm}{Lemma}{satzstyle}{lemm}{lm}

\begin{document}

\chapter{A test chapter}

\begin{defi}{Partially ordered set}{poset}
A partial order is a binary relation $\preccurlyeq$ over a set $P$ which is antisymmetric, transitive, and reflexive. A set with a partial order is called a partially ordered set (also called a poset). 
\end{defi}

\begin{lemm}{Zorn's Lemma}{zorn}
Suppose a non-empty partially ordered set $P$ has the property that every non-empty chain has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{lemm}

\lipsum[1-2]

\begin{lemm}{Poissonpunktprozess}{PoissPunktProzess}
Wir nehmen an, unser System zuf"alliger Punkte erf"ullt folgende Bedingungen:
\begin{enumerate}
\item $N_{a,b}$ und $N_{c,d}$ sind stochastisch unabh"angig und $[a,b] \cap [c,d] = \emptyset$. \label{item1:satz:PoissPunktProzess}
\item $N_{a+s,b+s}$ und $N_{a,b}$ haben f"ur alle $s \in [0,\infty)$ die gleiche Verteilung. \label{item2:satz:PoissPunktProzess}
\item Es existiert ein $\lambda > 0$, so dass $\lim_{\Delta t \downarrow 0} \frac{P_1(\Delta t)}{\Delta t} = \lambda$. \label{item3:satz:PoissPunktProzess}
\item Es ist $\lim_{\Delta t \downarrow 0} \frac{P(N_{\Delta t} \geq 2)}{\Delta t} = 0$. \label{item4:satz:PoissPunktProzess}
\end{enumerate}
Dann gilt f"ur $t \geq 0$ bzw. $a,b \in [0,\infty)$, $b > a \geq 0$:
\begin{itemize}
\item $N_t$ ist Poissonverteilt zum Parameter $\lambda t$,
\item $N_{a,b}$ ist Poissonverteilt zum Parameter $\lambda(b-a)$.
\end{itemize}
\end{lemm}

\end{document}

在此处输入图片描述

要定义“普通”框架,请使用相同的想法:定义适当的样式(我将其称为plainstyle),然后使用\newtcolorbox定义具有所需样式的新环境,并为标题添加一个强制参数。要自动添加标题的引号,您可以使用标题前、标题后键(由于我不熟悉德语引号样式,因此我使用了标准引号):

\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[svgnames]{xcolor}
\usepackage{chngcntr}
\usepackage{amssymb}
\usepackage{aliascnt}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{shapes.misc,calc}
\usepackage{tcolorbox}
\tcbuselibrary{skins,theorems,breakable}
\renewcommand*\familydefault{\sfdefault}

\definecolor{hellgrau}{RGB}{215,215,215}
\definecolor{blau}{RGB}{17,94,140}
\definecolor{orange}{RGB}{229,94,30}

\makeatletter
\tcbset{
  mytheorem/.code args={#1#2#3#4}{
    \refstepcounter{#2}\label{#4}
    \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname\ }(#3)}}},
}

\newcommand{\mtcbmaketheorem}[5]{
  \newtcolorbox{#1}[3][]{#3,mytheorem={#2}{#4}{##2}{#5:##3},##1}
}
\makeatother

\newcounter{defi}
\newaliascnt{lemm}{defi}
\counterwithin{defi}{chapter}
\counterwithin{lemm}{chapter}

\tcbset{
defstyle/.style={
    enhanced,
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=blau]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    interior code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily,
    toprule at break=0pt,
},
satzstyle/.style={
    enhanced,
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=orange]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    interior code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily,
    toprule at break=0pt,
},
plainstyle/.style={
    enhanced,
    breakable,
    freelance,
    boxrule=1pt,
    width=\linewidth,
    frame code={%
    \path[fill=orange]
        ([yshift=-7.5pt]frame.north west) -- ([xshift=7.5pt]frame.north west) --
        (frame.north east) -- (frame.north east|-interior.north east) --
        (frame.north west|-interior.north west) -- cycle;
    },
    interior titled code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    interior code={
    \path[fill=hellgrau]
        (frame.west|-interior.north west) -- (frame.east|-interior.north east) --   
        (frame.east|-interior.south east) -- (frame.west|-interior.south west) -- cycle;
    \path[draw=white, line width=1pt] ([xshift=-1pt]frame.west|-interior.north west) -- ([xshift=1pt]frame.east|-interior.north east);
    },
    fonttitle=\bfseries\sffamily,
    before title=``,
    after title='',
    toprule at break=0pt,
}
}

\mtcbmaketheorem{defi}{Definition}{defstyle}{defi}{df}
\mtcbmaketheorem{lemm}{Lemma}{satzstyle}{lemm}{lm}
\newtcolorbox{MyBox}[1]{plainstyle,title=#1}

\begin{document}

\chapter{A test chapter}

\begin{defi}{Partially ordered set}{poset}
A partial order is a binary relation $\preccurlyeq$ over a set $P$ which is antisymmetric, transitive, and reflexive. A set with a partial order is called a partially ordered set (also called a poset). 
\end{defi}

\begin{lemm}{Zorn's Lemma}{zorn}
Suppose a non-empty partially ordered set $P$ has the property that every non-empty chain has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{lemm}

\begin{MyBox}{A plain frame}
Suppose a non-empty partially ordered set $P$ has the property that every non-empty chain has an upper bound in $P$. Then the set $P$ contains at least one maximal element.
\end{MyBox}

\end{document}

在此处输入图片描述

相关内容