![谁能告诉我如何创建这样的盒子?](https://linux22.com/image/466842/%E8%B0%81%E8%83%BD%E5%91%8A%E8%AF%89%E6%88%91%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%E8%BF%99%E6%A0%B7%E7%9A%84%E7%9B%92%E5%AD%90%EF%BC%9F.png)
我是 Latex 新手,我需要制作一个与此完全一样的框。我试过使用 tcolorbox,但它看起来和
这是我目前所拥有的
\documentclass[oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\begin{document}
\definecolor{main}{HTML}{5989cf}
\definecolor{sub}{HTML}{cde4ff}
\tcbset{sharp corners, colback = white, before skip = 0.2cm, after skip = 0.5cm }
\newtcolorbox{boxH}{ colback = sub, colframe = main, boxrule = 0pt, leftrule = 6pt % left rule weight
}
\begin{boxH}
\textsf{\textbf{Claim}} -- We can prove.
\end{boxH}
\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black]
\textsf{\textbf{Claim}} -- We can prove $a<b$
\end{tcolorbox}
\end{document}
答案1
\documentclass[12pt]{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{colorb}{
enhanced,
boxrule=0pt,frame hidden,
borderline west={2pt}{0pt}{green!50!black},
colback=green!05!white,
sharp corners
}
\begin{document}
\begin{colorb}
\textcolor{green!50!black}{\textbf{\textsf{Claim --}}} The only such function is $f(x)=0$.
\end{colorb}
\end{document}