I'm trying to build a Dungeons and Dragons style LaTeX-Template and would like to recreate a certain box-style as seen here:
Using tikz I managed to recreate the rough shape but I don't have any idea how to…
- scale the box vertically so it fits the text
- put the text into the box which automatically linebreaks to fit the right margin
Any help would be very appreciated :-).
MWE:
\documentclass[10pt,twoside]{article}
\usepackage{multicol}
\usepackage{tikz} %for quotebox
\let\svtikzpicture\tikzpicture %remove left indent for tikz picture
\def\tikzpicture{\noindent\svtikzpicture} %remove left indent for tikz picture
\begin{document}
\begin{multicols}{2}
\begin{tikzpicture}
\path [fill=gray] (0,0) rectangle (\linewidth,10em);
\draw [red, thick] (0,0) -- (0,10em);
\draw [red,fill] (0,0) circle [radius=0.05];
\draw [red,fill] (0,10em) circle [radius=0.05];
\draw [red,thick] (\linewidth,0) -- (\linewidth,10em);
\draw [red, fill] (\linewidth,0) circle [radius=0.05];
\draw [red, fill] (\linewidth,10em) circle [radius=0.05];
\node at (1em,5em) {text};
\end{tikzpicture}
\end{multicols}
\end{document}
Best Answer
I had the same idea as Christian, but as my implementation looks a bit more like the original, I'm posting another answer.
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:You can then easily use it like this: