TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
you might not want to use numbers in your macros ;) – percusse Nov 7 '12 at 20:07
up vote 4 down vote accepted

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




\coordinate (A) at (1,0);
\coordinate (B) at (1,2);

\draw [ultra thick, blue, ->] (0,0) -- ($(A)!\X!(B)$);
share|improve this answer
Thanks a lot, that was defenetly the problem. Now's working. – Doxxik Nov 7 '12 at 21:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.