如何使用 tcolorbox 包创建具有以下格式且高度和宽度可根据标题文本调整的框标题?

如何使用 tcolorbox 包创建具有以下格式且高度和宽度可根据标题文本调整的框标题?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}

\begin{document}
\definecolor{c1b1918}{RGB}{27,25,24}


\begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-1.000000, xscale=1.000000, inner sep=0pt, outer sep=0pt]
\path[draw=c1b1918,line join=miter,line cap=butt,line width=0.400pt]
  (216.3918,217.8559) -- (586.2226,218.3214) .. controls (586.2226,258.6244) and
  (553.5499,291.2970) .. (513.2461,291.2970) .. controls (513.0908,291.2970) and
  (512.9366,291.2920) .. (512.7812,291.2910) -- (512.7812,291.4625) --
  (216.3918,291.4625) -- cycle;

\end{tikzpicture}
\end{document}

答案1

我不这么认为,但是像这样的事情?

在此处输入图片描述

\documentclass{article}
\usepackage[most]{tcolorbox}

\begin{document}

\begin{tcolorbox}[
    enhanced,
    title = My title,
    coltitle=blue,
    attach boxed title to top left,
    boxed title style = {empty, boxrule=0.5mm},
    underlay boxed title={
        \draw[line width=.5mm, fill=red!30] (title.south west)|-(title.north east) arc (0:-90:\tcboxedtitleheight) -- cycle;
    },
    ]
    Some text
\end{tcolorbox}

\end{document}

相关内容