2

I am working on a board game and want to cut out a prototype of my cards. I set up the cards as a TiKZ picure template and then I put them all in a longtable to have a grid of cards, which I'd print and cut out from the paper. This is a MWE of what I have now:

\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{longtable}

\newcommand{\card}[1]{ \begin{tikzpicture} \draw (0,0) rectangle (50mm, 70mm); \node (title) at (25mm, 35mm){ #1 }; \end{tikzpicture} }

\begin{document}

\begin{longtable}{ c c c } \card{Card 1} & \card{Card 2} & \card{Card 3} \ \card{Card 4} & \card{Card 5} & \card{Card 6} \end{longtable}

\end{document}

Notice that there is space between the cards in the grid, both vertically and horizontally. Ideally, I'd want them to directly touch each other to make cutting them out easier (half the work, since each cut is shared between two cards). Another problem with longtable that I have is that I need to have a \\ every 3 cards, so I have to edit them all each time I add in or remove a card from the list.

I am open to using any other type of environment to put them in a grid, but I'd rather not have to (significantly) change the card template itself.

indjev99
  • 23
  • 4

1 Answers1

4
  • In order to get rid of the vertical white space between cards in adjacent rows, add [baseline=(current bounding box.center)] as an optional argument to your tikzpicture.

  • To reomve the horizontal white space between cards in adjacent columns, use \setlength{\tabcolsep}{0pt} and add a % after \end{tikzpicture}.

Combining these changes, we end up with the following MWE and output.

enter image description here

\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{longtable}

\newcommand{\card}[1]{% \begin{tikzpicture}[baseline=(current bounding box.center)] \draw (0,0) rectangle (50mm, 70mm); \node (title) at (25mm, 35mm){ #1 }; \end{tikzpicture}% }

\begin{document} \setlength{\tabcolsep}{0pt} \begin{longtable}{ c c c } \card{Card 1} & \card{Card 2} & \card{Card 3} \ \card{Card 4} & \card{Card 5} & \card{Card 6} \end{longtable}

\end{document}

leandriis
  • 62,593