代码如下:

\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}

\definecolor{bidentitlebg}{RGB}{158,59,255}

\newtcolorbox{ridentidad}[1][]{
  enhanced,
  frame code={
    \fill[draw=white,top color=white,bottom color=red!60]
      ([xshift=-20pt]title.north west) --
      (title.south west) --
      (title.south east) --
      ([xshift=20pt]title.north east) -- cycle;
    \draw[red,line width=0.4mm,rounded corners]
      (frame.north west) --
      (frame.south west) --
      ([xshift=-20pt]title.north west) --
      (title.south west) --
      (title.south east) --
      ([xshift=20pt]title.north east) --
      (frame.south east) --
      (frame.north east);
  },
  coltitle=red!70!black,
  colback=white,
  attach boxed title to bottom center,
  boxed title style={empty},
  fonttitle=\bfseries\sffamily,
  title=\strut Identidades,
  #1,
}

\newtcolorbox{bidentidad}[1][]{
  enhanced,
  skin=enhancedlast jigsaw,
  attach boxed title to top left={xshift=-4mm,yshift=-0.5mm},
  fonttitle=\bfseries\sffamily,
  colbacktitle=blue!45,
  colframe=red!50!black,
  interior style={
    top color=blue!10,
    bottom color=red!10
  },
  boxed title style={
    empty,
    arc=0pt,
    outer arc=0pt,
    boxrule=0pt
  },
  underlay boxed title={
    \fill[blue!45!white]
      (title.north west) --
      (title.north east) --
      +(\tcboxedtitleheight-1mm,-\tcboxedtitleheight+1mm) --
      ([xshift=4mm,yshift=0.5mm]frame.north east) --
      +(0mm,-1mm) --
      (title.south west) -- cycle;
    \fill[blue!45!white!50!black]
      ([yshift=-0.5mm]frame.north west) --
      +(-0.4,0) --
      +(0,-0.3) -- cycle;
    \fill[blue!45!white!50!black]
      ([yshift=-0.5mm]frame.north east) --
      +(0,-0.3) --
      +(0.4,0) -- cycle;
  },
  title={Identidades},
  #1
}

\begin{document}

\begin{ridentidad}
\lipsum[4]
\end{ridentidad}

\begin{bidentidad}
\lipsum[4]
\end{bidentidad}

\end{document}

选自:https://tex.stackexchange.com/questions/243768/box-with-fancy-colors

点赞(2)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部