# Using predefined command or coordinate with \draw bend right

I ran into this problem when using draw with a predefined command. Any idea how to fix? Here's a minimal (not) working example:

\documentclass{article}
\usepackage{tikz}

\newcommand{\Ve}{(1,1)}
\begin{document}
\begin{tikzpicture}
\draw (1,0) to[bend right] (1,1) ; %works
\draw   \Ve to[bend right] (1,0) ; %works
\draw (1,0) to[bend right] \Ve ;   %doesn't work
\end{tikzpicture}
\end{document}


The error produced:

Latex Error: ./untitled.tex:9 Package tikz Error: (, +, coordinate, pic, or node expected. Latex Error: ./untitled.tex:9 Package pgf Error: No shape named is known.

• You could use coordinate like this: \begin{tikzpicture} \coordinate (VE) at (1,1); \draw (1,0) to[bend right] (1,1) ; \draw (VE) to[bend right] (1,0) ; \draw (1,0) to[bend right] (VE) ; \end{tikzpicture} – Bobyandbob Jun 29 '17 at 18:55
• @Bobyandbob that answers my question as far as I'm concerned – Bjørn Kjos-Hanssen Jun 29 '17 at 19:08
• @BjørnKjos-Hanssen Although the coordinate way is the cleanest and preferred way, you may be interested in that defining \Ve without parenthesis; that is, \newcommand{\Ve}{1,1}; and then using (\Ve) instead of \Ve, also works. – JLDiaz Jun 29 '17 at 19:31
• The first one will work with \expandafter\draw \Ve but the second would be more complex and this approach is not to be recommended. – cfr Jun 29 '17 at 22:59

You need parentheses. With \draw the path, which is specified with for example two points should be drawn. The coordinates of the start and end positions are specified as points in round brackets. [See: 2.3 Straight Path Construction,p.31]

Definition: point position

• in cm: (1,0) and (1,1)

The positions are specified within a special coordinate system in which, initially, one unit is 1cm. [See 2.2.1 Setting up the Environment in LATEX p.29-30]

• in pt: (1pt,0pt) and (1pt,1pt) -> The positions are specified within a special coordinate system with unitpt.
• in polar coordinates: (0:1) and (45:{sqrt(2)})-> polar coordinates: 1 respectively sqrt(2) (as radius) in direction 0 respectively 45 degree (angle). To calculate {sqrt(2)} (to get the correct radius) you need \usetikzlibrary{calc}.See 2.15 Specifying Coordinates,p37ff.

But i prefer and recommend:

• with coordinates: (A) and (B) -> Defining two coordinates (name: A, B) using the \coordinate command. For example \coordinate (A) at (1,0); and \coordinate (B) at (1,1);

Solution:

MWE:

\documentclass{article}
\usepackage{tikz}
%\usetikzlibrary{calc}
%\newcommand{\Ve}{1,1}
\begin{document}
\begin{tikzpicture}
\coordinate (VE) at (1,1);
%\coordinate (VE) at (45:{sqrt(2)});
\draw (1,0) to[bend right] (1,1);
\draw   (VE) to[bend right] (1,0);
\draw (1,0) to[bend right] (VE) ;
\end{tikzpicture}
%    \begin{tikzpicture}
%        \draw (1,0) to[bend right] (1,1);
%        \draw (\Ve) to[bend right] (1,0);
%        \draw (1,0) to[bend right] (\Ve) ;
%    \end{tikzpicture}
\end{document}