1

I'm creating D&D item cards for my players using TikZ and the template given by Tom Bombadil on this question.

The code below produces this result: enter image description here

What I really want is this result: enter image description here

I have the following code:

\documentclass{minimal}
\usepackage[a5paper,margin=1cm]{geometry}
\usepackage{tikz}
\usepackage{multicol}
\usepackage{amsthm,amsmath,amssymb}
\usepackage[protrusion=true,expansion=true]{microtype}
\addtolength{\oddsidemargin}{-4.75cm}
\addtolength{\evensidemargin}{-4.75cm}
\usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds,fit}
\usepackage[utf8]{inputenc}
\begin{document}
\tikzstyle{textstyle}=[rectangle, text width=3.5cm, text badly ragged, scale=0.8]
\begin{multicols}{3}

\begin{center}
  \begin{tikzpicture}[background rectangle/.style = {draw=black, fill=white,
        rounded corners}, show background rectangle, node distance=0.2cm]
    \node (side) [textstyle, fill=white, rotate=90, text width=4cm, scale=1.2, text centered] {%
        \begin{tabular}{r}
        \textbf{
            Item %TYPE
        }
        \end{tabular}
    };
    \node (kind) [textstyle, right=of side, scale=1.2] {\textbf{Bottle}};%
    \node (desckind) [textstyle, below=of kind, text width=5cm, scale=.8] {
        A mysterious silvery yellow liquid inside a tall, glass bottle. The bottle holds about half a liter of liquid, from your best guess. The liquid smells sweet and reminds you of home.
    };
    \node (title) [textstyle, below=of desckind, scale=1.2] {Consumable};
    \node (separator) [thin, fill=black, below=of title, text width=3.5cm] {};
    \node (description) [textstyle, below=of separator, text width=5cm, scale=.8] {
         The mother of 1000 is one of the few entities that is known for rewarding her followers in turn for blood sacrifices.
    };
  \end{tikzpicture}
\end{center}
\end{multicols}

\tikzstyle{textstyle}=[rectangle, text width=3.5cm, text badly ragged, scale=0.8]
\begin{multicols}{3}

\begin{center}
  \begin{tikzpicture}[background rectangle/.style = {draw=black, fill=white,
        rounded corners}, show background rectangle, node distance=0.2cm]
    \node (side) [textstyle, fill=white, rotate=90, text width=4cm, scale=1.2, text centered] {%
        \begin{tabular}{r}
        \textbf{
            Item %TYPE
        }
        \end{tabular}
    };
    \node (kind) [textstyle, right=of side, scale=1.2] {\textbf{Slaver’s claws}};%
    \node (desckind) [textstyle, below=of kind, text width=5.2cm, scale=.75] {
        A set of claws worn on the fist, used to distinguish the slavers of the Csawxthoth clan. The slavers have some of the most important jobs of the Csawxthoth, and as such, they are made to be of high rank. Legend says of a rogue slaver who decided that he was above the natural law, but came crashing into the ground.
    };
    \node (title) [textstyle, below=of desckind, scale=1.2] {Weapon};
    \node (separator) [thin, fill=black, below=of title, text width=3.5cm] {};
    \node (description) [textstyle, below=of separator, text width=5cm, scale=.8] {
         \textbf{Damage} (2 handed only): 2d4+1 Slashing
    };
  \end{tikzpicture}
\end{center}
\end{multicols}

\end{document}

and my suspect is an error that I get when compiling:

Overfull \hbox (6.57977pt too wide) in paragraph at lines 34--35

I'm not sure what the error corresponds to, and I'm not sure how to fix it.

  • You are using multicols, put one image in. Start a new muticols environment, which start a new paragraph as well, and put another image in. If you don't know what the multicols are for, don't use them. – Johannes_B Dec 17 '17 at 8:00
  • Wouldn't it be much better to use the code from the answer instead of the code that lead to the question? – Johannes_B Dec 17 '17 at 8:04
  • @Johannes_B i am using the code from the answer, and i say it in my question – tuskiomi Dec 17 '17 at 8:08
  • I can only find three instances of multicol, in the question. – Johannes_B Dec 17 '17 at 8:31
2

Here is a possibility using the adjustbox package instead of multicols:

\documentclass{minimal}
\usepackage[a5paper,margin=1cm]{geometry}
\usepackage{tikz}
\usepackage{adjustbox}
\usepackage{amsthm,amsmath,amssymb}
\usepackage[protrusion=true,expansion=true]{microtype}
%\addtolength{\oddsidemargin}{-4.75cm}
%\addtolength{\evensidemargin}{-4.75cm}
\usetikzlibrary{positioning,shapes,shadows,arrows,backgrounds,fit}
\usepackage[utf8]{inputenc}
\begin{document}
\tikzstyle{textstyle}=[rectangle, text width=3.5cm, text badly ragged, scale=0.8]

\begin{center}
  \adjustbox{valign=t}{
    \begin{tikzpicture}[background rectangle/.style = {draw=black, fill=white,
        rounded corners}, show background rectangle, node distance=0.2cm]
      \node (side) [textstyle, fill=white, rotate=90, text width=4cm, scale=1.2, text centered] {%
        \begin{tabular}{r}
          \textbf{
            Item %TYPE
          }
        \end{tabular}
      };
      \node (kind) [textstyle, right=of side, scale=1.2] {\textbf{Bottle}};%
      \node (desckind) [textstyle, below=of kind, text width=5cm, scale=.8] {A mysterious silvery yellow liquid inside a tall, glass bottle. The bottle holds about half a liter of liquid, from your best guess. The liquid smells sweet and reminds you of home.
      };
      \node (title) [textstyle, below=of desckind, scale=1.2] {Consumable};
      \node (separator) [thin, fill=black, below=of title, text width=3.5cm] {};
      \node (description) [textstyle, below=of separator, text width=5cm, scale=.8] {The mother of 1000 is one of the few entities that is known for rewarding her followers in turn for blood sacrifices.
      };
    \end{tikzpicture}}\hspace{.3cm}\adjustbox{valign=t}{\begin{tikzpicture}[background rectangle/.style = {draw=black, fill=white,rounded corners}, show background rectangle, node distance=0.2cm]
      \node (side) [textstyle, fill=white, rotate=90, text width=4cm, scale=1.2, text centered] {%
        \begin{tabular}{r}
          \textbf{
            Item %TYPE
          }
        \end{tabular}
      };
      \node (kind) [textstyle, right=of side, scale=1.2] {\textbf{Slaver’s claws}};%
      \node (desckind) [textstyle, below=of kind, text width=5.2cm, scale=.75] {A set of claws worn on the fist, used to distinguish the slavers of the Csawxthoth clan. The slavers have some of the most important jobs of the Csawxthoth, and as such, they are made to be of high rank. Legend says of a rogue slaver who decided that he was above the natural law, but came crashing into the ground.
      };
      \node (title) [textstyle, below=of desckind, scale=1.2] {Weapon};
      \node (separator) [thin, fill=black, below=of title, text width=3.5cm] {};
      \node (description) [textstyle, below=of separator, text width=5cm, scale=.8] {
        \textbf{Damage} (2 handed only): 2d4+1 Slashing
      };
    \end{tikzpicture}}
  \end{center}
\end{document}

enter image description here

  • Yes, but how does this fix the watermark? – tuskiomi Dec 17 '17 at 8:55
  • what watermark? – Nico Vecchio Dec 17 '17 at 8:58
  • The one in the images – tuskiomi Dec 17 '17 at 9:20
  • I'm sorry, I don't see any watermark, I'm looking at the image below "What I really want is this result:" – Nico Vecchio Dec 17 '17 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.