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



\noindent tmpa: \tmpa \\
tmpb: \tmpb \\
tmpc: \tmpc \\
tmpa: \tmpa \\
tmpb: \tmpb \\
tmpc: \tmpc 



tmpa: tmpc1

tmpb: tmpc1

tmpc: tmpc1

tmpa: tmpc2

tmpb: tmpc2

tmpc: tmpc2

Changing the value of tmpc changes the values of the other two variables. How can I assign only the value of tmpc without this pointer like effect?

share|improve this question
Replace \renewcommand{\tmpa}{\tmpc} \renewcommand{\tmpb}{\tmpc} by \let\tmpa\tmpc \let\tmpb\tmpc. And take a look at "TeX by Topic" (texdoc texbytopic) – Axel Sommerfeldt Apr 16 '12 at 6:59
It is difficult to understand why you use \tmpc in \tmpa and \tmpb if you do not want this `pointer effect'. Just define another command ?! You should provide more context so that one can think of a workaround. Right now, your problem appears rather unclear to me. – Alfred M. Apr 16 '12 at 7:03
up vote 7 down vote accepted

When TeX finds a macro it expands it to its current meaning; so with



when \tmpa is found, it's replaced first by \tmpc and then by tmpc1 (which is what \tmpc is defined to expand to).

If you want to freeze the meaning, then \let is the instruction to use:


will assign to \tmpa the current meaning of \tmpx and subsequent changes to the latter command will not influence the meaning of \tmpa.

There's no "LaTeX interface" to \let, because such commands are intended to be used by "programmers" rather than "users".

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.