将定义放入颜色框中

将定义放入颜色框中

我发现了一份很棒的文档(在模型理论方面做了一些研究)。

在此处输入图片描述

我想知道如何制作用于定义、定理和其他内容的彩色框。非常感谢!

答案1

你可以这样做

\documentclass[border=5mm]{standalone}
\usepackage[most]{tcolorbox}

\newtcolorbox{myBox}[3][]{
arc=5mm,
lower separated=false,
fonttitle=\bfseries,
colbacktitle=green!10,
coltitle=green!50!black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
        yshift=-2mm},
colframe=green!50!black,
colback=green!10,
overlay={
\node[draw=green!50!black,thick,
%inner sep=2mm,
fill= green!10,rounded corners=1mm, 
yshift=0pt, 
xshift=-0.5cm, 
left, 
text=green!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
title=#2,#1}

\begin{document}


\begin{myBox}[]{content}{Some}
content text content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text 
\end{myBox}

\end{document}

在此处输入图片描述

更新:序列号定义

\documentclass{article}
\usepackage[most]{tcolorbox}

\newtcolorbox[auto counter,number within=subsection]{myBox}[3][]{
arc=5mm,
lower separated=false,
fonttitle=\bfseries,
colbacktitle=green!10,
coltitle=green!50!black,
enhanced,
attach boxed title to top left={xshift=0.5cm,
        yshift=-2mm},
colframe=green!50!black,
colback=green!10,
overlay={
\node[draw=green!50!black,thick,
%inner sep=2mm,
fill= green!10,rounded corners=1mm, 
yshift=0pt, 
xshift=-0.5cm, 
left, 
text=green!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
overlay={
\node[draw=green!50!black,thick,
%inner sep=2mm,
fill= green!10,rounded corners=1mm, 
yshift=0pt, 
xshift=-0.5cm, 
left, 
text=green!50!black,
anchor=east,
font=\bfseries] 
at (frame.north east) {#3};},
title=#2 \thetcbcounter,#1}



\begin{document}

\section{section title}
\subsection{subsection title}
\begin{myBox}[]{Content}{Some}
Content text content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text  content text 
\end{myBox}

\end{document}

在此处输入图片描述

相关内容