我使用此代码制作一个三角形箭头,并对三角形的大小做了一些更改,为什么它不能成功编译?
\documentclass[tikz,margin=1mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[line width=1mm]
\draw[green,arrows={-Triangle[minimum height=1.5mm]}]
(0,2) -- (1,2);
\end{tikzpicture}
\end{document}
答案1
minimum height
不是Triangle
箭头的有效键,并且包会通知此情况;您的代码会生成错误消息
! Package pgfkeys Error: I do not know the key 'minimum height', to which you p
assed '1.5mm', and I am going to ignore it. Perhaps you misspelled it.
也许您想要length
,,width
或者scale
?
\documentclass[tikz,margin=1mm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[line width=1mm]
\draw[green,arrows={-Triangle[length=0.5cm]}]
(0,1) -- (1,1);
\draw[green,arrows={-Triangle[width=1.5cm]}]
(0,-0.5) -- (1,-0.5);
\draw[green,arrows={-Triangle[scale=3]}]
(0,-2) -- (2,-2);
\end{tikzpicture}
\end{document}
三角形箭头的有效键可以在手册的第 211 页找到。