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.

I know that I need to put an internal quantity after \the. I know the expansion is a list of tokens of catcode 12 (except for space characters). I know the next problem :

\skip0=30pt plus 2pt\relax
a\hskip\the\skip0 minus 1pt b 
a\hskip\skip0 b  
a\hskip\skip0 minus 1pt b

but in the sources of pgf/tikz, I see for example

\def\pgfgetlastxy#1#2{%
    \edef#1{\the\pgf@x}%
    \edef#2{\the\pgf@y}%
}%

\pgf@x is often preceded by \the. Why is the necessary in such cases? Do you know an example with a problem ?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

The \pgf@x and \pgf@y registers are temporary ones which are changed frequently. Using \the inside \edef stores the current value of them as string into a normal macro, so that value(s) can still be used elsewhere after the registers are already changed again.

Simply using \def#1{\pgf@x} would make the macro given as #1 a synonym for \pgf@x which would not give you any benefits.

share|improve this answer

Your Answer

 
discard

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.