1

I'm trying to make a diagram in tikz-cd with an arrow of the open triangle form (in stmaryrd it would be \rightarrowtriangle).

If I write something like A\arrow[rightarrowtriangle]{r}{e} &B I get an error. How can I change the arrow type in tikz-cd?

  • Welcome to TeX.SX! Please provide us with a minimal compilable example showing what you've got so far to help us help you. – TeXnician Mar 20 '18 at 11:37
3

Try \arrow[r,-{Triangle[open]}. Here Triangle[open] is an arrow tip from the arrows.meta library, which tikz-cd loads for you. (See documentation in the manual for pgf/TikZ, section 16.5.) Note this uses the usual TikZ syntax of a hyphen (-) followed by an arrow tip. The curly braces are required due the the brackets giving the open option to Triangle.

If you want to set the default arrow tip for all diagrams, or for a specific diagram, use the technique described in section 2.2 of the tikz-cd manual, shown below.

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[r,-{Triangle[open]}] & B
\end{tikzcd}

\begin{tikzcd}[ % set default options for this diagram
  arrow style=tikz, % use tips from arrows.meta
  >={Triangle[open]} % set default arrow tip
]
A \arrow[r] & B
\end{tikzcd}

% use \tikzcdset to define setting for all following tikzcd-diagrams
\tikzcdset{
  arrow style=tikz,
  >={Triangle[open]}
}
\begin{tikzcd}
A \arrow[r] & B
\end{tikzcd}
\end{document}

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.