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

It is possible to change the x distance within TikZ internal coordinate system by passing the /tikz/x= key to the tikzpicture environment.

% Picture code

I need to get the value stored inside this key within a picture to perform some calculations. Is it possible to do so ? What I'm looking for is something like this...

 % Some command to get the x value and store it in a macro for example /myx

 %\pgfkeysvalueof{/tikz/x} or \pgfkeys{/tikz/x/.get=\myx} don't seem to work

 % Use the \myx in calculations
share|improve this question

Unfortunately the value isn't stored inside the key, as it is parsed immediately (the argument to the |x| key can be a coordinate) and then passed on to \pgfsetxvec.

But there are still a couple of ways to get the x-component of the coordinate system.

\node {$x_1$: \x, $x_2$: \the\pgf@xx};

enter image description here

share|improve this answer

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.