答案1
ntheorem, mdframed
以下是使用和重现第二幅图像的方法xcolor
:
\documentclass[11pt]{book} %
\usepackage[T1]{fontenc}
\usepackage[svgnames]{xcolor}%
\usepackage{amssymb,amsmath}
%\usepackage{framed}
\usepackage[amsmath,framed]{ntheorem}
\usepackage[ntheorem]{mdframed}
\theoremheaderfont{\sffamily\bfseries}
\theorembodyfont{\normalfont\upshape}
\theoremstyle{plain}
\newmdtheoremenv[topline=false, bottomline=false, rightline=false, leftline=true, linewidth=2pt, linecolor=Purple, backgroundcolor=Thistle! 20, innertopmargin=10pt, innerbottommargin=10pt]{example}{Example}
\begin{document}
\begin{example}
The rule $1$ cannot follow. $1$ corresponds to
\[ A = \begin{bmatrix}
1 & 1 \\ 1 & 0
\end{bmatrix} \]%
\end{example}
\end{document}