# macro for card divider

I tried to adapt these card dividers for my needs, but using office caused me a lot of trouble. So, I tried LaTeX but I am not good enough at it. I got the basic table, but couldn't figure out how to set a fixed height and get the text on the tab and background image correctly. I would really appreciated it if someone shows me how to do a macro like

\setlength{cardheight}{5cm}
\setlength{cardwidth}{7cm}
\card{picture.png}{Copper}{Deal 7 Copper cards to each player at start..}.


Example of desired output:

• It's always advisable to present a minimal working example (MWE) rather than code snippets. This should start with \documentclass and end with \end{document}. It just speeds up getting answers your way. – Werner Jul 5 '13 at 22:35
• Should your macro receive also a number? (which appears circled in the provided example) – JLDiaz Jul 5 '13 at 22:37
• @JLDiaz, that would be very convenient, but I could add the number to the image. – Sandra Jul 5 '13 at 22:45
• @Werner, I thought that the pdf was explanation enough, but thanks I'll keep your comment in mind. – Sandra Jul 5 '13 at 22:47
• If you want to make fancier looking cards, you could look here and here. – Tom Bombadil Jul 6 '13 at 8:47

See the update below.

Here is a Tikz solution (since your question had a tikz tag). It can be done also with tables. The image for the scroll was taken here. There are some "magic numbers" in the code (the width of the image, its height, the width of the block of text, its minimum height). Feel free to modify them to your taste. Also the amount (-0.2,0.2) is somewhat arbitrary, trying to bring close the image to the block of text, because this particular image had a white padding.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand{\leftcard}[5]{ % #1 Background picture, #2 number, #3 number color, #4 Title, #5 text
\begin{tikzpicture}
\node[anchor=south east] (scroll)
{\includegraphics[width=4cm, height=1cm]{#1}};
\node[text width=6cm, draw, anchor=north east, minimum height=4cm]
(text) at ($(scroll.south east)+(-0.2,0.2)$) {\parskip=1ex #5};
\node[circle, fill=#3, anchor=west, draw] (number) at (scroll.west) {#2};
\node (title) at (scroll.center) {#4};
\end{tikzpicture}
}

\newcommand{\rightcard}[5]{ % #1 Background picture, #2 number, #3 number color, #4 Title, #5 text
\begin{tikzpicture}
\node[anchor=south east] (scroll)
{\includegraphics[width=4cm, height=1cm]{#1}};
\node[text width=6cm, draw, anchor=north west, minimum height=4cm]
(text) at ($(scroll.south west)+(0.2,0.2)$) {\parskip=1ex #5};
\node[circle, fill=#3, anchor=west, draw] (number) at (scroll.west) {#2};
\node (title) at (scroll.center) {#4};
\end{tikzpicture}
}

\newcommand{\cards}[5]{
\leftcard{#1}{#2}{#3}{#4}{#5}%
\rightcard{#1}{#2}{#3}{#4}{#5}\par
}

\begin{document}
\cards{scroll.jpg}{0}{orange!80!black}{Copper}{%
Deal 7 Copper cards to each player at the start.

2-4 players, use all basic Treasure cards from one
set.

5-6 players, combine all basic Treasure cards from
two sets.
}
\vskip 1cm
\cards{scroll.jpg}{3}{yellow!80!black}{Silver}{
2-4 players, use all basic Treasure cards from one
set.

5-6 players, combine all basic Treasure cards from
two sets.
}
\end{document}


Resulting page:

## Update

The OP requested no gap between cards, so I investigated why a gap appeared in the solution above. There were some unwanted spaces due to the usual problem of carriage returns. Inserting some % at the end of critical lines solved this.

But the main source of problems was that the image scroll.jpg which I choose to use had a white padding around, which forced me to "shift" the image to make it closer to the card. A better approach is to remove the padding using trim option of \includegraphics. This way the shift is not required.

This is the new solution:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand{\leftcard}[5]{% #1 Background picture, #2 number, #3 number color, #4 Title, #5 text
\begin{tikzpicture}
\node[anchor=south east, inner sep=0pt] (scroll)
{\includegraphics[clip, trim=20 20 20 20, width=4cm, height=1cm]{#1}};
\node[text width=6cm, draw, anchor=north east, minimum height=4cm]
(text) at (scroll.south east) {\parskip=1ex #5};
\node[circle, fill=#3, anchor=west, draw] (number) at (scroll.west) {#2};
\node (title) at (scroll.center) {#4};
\end{tikzpicture}%
}

\newcommand{\rightcard}[5]{% #1 Background picture, #2 number, #3 number color, #4 Title, #5 text
\begin{tikzpicture}
\node[anchor=south west, inner sep=0pt] (scroll)
{\includegraphics[clip, trim=20 20 20 20, width=4cm, height=1cm]{#1}};
\node[text width=6cm, draw, anchor=north west, minimum height=4cm]
(text) at (scroll.south west) {\parskip=1ex #5};
\node[circle, fill=#3, anchor=west, draw] (number) at (scroll.west) {#2};
\node (title) at (scroll.center) {#4};
\end{tikzpicture}%
}

\newcommand{\cards}[5]{
\leftcard{#1}{#2}{#3}{#4}{#5}%
\rightcard{#1}{#2}{#3}{#4}{#5}\par
}

\begin{document}
\cards{scroll.jpg}{0}{orange!80!black}{Copper}{%
Deal 7 Copper cards to each player at the start.

2-4 players, use all basic Treasure cards from one
set.

5-6 players, combine all basic Treasure cards from
two sets.
}
\vskip 1cm
\cards{scroll.jpg}{3}{yellow!80!black}{Silver}{
2-4 players, use all basic Treasure cards from one
set.

5-6 players, combine all basic Treasure cards from
two sets.
}
\end{document}


• This looks already very promising. I see one problem, though. The left and right cards need to touch each other because they get folded together along the middle line (this also means that the circle of the right card should not extend beyond the text box below). – Sandra Jul 5 '13 at 23:44
• Oho! sorry. I think I should give some rest to my eyes! Thanks – user11232 Jul 6 '13 at 0:12
• I managed to get the circles at the right spot, but how can I move the left and right card closer together? – Sandra Jul 6 '13 at 0:49
• @Sandra Updated answer – JLDiaz Jul 6 '13 at 9:21

Here's a TikZ-free solution, using some simple minipages, \parboxes and tabulars (the test image used was the same as in JLDiaz's answer):

\documentclass{article}
\usepackage[margin=2cm,paperheight=16cm]{geometry}
\usepackage{graphicx}

\newlength\cardheight
\newlength\cardwidth

\setlength\cardheight{5cm}
\setlength\cardwidth{7cm}

\newcommand\cards[4]{%
\par\noindent
\begin{minipage}{\cardwidth}
\raggedleft\includegraphics[width=.5\cardwidth,height=1cm]{#1}%
\llap{\raisebox{0.4cm}{\parbox[t]{.5\linewidth}{\centering\bfseries#2}}}
\end{minipage}%
\begin{minipage}{\cardwidth}
\raggedright\includegraphics[width=.5\cardwidth,height=1cm]{#1}
\llap{\raisebox{0.4cm}{\parbox[t]{.5\linewidth}{\centering\bfseries#2}}}
\end{minipage}\par\nobreak\nointerlineskip
\noindent\fbox{\begin{minipage}[t][\cardheight][t]{\dimexpr\cardwidth-2\fboxsep-2\fboxrule\relax}
\renewcommand\arraystretch{1.3}
\begin{tabular}{p{\dimexpr\linewidth-2\tabcolsep\relax}}
\hfill \small\scshape #3 \\
#4
\end{tabular}
\end{minipage}}%
\fbox{\begin{minipage}[t][\cardheight][t]{\dimexpr\cardwidth-2\fboxsep-2\fboxrule\relax}
\renewcommand\arraystretch{1.3}
\begin{tabular}{p{\dimexpr\linewidth-2\tabcolsep\relax}}
\small\scshape #3 \\
#4
\end{tabular}%
\end{minipage}}\par\bigskip%
}

\pagestyle{empty}

\begin{document}
\centering

\cards{scroll}{Copper}{Treasure ($\times 30$)}{%
Deal 7 Copper cards to each player at the start. \\
2-4 players, use all basic Treasure cards from oneset. \\
5-6 players, combine all basic Treasure cards from two sets.}

\setlength\cardheight{4cm}
\setlength\cardwidth{8cm}

\cards{scroll}{Silver}{Treasure ($\times 40$)}{%
Deal 7 Copper cards to each player at the start. \\
2-4 players, use all basic Treasure cards from oneset. \\
5-6 players, combine all basic Treasure cards from two sets.}

\end{document}