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

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
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.