3

I want all arrows in a TikZ drawing to have a larger tip, so I change the arrows setting in the \tikz options. This works fine for manually created drawings, but doesn't work when generating graphs with one of the layouts from the graphdrawing library.

Changing settings for \draw doesn't work either, while adding them to edge did work for some other options, but not for arrow scaling. (It seems like it can't handle the nested braces.) I assume graphdrawing has to explicitly overwrite arrow styles in order to do its magic, but how am I to supposed to customize things?

Minimal example

\documentclass{standalone}

\usepackage[T1]{fontenc}
\usepackage[utf8]{luainputenc}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{graphdrawing}
\usegdlibrary{circular}

\begin{document}

\tikz[simple necklace layout, nodes={draw, circle}, node distance=5cm,
      arrows={-Stealth[scale=2]}] {
    \node (1) {Node 1};
    \node (2) {Node 2};

    \draw (1) edge (2);
}

\end{document}

Actual (unexpected) result

2

You could use >={Stealth[scale=2] as an option of the tikz command together with edge[->]:

\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{graphdrawing}
\usegdlibrary{circular}

\begin{document}
\tikz[simple necklace layout, nodes={draw, circle}, node distance=5cm,
  >={Stealth[scale=2]}
]{
  \node (1) {Node 1};
  \node (2) {Node 2};
  \draw (1) edge[->] (2);
}
\end{document}

Result:

enter image description here

Or you can load the tikzlibrary graphs and use the \graph command:

\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{graphs}
\usetikzlibrary{graphdrawing}
\usegdlibrary{circular}

\begin{document}
\tikz[simple necklace layout, nodes={draw, circle}, node distance=5cm,
  >={Stealth[scale=2]}
]{
  \node (1) {Node 1};
  \node (2) {Node 2};
  \graph {
    (1) -> (2);
  };
}
\end{document}
  • Your first solution mostly matches my requirements, I'll go with it. – F30 May 7 '15 at 8:13

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.