
我基於矩形創建了以下形狀(它具有更多功能,但錯誤始終相同)。
\pgfdeclareshape{set}{
%Like in rectangle but without all the separators and height=width
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
\pgf@x=.5\pgf@xb%
\pgf@y=.5\pgf@xb%
}%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
\pgf@x=-.5\pgf@xb%
\pgf@y=-.5\pgf@xb%
}%
% Inherit from rectangle
\inheritanchorborder[from=rectangle]%
\inheritanchor[from=rectangle]{center}%
\inheritanchor[from=rectangle]{north}%
\inheritanchor[from=rectangle]{south}%
\inheritanchor[from=rectangle]{west}%
\inheritanchor[from=rectangle]{east}%
\inheritanchor[from=rectangle]{north west}%
\inheritanchor[from=rectangle]{north east}%
\inheritanchor[from=rectangle]{south west}%
\inheritanchor[from=rectangle]{south east}%
\backgroundpath{%
\pgfpathrectanglecorners{\southwest}{\northeast}%
}%
}%
大多數事情對我來說都很好。例如:
\node[set,draw, below right=10ex of n, rotate=270, anchor=center] (sA) {};
完美定位節點並旋轉它。與“左下”相同。
但如果我使用
\node[set,draw, above left=10ex of n, rotate=270, anchor=center] (sA) {};
我收到錯誤
包 PGF 數學錯誤:未知函數“北”(在“西北”中)。
「右上」也會發生同樣的情況。輸出看起來還是不錯的。
我正在使用新版本的tikz 3.0.0。
有什麼想法可以避免這個真正令人不安的錯誤嗎?
謝謝你!