Q:

Tikz: Controlling edge start position from nodes with double border

Currently I am unable to get all the edges coming out of a node with a double border to start exactly on the outside of the outer border. The edges are all starting in between the two borders. For example this code doesn't look perfect.
\documentclass{article}

\usepackage{tikz}
\tikzstyle{double_border} = [draw, double, double distance=2pt]

\begin{document}

\begin{tikzpicture}
    \node[double_border] (a) at (0,0) {A};
    \node[double_border] (b) at (1,0) {B} edge (a);
\end{tikzpicture}

\end{document}

I want to be able to set every double_border node to have all outgoing and incoming edges start on the outside border. I know I can specify it as a property of the edge (I'd have to look up how) but I want to be able to have it apply to the node settings specifically (or globally would be okay also) because I am trying to extend a 'library' called tikz-er2 and I want it to apply to all nodes of a certain type without having to complicate the user's syntax.

A:

Please note that \tikzstyle is deprecated. One solution is to increase the outer sep.
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\tikzset{double_border/.style={draw, double, double distance=2pt,outer sep=1.2pt}}

\begin{document}

\begin{tikzpicture}
    \node[double_border] (a) at (0,0) {A};
    \node[double_border,circle] (b) at (1,0) {B} edge (a) ; 
    \node[double_border,diamond] (c) at (0.6,1) {C} edge (a) edge (b) ; 
\end{tikzpicture}

\end{document}

As usual with double, these double line are not truly double lines but a thicker line overpainted with a somewhat thinner line. So if you put these on top of some background, the background will be overpainted. If you do not want to do that, you can define, for specific node shapes, another version of the double_border style such that the node boundary is realistic.
\documentclass{article}

\usepackage{tikz}
\tikzset{double_border/.style={draw,inner sep=#1+2pt,
path picture={
\draw ([xshift=#1,yshift=#1]path picture bounding box.south west)
rectangle ([xshift=-#1,yshift=-#1]path picture bounding box.north east);}},
double_border/.default=2pt}

\begin{document}

\begin{tikzpicture}
    \node[double_border] (a) at (0,0) {A};
    \node[double_border] (b) at (1,0) {B} edge (a); 
    \node[double_border] (c) at (0.6,1) {C}  edge (a)  edge (b); 
\end{tikzpicture}
\end{document}

The downside of this method is that it has to be done one a shape-by-shape basis, and, as usual with path pictures, not all transformations may give good results.
Other than that you might shorten the edges with shorten > and shorten <, but this is a bit cumbersome. Yet another way is to draw the edges on the background layer.
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{backgrounds}
\tikzset{double_border/.style={draw, double, double distance=2pt}}

\begin{document}

\begin{tikzpicture}
    \node[double_border] (a) at (0,0) {A};
    \node[double_border] (b) at (1,0) {B}; 
    \node[double_border] (c) at (0.6,1) {C}; 
    \begin{scope}[on background layer]
    \path (b) edge (a)   edge (c) (a)  edge (c);
    \end{scope}
\end{tikzpicture}

\end{document}

This works because a double line is just a thick (black in this case) line overpainted by a somewhat thinner white line.

