TikZ-PGF – Creating Playing Cards, Part 2

cardstikz-pgf

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{\strippadding}{0.1}
\pgfmathsetmacro{\textpadding}{0.1}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
    \draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
    \fill[lime,rounded corners=0.1cm] (\strippadding,\strippadding) rectangle (\strippadding+\stripwidth,\cardheight-\strippadding) node[rotate=90,above left,black,font=\large] {INTER ARMA \rotatebox[origin=c]{-90}{\ding{52}}};
    \node[text width=(\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3)*1cm,below right] at (\strippadding+\stripwidth+\textpadding,\cardheight-\textpadding) {
        {\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}\\
        \tikz{\fill (0,0) rectangle (\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3,\ruleheight);}\\
        \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}

output card

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.

Best Answer

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{\strippadding}{0.1}
\pgfmathsetmacro{\textpadding}{0.1}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
    \draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
    \fill[lime,rounded corners=0.1cm] (\strippadding,\strippadding) rectangle (\strippadding+\stripwidth,\cardheight-\strippadding) node[rotate=90,above left,black,font=\large] {INTER ARMA \rotatebox[origin=c]{-90}{\ding{52}}};
    \node[text width=(\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3)*1cm,below right] at (\strippadding+\stripwidth+\textpadding,\cardheight-\textpadding) {
        {\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
%         \tikz{\fill (0,0) rectangle (\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3,\ruleheight);}\\
        \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}

enter image description here

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{\strippadding}{0.1}
\pgfmathsetmacro{\textpadding}{0.1}
\pgfmathsetmacro{\ruleheight}{0.15}
\begin{tikzpicture}
\draw[rounded corners=0.2cm] (0,0) rectangle (\cardwidth,\cardheight);
\fill[lime,rounded corners=0.1cm] (\strippadding,\strippadding) rectangle (\strippadding+\stripwidth,\cardheight-\strippadding) node[rotate=90,above left,black,font=\large] {INTER ARMA \rotatebox[origin=c]{-90}{\ding{52}}};
\node[text width=(\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3)*1cm,below right] at (\strippadding+\stripwidth+\textpadding,\cardheight-\textpadding) {
    {\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
%         \tikz{\fill (0,0) rectangle (\cardwidth-\strippadding-\stripwidth-2*\textpadding-0.3,\ruleheight);}\\
        \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}

enter image description here