Here is an idea that might answer both your questions. It uses yshift
to move the start and end points of the two paths up/down by 5pt
. The result could be further improved by shifting the start/end points along the x axis in order for the paths to really be in contact with the nodes' circles.
A custom TikZ style is used to add a strike-through marking at the middle of the second path. This could be parameterized further to allow moving the marking to any position on the path etc.
I cannot tell whether this is the most elegant solution though.
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.markings}
\tikzset{
strike through/.style={
postaction=decorate,
decoration={
markings,
mark=at position 0.5 with {
\draw[-] (-5pt,-5pt) -- (5pt, 5pt);
}
}
}
}
\begin{document}
\begin{tikzpicture}
\node[draw,circle] (foo) at (0,0) { foo };
\node[draw,circle] (bar) at (4,0) { bar };
\draw[>=latex,->] ([yshift= 5pt] foo.east) -- ([yshift= 5pt] bar.west);
\draw[>=latex,<-,strike through] ([yshift=-5pt] foo.east) -- ([yshift=-5pt] bar.west);
\end{tikzpicture}
\end{document}
Here is how it looks like:

Add anchor=base
to your nodes:

\documentclass[varwidth]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand*{\ident}[1]{\texttt{\small #1}}
\tikzstyle{refines} = [->, >=open triangle 45]
\newcommand{\refi}[3]{$\begin{tikzpicture}[baseline]%
\node[anchor=base] (A) {#1};%
\node[anchor=base] (B) [right of=A, node distance=4em] {#3};%
\draw[refines] (A) -- node[midway,above=-2pt] {#2} (B);%
\end{tikzpicture}$}
\begin{document}
this is a test \refi{\ident{1}}{\scriptsize text}{\ident{2}}\ident{2} that continues here
this is a test \refi{1}{\scriptsize text}{1}\ident{2} that continues here
\end{document}
This ensures that the baseline of the text in the node sits at level 0
.
However, there are two problems: firstly, as @rainer says, depth and height of material in the nodes can make the arrow stop being horizontal; secondly, your code does nothing in the direction of providing an exensible arrow that stretches with the material above the arrow.
The first problem could be used by using the nice tikz-cd
package, see e.g. https://tex.stackexchange.com/a/113449/15925. But that won't solve the second one. So I think it is easier let tikz
take care of only the arrow and the text above it, and leave the rest to ordinary maths placement:

\documentclass{article}
\usepackage{tikz,mathtools}
\usetikzlibrary{arrows}
\newcommand*{\ident}[1]{\texttt{\small #1}}
\tikzstyle{refines} = [->, >=open triangle 45]
\newsavebox{\mytempbox}
\newcommand{\refi}[3]{%
\sbox{\mytempbox}{\hbox{\( \scriptstyle\mkern5mu#2\mkern17mu \)}}
\( #1
\tikz[baseline=-0.5ex]{\draw[refines] (0,0) --
node[midway,above=-0.3ex]{\usebox\mytempbox} (\wd\mytempbox,0);}
#3 \)}
\begin{document}
This is a test \refi{\ident{1}}{\text{text}}{\ident{2}}\ident{2} that continues here.
This is a test \refi{1}{\text{longer text}}{1} that continues here.
A further test \refi{j_2}{\alpha-x e^{p/q}}{a^2} with more text.
\end{document}
The technique here is to save the material to place above the arrow in a box (I written this assuming it is math mode material). That box is then used to specify the length of the arrow and its contents are placed above the arrow. I have added sufficient space around the text so that overlap with the rather large arrow head does not occur.
Best Answer
See the Section 74 (also 23) of PGF documentation (mine is version 2.10) to obtain a lot of arrow tips.
Just put on preamble
and then you can use
\draw[twotriang-twotriang] (0,0) -- (2,0);
Here is the output.
Here is a part of the documentation