# Creating playing cards using TikZ, part 2

This is a follow up from this other post.. Thanks to the aid of some people I'm almost done, this is what I have now:

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{anttor}
\usepackage[utf8]{inputenc}
\begin{document}
\pgfmathsetmacro{\cardwidth}{5}
\pgfmathsetmacro{\cardheight}{8}
\pgfmathsetmacro{\stripwidth}{0.6}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
\draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
{\Large KEEPER}\\
\vspace{0.15cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}\\
\vspace{0.25cm}
{\large Inter Arma}\\
\vspace{0.2cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit.\\
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
};
\end{tikzpicture}
\end{document}


The problems are:

1. the line below "Inter Arma" should be closer to it, like an underline.
2. if the text has multiple paragraphs, the spacing becomes bad (look the image). How can I control it?
3. I intend to use Poker card sizes, should I change width and heigth to 6.3 and 8.8?
4. The calculation of the main area's width in the answer to my previous question was bad, so I substracted 0.3 to it. Why is that? it seemed ok as it was. Solved.
-
I think point 4 was due to inner sep, thats why I set it to zero in the edit of bthe first answer. –  Tom Bombadil Mar 14 '12 at 21:16
Thanks for taking the time to post this follow-up question. I guess I should've explained a bit more how questions here work. we like questions to focus around one precise and relatively abstract detail, not around a concrete use case. The idea is that people with the same (abstract) problem can look up solutions. A good start is including a minimal working example (MWE) that illustrates your problem. This post, however, contains four quite separate questions, so it'd actually be better if you kept these matters in the original question. –  doncherry Mar 14 '12 at 21:17
The kind of follow-up question I had in mind would've been "How do I rotate a symbol in TikZ by 90°?" or the like, not just "part 2". "Part 2" should really stick within one post with "Part 1", but generally the approach of having one "project" in one post isn't quite right for tex.sx, which is kinda special in this regard. Sorry about the confusion. I'm not quite sure how to proceed. –  doncherry Mar 14 '12 at 21:19
@doncherry I understand, it won't happen again. –  Diego Mar 14 '12 at 21:48

For the first two queries, I have some solution. The third query... I did not understand. Is it that you can't change the paper size or you are asking whether you should change it? You can change the paper size using geometry package.

\usepackage[paperwidth=6.3cm,paperheight=8.8cm,margin=15mm]{geometry}


First two queries have been solved here.

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{anttor}
\usepackage[normalem]{ulem}
\usepackage[utf8]{inputenc}
\renewcommand\ULthickness{4pt}
\setlength \ULdepth{6pt}
\begin{document}
\pgfmathsetmacro{\cardwidth}{5}
\pgfmathsetmacro{\cardheight}{8}
\pgfmathsetmacro{\stripwidth}{0.6}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
\draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
{\Large KEEPER}\\
\vspace{0.15cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\}%<------modified here
\vspace{0.25cm}
{ {\large \uline{Inter Arma\hfill} }}\\ % <------modified here
\vspace{0.2cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit.\\[5pt] % <------modified here
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\} % <------Give a line break here
\vfill   };
\end{tikzpicture}
\end{document}


I have used the package ulem to put an underline. You can change underline thickness and depth by appropriately changing the values in

\renewcommand\ULthickness{4pt}
\setlength \ULdepth{5pt}


Disclaimer: This solution holds good if that underline need not come at the center of the card.

Edit: As it is requested to accommodate underline for two lines Following can be used:

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{anttor}
\usepackage[utf8]{inputenc}
\begin{document}
\pgfmathsetmacro{\cardwidth}{5}
\pgfmathsetmacro{\cardheight}{8}
\pgfmathsetmacro{\stripwidth}{0.6}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
\draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
{\Large KEEPER}\\
\vspace{0.15cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\}%<------modified here
\vspace{0.25cm}
{{\large {Inter Arma going into two lines\hfill} }} \\[-9pt]% <------modified here
\vrule width \textwidth height 3pt \\[-3pt] % <------modified here
\vspace{0.2cm}
{\scriptsize Lorem ipsum dolor sit amet, consectetur adipisicing elit.\\[5pt] %
<------modified here
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\} % <------Give a line break here
\vfill   };

\end{tikzpicture}
\end{document}


-
Thank you! this is nice, but the underline looks ugly when the text needs more than one line. –  Diego Mar 14 '12 at 23:42
In that case you can underline only the last line manually. –  Harish Kumar Mar 14 '12 at 23:47
Alternative way: You can put a rectangle explicitly at the proper coordinates. For your case:- \draw[fill=black] (0.95,4.69) rectangle (4.75,4.78); and remove the underline. –  Harish Kumar Mar 14 '12 at 23:54
Those solutions doesn't work in my case because the number of cards is ~50: the texfile is generated by a python script which is fed with a file that has all the cards' contents. –  Diego Mar 15 '12 at 0:06
@Diego Ok. Then add these.  {{\large {Inter Arma\hfill} }} \[-4pt] \vrule width \textwidth height 3pt` . Let me know if it is good. –  Harish Kumar Mar 15 '12 at 0:14