![定理风格(如图所示)](https://linux22.com/image/464271/%E5%AE%9A%E7%90%86%E9%A3%8E%E6%A0%BC%EF%BC%88%E5%A6%82%E5%9B%BE%E6%89%80%E7%A4%BA%EF%BC%89.png)
答案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}