I want to use parentheses in coordinate calculation in tikz. There should be a simple way, but I couldn't find it. For example,

\draw (0,0) -- (1+1/\x,0);

this works fine. But,

\draw (0,0) -- (1+1/{\x+1},0);

this doesn't work. Other parentheses didn't work either. What is the expression for parentheses?


If your expression contains parentheses or commas, you may use {} around the whole expression:


  \draw (0,0) -- (1+1/\x,0);
  \draw (0,0) -- ({1+1/(\x+1)},0);
  • 3
    Why "you may" ? After experimenting with some Tikz calculation, I'd rather say "you must". – kebs Dec 27 '17 at 15:09
  • 3
    @kebs Another solution: you may use \pgfmathsetmacro\mytemp{1+1/(\x+1)}; \draw (0,0) -- (\mytemp,0);. Or use a let operation... – Paul Gaborit Dec 28 '17 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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