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.

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.

share|improve this question

1 Answer 1

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.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,shadows}
\begin{document}
\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);
\end{tikzpicture}
\end{document}
share|improve this answer
1  
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

 
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.