Hi, is there any way how to make "box" follow shape of words?
Tcolorbox – How to Create Box Repeat Shape of Word
adjustboxboxboxestcolorbox
Related Solutions
Here's one option using the background
package; adjust the settings according to your needs:
The code (needs two or three compilations):
\documentclass{article}
\usepackage{tikz}
\usepackage[color=black,opacity=1,angle=0,scale=1]{background}
\usepackage{lipsum}
\backgroundsetup{
contents={%
\begin{tikzpicture}[remember picture,overlay]
\node[inner sep=0pt,outer sep=0pt,draw,anchor=west,text width=1.2in,minimum height=\textheight]
(sidebar)
at ([xshift=10pt]current page.west)
{};
\node[inner sep=0pt,anchor=north]
(image)
at ([yshift=-20pt]sidebar.north)
{\includegraphics[width=1in]{example-image-a}};
\node[inner sep=0pt,anchor=north,font=\LARGE\bfseries]
(title)
at ([yshift=-20pt]image.south)
{Title};
\node[inner sep=0pt,anchor=north,text width=1in]
(text)
at ([yshift=-20pt]title.south)
{Some additional text goes here};
\end{tikzpicture}%
}
}
\begin{document}
\lipsum[1-20]
\end{document}
I had the same idea as Christian, but as my implementation looks a bit more like the original, I'm posting another answer.
\documentclass{article}
\usepackage[most]{tcolorbox}
\definecolor{background}{HTML}{FCF9EE}
\definecolor{linecolor}{HTML}{581810}
\begin{document}
\begin{tcolorbox}[
enhanced,
boxsep=0.25ex,
arc=0mm,
borderline west={1pt}{-0.5pt}{linecolor},
borderline east={1pt}{-0.5pt}{linecolor},
colback=background,
colframe=background,
overlay={
\foreach \n in {north east,north west,south east,south west}
{\draw [linecolor, fill=linecolor] (frame.\n) circle (2pt); }; }]
\begin{description}
\item[Dungeon Master (DM):] OK, one at a time. Phillip, you are looking at the gargoyles?
\item[Phillip:] Yeah. Is there any hint they might be creatures and not decorations?
\item[DM:] Make an Intelligence check.
\item[Phillip:] Does my Investigation skill apply?
\item[DM:] Sure!
\item[Phillip (rolling a d20):] Ugh. Seven.
\item[DM:] They look like decorations to you. And Amy, Riva is checking out the drawbridge?
\end{description}
\end{tcolorbox}
\end{document}
EDIT:
As you probably want to use this box multiple times in your document it makes sense to define a new environment based on tcolorbox
like this:
\newtcolorbox{dungeonbox}{enhanced,
boxsep=0.25ex,
arc=0mm,
borderline west={1pt}{-0.5pt}{linecolor},
borderline east={1pt}{-0.5pt}{linecolor},
colback=background,
colframe=background,
overlay={
\foreach \n in {north east,north west,south east,south west}
{%
\draw [linecolor, fill=linecolor] (frame.\n) circle (2pt);
};
}
}
You can then easily use it like this:
\begin{dungeonbox}
...
\end{dungeonbox}
Best Answer