TikZ is great at drawing diagrams but there is one feature which I find quite annoying and that's the fact that the default arrowhead provided by TikZ does not necessarily respect the math mode in whichever font you are using. I know that
the TikZ library arrows
lets you chose between several different types of arrowheads but none of which offers the same arrowhead as the one drawn in math mode.
When drawing a diagram in TikZ I want the arrowheads to match arrowheads drawn by commands like \to
or \xrightarrow{foo}
.
Does anyone know how to fix this?
As suggested by Andrew Stacey in the comments below, I should really provide you with an example of what I am talking about.
Using the following code:
An arrow tip produced by TikZ:
\begin{tikzpicture}
\node (A) at (0,0){$A$};
\node (B) at (1,0){$B$.};
\path (A) edge[->] node[midway,above]{$f$} (B);
\end{tikzpicture}
An arrow tip produced by \texttt{amsmath}: $A \xrightarrow{f} B$.
I get the following output:
I want these two arrowheads to be identical.
to
arrow tip? (See Section 15.3.4 of the manual.) If not, could you post code and a screenshot showing the arrow that you'd like (and, for comparison, what TikZ produces with theto
tip.) – Andrew Stacey Dec 6 '11 at 18:25>=to
the default arrow tip? In any case it doesn't produce the desired result. Thanks for the tip (no pun) on including examples. They will be posted shortly. – Marius Dec 6 '11 at 18:30\xrightarrow{foo}
depends of the font used, you can try withfourier
and withlmodern
and see the difference. A good question is : "how to draw arrows in math text like arrows used in tikz" ? Your problem is very complex because you need to create your personal arrow that depends of your font ! – Alain Matthes Dec 6 '11 at 18:42\to
so that it draws a TikZ arrow. Though, if you have many arrows, this might seriously impact compilation speed. – Caramdir Dec 7 '11 at 0:12\tikz \draw[->] (0,0) -- +(1,0);
s around doesn't affect the speed that much. – Andrew Stacey Dec 7 '11 at 8:29