D&D 物品卡不会使用 TikZ 共享行

D&D 物品卡不会使用 TikZ 共享行

我正在使用 TikZ 和提供的模板为我的玩家创建 D&D 物品卡汤姆·邦巴迪尔这个问题

下面的代码产生这个结果: 在此处输入图片描述

我真正想要的是这样的结果是: 在此处输入图片描述

我有以下代码:

\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}

我怀疑是在编译时出现的错误:

段落第 34-35 行的 \hbox 过满(宽 6.57977pt)

我不确定该错误对应的是什么,我也不确定如何修复它。

答案1

以下是使用 adjustbox 包而不是 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}

在此处输入图片描述

相关内容