# How can I define a different style for edges and nodes?

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


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.

-

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.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\tikzset{every trapezium node/.style={
\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 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