Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

1 Answer 1

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.