Graphics, Figures & TablesArrow Head Size

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Arrow Head Size

Post by MatthiasN »

Hi everyone,

I'm having a problem in changing the size of the arrow heads in tikZ. I've found different solutions online, but none of those seem to work for me. The only related packages I use are tikz and from the libraries arrows. An example of what I'm trying to do is this.

Code: Select all

\begin{tikzpicture}
\draw [->,'change arrow size'] (0,0) -- (1,1)
\end{tikzpicture}
I've read posts in which they suggest to use arrowhead=size, but that doesn't seem to work for me. In other posts the command \arrow[options] is used, but it seems to me that this is not applicable to what I'm trying to do (unless I misunderstood the way it is used).

I hope someone can solve this, it would be of huge help to me.


Matthias

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Arrow Head Size

Post by localghost »

Build a self-contained and minimal example. Otherwise this thread ends up in guesswork and random shots.
MatthiasN wrote:[…] I've read posts in which they suggest to use arrowhead=size, but that doesn't seem to work for me. In other posts the command \arrow[options] is used, but it seems to me that this is not applicable to what I'm trying to do (unless I misunderstood the way it is used). […]
Links to these posts would be very helpful.


Thorsten
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Arrow Head Size

Post by MatthiasN »

I will try to improve my example, but I don't really understand what more you need... Say I would draw an arrow with tikz, it would for example look like:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
\draw [->] (0,0)--(1,1)
\end{document}
What I am looking for is a way to enlarge the arrow head for example by adding an option between brackets. Without the preamble it would then look like:

Code: Select all

\begin{document}
\draw [->,arrowheadsize=number] (0,0)--(1,1)
\end{document}
Is this example sufficient?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Arrow Head Size

Post by localghost »

MatthiasN wrote:I will try to improve my example, but I don't really understand what more you need. […]
You would understand if you'd just follow the link in my last reply and read the instructions.
MatthiasN wrote:[…] Is this example sufficient? […]
Your example doesn't work. Please check your examples always for functionality and minimal content. Otherwise this is a waste of time (for you and for others).
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Arrow Head Size

Post by MatthiasN »

I see what you mean. I forgot the environment for the tikz drawing and the semicolon:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
\begin{tikzpicture}
\draw [->] (0,0)--(1,1);
\end{tikzpicture}
\end{document}
and

Code: Select all

\begin{document}
\begin{tikzpicture}
\draw [->,arrowheadsize=number] (0,0)--(1,1);
\end{tikzpicture}
\end{document}
I've read your link to the minimal example (in your signature, because the other one didn't work) ad I had read it before. But I don't see what else is missing in this example... If there is something still missing, could you please just tell me what it is? Thank you.
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Arrow Head Size

Post by svend_tveskaeg »

The example is as close to minimal as possible without it actually being minimal; there is no need for specifying the font and paper size ([12pt,a4paper]).

The following is a MWE:

Code: Select all

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
\begin{tikzpicture}
\draw [->] (0,0)--(1,1);
\end{tikzpicture}
\end{document}
Last edited by svend_tveskaeg on Wed Feb 13, 2013 1:03 pm, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Arrow Head Size

Post by localghost »

svend_tveskaeg wrote:The example is as close to minimal as possible without it actually being minimal; there is no need for specifying the paper and font size ([12pt,a4paper]). […]
We shouldn't quibble too much about that. The specification of font and paper size is OK.
MatthiasN wrote:I see what you mean. I forgot the environment for the tikz drawing and the semicolon: […]
The example is OK. But you talked about some commands and options in your initial post.
MatthiasN wrote:[…] I've read posts in which they suggest to use arrowhead=size, but that doesn't seem to work for me. In other posts the command \arrow[options] is used, but it seems to me that this is not applicable to what I'm trying to do (unless I misunderstood the way it is used).[…]
Unfortunately you didn't yet give the links to those posts as requested earlier (by me). That would be very helpful information.
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Arrow Head Size

Post by MatthiasN »

I didn't gave you the links, because I had been searching the internet for almost an hour. I've looked it up again and you can find what I read about the arrowhead command here.

The \arrow command is a command someone defined himself. But since it basically comes back to commands that are already present in tikZ and TeX I wondered if there aren't more basic solutions. I always try to avoid using unnecessary packages or writing new commands.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Arrow Head Size

Post by localghost »

MatthiasN wrote:[…] The \arrow command is a command someone defined himself. But since it basically comes back to commands that are already present in tikZ and TeX I wondered if there aren't more basic solutions. I always try to avoid using unnecessary packages or writing new commands.
Perhaps you should also read the remarks of those who answered and possibly study the corresponding manual. The \arrow command is not defined by the user but comes from the decorations.markings library. It is explained in Section 30.5 of the PGF/tikZ user guide. The introduced arrow head option is experimental and for the present is only part of the development version.
MatthiasN
Posts: 41
Joined: Sun Mar 11, 2012 1:21 pm

Arrow Head Size

Post by MatthiasN »

Thanks, I've figured it out now. My solution looks like this:

Code: Select all

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}
  \begin{tikzpicture}[
    decoration={
      markings,
      mark=at position 1 with {\arrow[scale=4,black]{latex}};
    }
  ]
    \draw [postaction={decorate}] (0,0) -- (1,1);
  \end{tikzpicture}
\end{document}
Thanks for helping.
Matthias
Post Reply