1

Starting from a old my question with the code of the user @Ignasi,

enter image description here

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{pifont}
\newtcolorbox{mybox}[2][]{%
    colback=teal!10,
    coltitle=black,
    colframe=teal!30,
    fonttitle=\bfseries,
    title=#2, 
    sharp corners,
    rounded corners=southeast,
    arc is angular,
    arc=3mm,
    boxrule=0pt,
    enhanced,
    overlay={\node[font=\Huge, text=cyan!70!black] at ([yshift=-4mm]interior.north west) {\ding{228}};},
    underlay={
        \path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
        \path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
    },
    drop fuzzy shadow,
    #1
    }

\usepackage{lipsum} \begin{document} \begin{mybox}{An example} \lipsum[1] \end{mybox} \end{document}

is it possible to create a white (or other specific color) spider wires on the light cyan framed?

enter image description here

Sebastiano
  • 54,118

1 Answers1

2

It's possible to add any graphic (or text) as a watermark. But watermarks are incompatible with overlays unless you use options from hooks library (see https://tex.stackexchange.com/a/593025/1952).

Following code adds the spider web as watermark graphic and the original overlay option has been converted to overlay app and placed after watermark definition.

\documentclass{article}
\usepackage[most, hooks]{tcolorbox}
\usepackage{pifont}
\newtcolorbox{mybox}[2][]{%
    colback=teal!10,
    coltitle=black,
    colframe=teal!30,
    fonttitle=\bfseries,
    title=#2, 
    sharp corners,
    rounded corners=southeast,
    arc is angular,
    arc=3mm,
    boxrule=0pt,
    enhanced,
    underlay={
        \path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
        \path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
    },
    watermark graphics={SpiderWeb.png},
    watermark opacity=0.35,
    watermark overzoom=1,
    overlay app={\node[font=\Huge, text=cyan!70!black] at ([yshift=-4mm]interior.north west) {\ding{228}};},
    drop fuzzy shadow,
    #1
    }

\usepackage{lipsum} \begin{document} \begin{mybox}{An example} \lipsum[1] \end{mybox}

\end{document}

enter image description here

Ignasi
  • 136,588
  • I have seen your wonderful work. Before I have thought if there is a specific function to draw a spider wires. But you can see that the spiders wires not permit to read well the text. Peraphs in background, I think, it is better than...in this way. However thank you very much. – Sebastiano May 10 '21 at 18:46
  • 1
    I've included you image as watermark, but you can also draw anything in the background. You can use tikz command into an underlay option. But you need to know how to draw the web. – Ignasi May 10 '21 at 20:01
  • Thank you very much. Before I was on math.se. Best regards. – Sebastiano May 10 '21 at 20:20