\pgflinewidth 作为 arrows.meta 箭头中的选项

\pgflinewidth 作为 arrows.meta 箭头中的选项

我尝试使用˙\pgflinewidth`来定义箭头的大小:

\documentclass[tikz,margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, calc}

\begin{document}
    \begin{tikzpicture}
\draw (0cm,0cm) grid ($(2cm,3cm)-(\pgflinewidth,\pgflinewidth)$);       % this works

\draw[very thick, -{Triangle[length=3\pgflinewidth]}] (0,0) -- (2,3);   % this doesn't work!
    \end{tikzpicture}
\end{document}

错误:! Missing \endcsname inserted.

我的尝试有什么问题?

答案1

尝试:

Triangle[length=3*\the\pgflinewidth]

平均能量损失

\documentclass[tikz,margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, calc}
\begin{document}
    \begin{tikzpicture}
\draw (0cm,0cm) grid ($(2cm,3cm)-(\pgflinewidth,\pgflinewidth)$);       % this works

\draw[very thick, -{Triangle[length=3*\the\pgflinewidth]}] (0,0) -- (2,3);   % this doesn't work!
    \end{tikzpicture}
\end{document}

在此处输入图片描述

编辑

使用以下行也可以获得相同的输出:

\draw[very thick, -{Triangle[length=0pt 3]}] (0,0) -- (2,3); 

相关内容