17

I would like to make the width of an arrowhead larger. Is there a simple way to do this without defining a new arrowhead type? For instance, I would like to be able to write something like \draw[->,arrow head width=20pt].

To see what I have in mind, and why, consider the following:

\documentclass{amsart}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[->,line width=1pt] (0,0) to (1,0);
\end{tikzpicture}
\scalebox{.01}{
\begin{tikzpicture}
\draw[->,line width=100pt] (0,0) to (100,0);
\end{tikzpicture}
}
\end{document}

enter image description here

I would like to be able to adjust the second picture so that it looks identical to the first picture. There are a number of elegant answers on other questions regarding ways of making arrowheads scale nicely and whatnot, but as you can see, I want more or less the opposite --- a solution that doesn't respond/adjust on its own, so I can tweak the size of the arrow manually.

(As for why I am using a scalebox here, it has to do with tikz's inability to do floating point calculations, cf Avoiding `Dimension too large' and `ill-formatted floating point' errors in tikz)

  • with arrows.meta tikz library in recent CVS of TikZ you can find a way (arrow keys), how to define width and length of arrows and many other functions. – Zarko Dec 19 '13 at 18:41
  • @Zarko If I knew the meta arrow code for the standard arrow tip (ie the one obtained by \draw[->]) and how to modify it to change the width, that might do the trick, but I don't find the standard arrow tip code listed in (chapter 74 of) the pgfmanual. – Chris Dec 19 '13 at 20:10
  • The intention of arrows.meta is to replace old (standard) arrows library. So, better is put effort to it than to old arrows library, especially, if you have no standard request about it. – Zarko May 28 '15 at 9:04
23

Use the TikZ library arrows.meta and then you can scale the arrow heads as you wish. Here are a few examples.

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}

\begin{tikzpicture}
\draw[->,line width=4pt] (0,0) to (1,0);
\end{tikzpicture}

\begin{tikzpicture}
\draw[-{>[scale=2.5,
          length=2,
          width=3]},line width=0.4pt] (0,0) to (1,0);


\draw[-{>[scale=2.5,
          length=2,
          width=6]},line width=0.4pt] (0,-1) to (1,-1);


\draw[-{>[scale=2.5,
          length=6,
          width=3]},line width=0.4pt] (2,0) to (3,0);
\end{tikzpicture}

\end{document}

enter image description here

1

Using the "bad to" code from meta arrow tips, with the various coefficients (-3, 4, -2.75, 2.5, etc) scaled appropriately, appears to do the trick.

Sometimes bad is good.

(This doesn't answer the question of whether there is an option to modify the standard arrow command, without defining a new arrow tip, but perhaps the answer to that is simply `no'.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.