答案1
像这样?我改编了amsmth
的默认plain
定理样式来添加悬挂缩进,并定义了一个thmbox
环境来tcolorbox
绘制蓝色框。
\documentclass{article}
\usepackage{amsmath, amsthm}
\usepackage{tcolorbox}
\newlength{\thmindent}
\newtheoremstyle{plain}
{\topsep} % ABOVESPACE
{\topsep} % BELOWSPACE
{\itshape%
\settowidth{\thmindent}{\textbf{Theorem~\thetheorem~}}
\setlength{\hangindent}{\thmindent}
\setlength{\parindent}{\thmindent}} % BODYFONT
{0pt} % INDENT (empty value is the same as 0pt)
{\bfseries} % HEADFONT
{.} % HEADPUNCT
{5pt plus 1pt minus 1pt} % HEADSPACE
{} % CUSTOM-HEAD-SPEC
\newtheorem{theorem}{Theorem}
\newtcolorbox{thmbox}{%
colback=blue!25,
colframe=blue!25,
fontupper=\normalfont,
left=2mm, right=2mm, top=2mm, bottom=2mm,
boxsep=0mm,
before skip balanced=.25\baselineskip plus 2pt,
left skip=\thmindent,
}
\begin{document}
\begin{theorem}[Sine law]
Given \(a, b, c\) sides of a triangle and \(\alpha, \beta, \gamma\) the opposite angles respectively, we have \(\frac{a}{\sin\alpha} = \frac{b}{\sin\beta} = \frac{c}{\sin\gamma}\).
\end{theorem}
\begin{theorem}[Cosine law]
Given \(a, b, c\) sides of a triangle and \(\gamma\) the opposite angle to the side \(c\), we have \(c^2 = a^2 + b^2 - 2ab\cos\gamma\).
\begin{thmbox}
In fact:
\end{thmbox}
\end{theorem}
\end{document}