Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}}};
\end{tikzpicture}

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
1  
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

1 Answer 1

up vote 7 down vote accepted

Can I suggest an alternative way of doing this?

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

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

Your Answer

 
discard

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.