Here is three methods that works:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\draw[red,
decoration={markings,mark=at position 1 with {\arrow[scale=4,blue]{>}}},
postaction={decorate},
shorten >=0.4pt
]
(0,1.0) -- (2,1.0);
\draw[draw=red,-triangle 90,fill=blue] (0,0.5) -- (2,0.5);
\draw[red] (0,0) -- (2,0);
\draw [-to,shorten >=-1pt,gray,ultra thick] (1.99,0) -- (2,0);
\end{tikzpicture}
\end{document}
I think the first method presented here is probably the way to go but perhaps more elegant solutions will be presented by other.
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:
\draw (<coord1>) -- node[below] {<text>} (<coord2>);
I also fixed the dashed arrows using the perpendicular coordinate system to guarantee that they are horizontal.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings}
\begin{document}
\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},
decoration={
markings,
mark= at position 0.5 with {\node[font=\footnotesize] {/};}
}
]
\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,postaction={decorate}] (delta.58.75) -- node[below=1pt] {\tiny 4} (ah.west|-delta.58.75);
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.-58.75) -- node[below=1pt] {\tiny 4} (al.west|-delta.-58.75);
\end{tikzpicture}
\end{document}
As suggested by percusse, another, perhaps better way, to use the perpendicular coordinate system to have the arrows horizontal is to use:
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.east|-ah) -- node[below=1pt] {\tiny 4} (ah);
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.east|-al) -- node[below=1pt] {\tiny 4} (al);
Best Answer
One possibility is the
\curvearrowbotleft
mentioned by Qrrbrbirlbel along with theaccents
package:Here is a version with more visible arrow heads and less overlap with adjacent arrows, at the cost of more complication and a somewhat goofy-looking arrow head.
The command must be used in math mode (since
\underaccent
is math-only), but has $ inside since\resizebox
leaves math mode.Edit: Originally, I had
\widthof{0}
in the above definition. This allowed the arrows to fit different font sizes and fonts, like so: This depends on the fact that all digits are the same width, which is true in most math fonts but not all. I realized that simply changing it to\widthof{#1}
would not only take care of the case of different-width digits, but allow putting arrows under more than one digit. For instance,$\uarr{00}$. $\uarr{007}$.
would have originally given , but now gives