2

Does anyone know how to create these?

enter image description here

enter image description here

I think they made it by using tcolorbox but I can't find a way to generate them.

Schwale
  • 2,049

2 Answers2

6

One possibility:

enter image description here

The code:

\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}

The code for the second one was taken directly from page 133 of the tcolorbox manual.

Gonzalo Medina
  • 505,128
  • @Gonzalo How can we have the first one such that the bottom title box is also at the top (symmetrical), thus we have two titles. – blackened Nov 16 '17 at 12:12
0

enter image description here

The same code modified:

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

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

\newtcolorbox{ridentidad}[1][]{ enhanced, frame code={ \fill[draw=white,top color=red!60,bottom color=white] ([xshift=-20pt]title.south west) -- (title.north west) -- (title.north east) -- ([xshift=20pt]title.south east) -- cycle; \draw[red,line width=0.4mm,rounded corners] (frame.south west) -- (frame.north west) -- ([xshift=-20pt]title.south west) -- (title.north west) -- (title.north east) -- ([xshift=20pt]title.south east) -- (frame.north east) -- (frame.south east); }, coltitle=red!70!black, colback=white, attach boxed title to top 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}