TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have used the trees package to construct my drawing, but I don't actually need the edges. So I have set the following to suppress them:

\tikzstyle{edge from parent}=[]

This works, but TikZ still allocates space in the drawing to these edges, even when they aren't visible.

Is is possible to tell TikZ to ignore these when it performs its automatic clipping?

Here is my current code:

\newcommand{\tc}[1]{\includegraphics[clip,trim=1.15cm 1.15cm 1.15cm 1.15cm]{EPSCards/#1.pdf}}

\begin{tikzpicture}[grow cyclic,sibling angle=-12,level distance=8cm,scale=0.9] %scale just to fit on page easier
\node{} child[rotate=90]
        foreach \card in {KS,KH,KD,KC,AS} {node[transform shape,rotate=-90] {\tc{\card}}};

The graphics are available from: http://code.google.com/p/vectorized-playing-cards/ (You'll need to run epstopdf on the .eps files).

And the output:

output of above command

As you can see, there is extra space allocated at the bottom of the image for the tree edges. If I set these to not draw, the extra space doesn't go away. Is there a way to suppress the edges entirely?

I realise this isn't the best (ab)use of the trees package, but it was the fastest way to do what I wanted :)

share|improve this question
Hi Porges, welcome to TeX.sx! Could you provide a complete minimal example that demonstrates the behaviour you describe? – Jake Dec 1 '11 at 5:07
@Jake: I have updated with my actual code. – Porges Dec 1 '11 at 20:15
up vote 7 down vote accepted

Can I suggest an alternative way of doing this?

\newcommand{\tc}[1]{\includegraphics[clip,trim=1.15cm 1.15cm 1.15cm 1.15cm,scale=0.5]{card/#1}}
  \foreach \i/\j in {-24/KS,-12/KH,0/KD,12/KC,24/AS}
    \node at (\Angle:4cm) [rotate=-\i] {\tc{\j}};
  \draw (current bounding box.south east) rectangle (current bounding box.north west);

enter image description here

share|improve this answer
Yes, you can :) Thanks! – Porges Dec 1 '11 at 23:24
Absolutely brilliant! :) – Paulo Cereda Dec 2 '11 at 9:54
If I simply want to draw two cards, for example, the ACE of one suit any and the King of diamonds, how to make? – benedito Oct 17 '14 at 11:54
@benedito The cards aren't drawn, they're EPS-files added with \includegraphics. You can download them from the link in the question, and include them as any other image, i.e. \includegraphics{AS} for the Ace of Spades. If you need to arrange them in a particular way, and you're unable to figure out how, ask a new question about that. – Torbjørn T. Oct 17 '14 at 12:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.