Sign up ×
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.

How to pass a macro output \X{Tpeak} to \FPeval\Ypeak as shown in the following code?

    \pstVerb{/#2 \csname#2\endcsname\space def}%





share|improve this question

1 Answer 1

up vote 5 down vote accepted

The expression \X{Tpeak} needs to be expanded first, before passing to \const.


First \X is fully expanded, but not \const because of \noexpand. Then \next contains:

\const {Ypeak}{Vinit*cos(Theta)*Tpeak}

Macro \next is only temporarily used. Therefore a typical pattern is to put this in a group:


Then a previously defined \next remains unchanged afterwards and \const is still called outside the group.

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.