# TikZ: variable in calc syntax

I'd like to draw some lines where one of points should be defined like:

($(A)! \X3 !(B)$)


where \X3 is something from (0,1). But it's not working. Yeah, I could just place the right number, but I'd like use this construction (or quite similar) on several places of this figure and I'd like to make several figures with different \X3.

Any possible way how to set variable into  in TikZ?

-
you might not want to use numbers in your macros ;) –  percusse Nov 7 '12 at 20:07

The proposed syntax works fine. I think the problem is that you have a number in the macro name.

## Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
\coordinate (A) at (1,0);
\coordinate (B) at (1,2);

\newcommand*{\X}{0.3}%
\draw [ultra thick, blue, ->] (0,0) -- ($(A)!\X!(B)$);
\end{tikzpicture}
\end{document}

-
Thanks a lot, that was defenetly the problem. Now's working. –  Doxxik Nov 7 '12 at 21:41