4

I can change the default arrow head via \tikzset{>=Latex}. However, it is not a given that the combination of an arrow head and its reverse looks good, so I would like to also change <> to something custom.

I have, on a hunch, tried \tikzset{<>={Diamond[scale=1.2]}} but that doesn't seem like the right syntax. Is there a way to set a default arrow head for <> endings?

8

You can define the <> arrow tip via the .tip handler (cf. section 16.4.4 "Defining Shorthands", pgfmanual):

\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
  \tikzset{
    >={Latex[]},
    <>/.tip={Diamond[scale=1.2]},
  }
  \draw[dashed,->] (0,0) -- (5,0);
  \draw[-<>] (0,2) -- (5,2);
\end{tikzpicture}
\end{document}

enter image description here

0

You should create a style with tikzset
myarr

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
    \begin{tikzpicture}
        \tikzset{myarr/.style={{Diamond[scale=1.2]}-{Diamond[scale=1.2]}}}
        \draw[myarr] (0,0) -- (1,1);
    \end{tikzpicture}
\end{document}
1
  • 1
    Right, but I'd like to use the intuitive <> syntax, i.e. I'd still like to write \draw[<>-<>] ....
    – Cactus
    Jun 6 at 7:21

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.