Document ClassesTikz Nodestyle

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Jones Jonsen
Posts: 2
Joined: Mon Nov 10, 2008 9:41 pm

Tikz Nodestyle

Post by Jones Jonsen »

Good evening,

i am trying to draw an ER-Modell, but unfortunately some node styles are missing. So I tried to build up the styles of the nodes myself...
That didn't work that well, actually i could not find a way to draw a double circle (a double ellipse actually ;)) around one node. here's what i did:

Code: Select all

...
\usepackage{tikz}
\usetikzlibrary{er}
\usepgflibrary{shapes.geometric}
\begin{tikzpicture}
	[ multiA/.style ={draw =black, line width=2mm,shape=ellipse, fill=black!5, thick}]
\node [multiA] (b) at (0,0) {Hello};
\end{tikzpicture}
...
Thats just one ellipse, but where to get the second one?

I tried to use the preaction and postaction command but i think it does not work properly with nodes.
Maybe one of you has a good idea how i could create such a style :)

greetings Jones

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Tikz Nodestyle

Post by gmedina »

Hi,

you could use the double key, as the following simple example illustrates:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\usepgflibrary{shapes.geometric}

\begin{document}

\begin{tikzpicture}
  [every rectangle node/.style={draw},
   every ellipse node/.style={draw,double}]
  \draw (0,0) node[rectangle] {A} -- (2,0) node[rectangle] {C};
  \draw (1,1) node[ellipse] {Hello} -- (1,-1) node[ellipse] {Bye};
\end{tikzpicture}

\end{document}
Refer to the pgfmanual for further information (specially, section 14.3.5 Graphic Parameters: Double Lines and Bordered Lines).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Jones Jonsen
Posts: 2
Joined: Mon Nov 10, 2008 9:41 pm

Re: Tikz Nodestyle

Post by Jones Jonsen »

Thanks a lot, that's exactly what I was looking for :).
Post Reply