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

Given this image (a simple edge between two nodes):

\begin{tikzpicture}[>=latex,line join=bevel,]
  \node (a1) at (44bp,8bp) [draw,trapezium] {$A$};
  \node (d1) at (44bp,82bp) [draw,trapezium, shape border rotate=180] {$B$};
  \draw [->] (d1) ..controls (44bp,62.836bp) and (44bp,41.478bp)  .. node {$edge$} (a1);

I defined:

\tikzstyle{every node}=[drop shadow, fill=white, draw]

What happends is that also the node on the edge gets rendered in a box and with shadow. I want the edge label to be just the text without loosing the every node rule.

Thus my question is: Is there a way I can specify specific rendering for nodes in edges while keeping all other nodes with shadow?

I must note that my tikz picture is generated, thus I only have control over the every styles.

share|improve this question
up vote 6 down vote accepted

You're not using an edge in the TikZ sense in your drawing, it's just a normal path with a node ( TikZ edge is created by using \path (A) edge (B)). As such, no every ... style that's specific to the "edge" node is installed, and you can't hook into it.

Since you say your image is generated (how?), you might have to approach this a bit differently. Instead of making every node have a drop shadow, you can apply the shadow just to every trapezium node in this example.

\tikzset{every trapezium node/.style={
        drop shadow, fill=white, draw
\begin{tikzpicture}[>=latex,line join=bevel,]
  \node (a1) at (44bp,8bp) [draw,trapezium] {$A$};
  \node (d1) at (44bp,82bp) [draw,trapezium, shape border rotate=180] {$B$};
  \draw [->] (d1) ..controls (44bp,62.836bp) and (44bp,41.478bp)  .. node {$edge$} (a1);
share|improve this answer
I think you might want to actually make the style every trapezium node instead of every node in the code. Like you say in the text ;-) – Roelof Spijker Nov 24 '11 at 7:59
Thanks for the answer, @Jake. I figured that is the way for doing this. I was hoping for an answer in the direction of being able to be able to be more specific and do something like every draw node. That way I can also enable automatic shadows on all other types of nodes, except nodes on "edges". The tikz is generated by [dot2texi] (fauskes.net/code/dot2tex) btw. Why do you include every path? Is this to show there are no TikZ edges? – Tim Nov 24 '11 at 14:08
@Tim: Sorry, I copied and pasted the wrong code. – Jake Nov 24 '11 at 21:16

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.