I'm trying to make a shaped box to hold arbitrary content and I'm using tcolorbox
with code I adapted for my purposes from another question. So far I have:
\documentclass[20pt, a4paper]{article}
\usepackage{color}
\usepackage{tcolorbox}
\usepackage{lipsum}
\tcbuselibrary{skins}
\usetikzlibrary{calc}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\newtcolorbox{mybox}{
left=15pt,
top=15pt,
bottom=15pt,
right=15pt,
skin=freelance,
frame code={%
\begin{pgfonlayer}{background}
\draw[line width=4pt,color=purple,fill=purple]($(frame.north west) + (15pt, 0pt)$)
-- (frame.north east)
-- ($(frame.south east) + (0pt, 15pt)$)
-- ($(frame.south east) + (-15pt, 0pt)$)
-- (frame.south west)
-- ($(frame.north west) + (0pt, -15pt)$)
-- cycle;
\end{pgfonlayer}
},
}
\begin{document}
\begin{mybox}
\lipsum[1]
\end{mybox}
\end{document}
I would like some way to fully fill the shape formed with a solid color without going outside the lines, but behind the content to be displayed. Using the colback
option creates a rounded rectangle box of color that goes outside the lines at points and doesn't quite reach the corners at others. However if I try and use the fill option for the shape then it is either filled and blocking out the text, or entirely behind the background color box (depending on which layer I put the frame code on).
interior code=
...color
:tcolorbox
loadspgf
, which loadsxcolor
.