I'm trying to draw arrows with / marks and numbers like in the following picture:
My current solution looks like this:
\begin{tikzpicture}
[
inverter/.style={rectangle,draw,inner sep=2pt,minimum size=6mm},
dot/.style={circle,inner sep=0pt,minimum size=0.5mm,draw,fill=black}
]
\node (x) at (0,0) {$x$};
\node (delta) at (1,0) [shape=rectangle,draw,minimum height=18mm,minimum width=6mm] {$\delta$};
\node(ah) at ( 2, 0.5) [inverter] {$a_h$};
\node(al) at ( 2, -0.5) [inverter] {$a_l$};
\draw [->] (x) -- (delta);
\draw [->,dashed,dash pattern=on 1pt off 1pt] (delta.58.75) -- (ah);
\node at ($ (ah) - (0.55, 0) $) {\scriptsize /};
\node at ($ (ah) - (0.5, 0.2) $) {\tiny 4};
\draw [->,dashed,dash pattern=on 1pt off 1pt] (delta.-58.75) -- (al);
\node at ($ (al) - (0.55, 0) $) {\scriptsize /};
\node at ($ (al) - (0.5, 0.2) $) {\tiny 4};
\end{tikzpicture}
which is pretty hacky and doesn't look nice. I tried strike out shapes but found the line to be much too long. However, positioning a / and a number manually seems like a pretty bad solution to me. I've seen a similar question that revolved around striking out lines or arrows, but without any numbering. Any input would be most welcome.
Best Answer
As percusse mentions in his comment, adding the slash can be done using a decoration (in this case, using the
decorations.markings
library); the number (if it's not part of the decoration) can be added in the path, using a node; something like:I also fixed the dashed arrows using the perpendicular coordinate system to guarantee that they are horizontal.
As suggested by percusse, another, perhaps better way, to use the perpendicular coordinate system to have the arrows horizontal is to use: