如何获取带有定理标题的颜色框

如何获取带有定理标题的颜色框

我尝试在乳胶中按照以下风格完成我的定理:

在此处输入图片描述

但在我的代码中:

\documentclass[a4paper, 14pt, extrafontsizes, oneside, openany, x11names]{article}

\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{thmtools}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{geometry}
\usepackage{float}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{framed}
\usepackage[dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{tikz,lipsum,lmodern}


\colorlet{LightGray}{White!90!Periwinkle}
\colorlet{LightOrange}{Orange!15}
\colorlet{LightGreen}{Green!15}

\newcommand{\HRule}[1]{\rule{\linewidth}{#1}}


  
\declaretheoremstyle[name=Theorem,]{thmsty}
\declaretheorem[style=thmsty,numberwithin=section]{theorem}
\tcolorboxenvironment{theorem}{fonttitle=\bfseries\upshape, fontupper=\slshape,
     arc=0mm, colback=blue!5!white,colframe=blue!75!black}
\begin{document}

\section{Examples}

\begin{theorem}[Summation of Numbers]
    This is a theorem.
\end{theorem}

\end document


我无法得到那个...

答案1

像这样 -

在此处输入图片描述

平均能量损失

\documentclass[a4paper, 14pt, extrafontsizes, oneside, openany, x11names]{article}

\usepackage{amsmath, relsize}
\usepackage[dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}


\newtcolorbox[%
                        auto counter,
                        number within=section
                        ]
                        {pabox}[2][]{%
                        colback=SkyBlue!25,
                        colframe=Blue,
                        fonttitle=\bfseries, sharp corners,
                        title=Theorem~\thetcbcounter: #2,#1
                        }

\begin{document}
    
    \section{Theorems}
    
    \begin{pabox}{Summation of Numbers}
        This is a theorem.
        \begin{equation}
            \tcbset{fonttitle=\scriptsize}
            \tcboxmath[%
                                colback=Apricot!25,
                                colframe=Red
                                ]
                                { \sum^{n}_{i=1} i= \frac{n(n+1)}{2}}
        \end{equation}
    \end{pabox}
    
\end{document}

相关内容