I am a beginner with LaTex and not comfortable enough to switch over just yet. At the moment I mainly use the smartdiagram
package to easily produce high-quality flow diagrams for various documents and presentations.
For this use case I created a number of templates. Here are two examples based on them.
This one works:
\documentclass{article}
\usepackage{tikz} % smartdiagram base package
\usepackage{smartdiagram} % used for generating diagrams
\usetikzlibrary{arrows} % additional arrows
\begin{document}
\smartdiagramset{
% ARROWS
arrow tip={stealth},
}
\smartdiagram[flow diagram:horizontal]{ % set orientation (horizontal/vertical)
A,B,C,D
}
\end{document}
This one doesn't:
\documentclass{article}
\usepackage{tikz} % smartdiagram base package
\usepackage{smartdiagram} % used for generating diagrams
\usetikzlibrary{arrows} % additional arrows
\begin{document}
\smartdiagramset{
% ARROWS
arrow tip={|-|},
}
\smartdiagram[flow diagram:horizontal]{ % set orientation (horizontal/vertical)
A,B,C,D
}
\end{document}
As you can see I am struggling with the arrow library. If I set smartdiagram's arrow tip
parameter to a bracket-like TikZ arrow, LaTex returns the following error message:
flow_diagram.tex.swp:119: Package pgf Error: Arrow
end type ``[-]'' unknown.
See the pgf package documentation for explanation.
I took this arrow definition from TikZ' manual (p. 257), where a number of bracket-like arrow tips and their respective names are listed.
Any other arrow tip type I can render with this template without any problems, it's only these bracket-type arrows I struggle with.
Can you please tell me, if I am doing something wrong?
Best Answer
pgf
doesn't know the arrow tip[-]
. This is two arrow tips together. You can use\draw[{[-]}](0,0)--(1,0);
or\draw[<->,arrows={[-]}] (a)--(b);
if you loaded\usetikzlibrary{arrows}
before.If this happens only with the
[-]
arrow tips, it might be in bug insmartdiagram
due to not dealing properly with the brackets (they need always be enclosed in{}
.