Dear fellow LaTeX/TikZ users. I'm clearly misunderstanding something about how TikZ handles coordinate definitions. I am trying to draw a Bezier curve between prededfined points, but TikZ complains as soon as the target point is a defined coordinate (here (B)
) instead of a literal coordinate (here (10,10)
) the compile fails with the following error:
! Package PGF Math Error: Unknown function `up' (in 'up').
See the PGF Math package documentation for explanation.
Type H <return> for immediate help.
...
l.16 \draw (A) to [out=down,in=up] (B)
;
?
I tried to google this but can't seem to find this specific error. What am I doing wrong?
Here is a minimal working example:
\documentclass[]{article}
\usepackage{tikz}
% EDIT: This is for workaround
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,1);
\coordinate (B) at (10,10);
% This will work
\draw (0,1) to [out=down,in=up] (10,10);
% So will this
\draw (A) to [out=down,in=up] (10,10);
% And this
\draw (A) -- (B);
% But these wont
% \draw (A) to [out=down,in=up] (B);
% \draw (0,1) to [out=down,in=up] (B);
% EDIT: Added the following workaround:
\draw ($(A)$) to [out=down,in=up] ($(B)$);
\end{tikzpicture}
\end{document}
EDIT
I found a workaround, but it made me even more confused. Using \tikzlibrary{calc}
and replacing (B)
with ($(B)$)
removes the problem, but I don't understand why. The ($...$)
enviroment for calc
allows calculations for points, but how/why is ($(B)$)
different from (B)
?