# Defer parts of the expression

Is there a way to Defer only parts of the expression? For example, I have

a=1;


and then I want the expression to be shown asa = 1;by usingDefer[a = Evaluate[a]],But the actual output is just

a = Evaluate[a]]


Is there away to only Defer part of an expression?

-
Maybe Defer[a = x] /. x -> a or Defer[a = #] &[a]? –  kguler May 15 '14 at 19:15
or With[{x = a}, Defer[a = x]]? –  kguler May 15 '14 at 19:20
Both solution works, thank you! –  Yituo May 15 '14 at 19:24

## 1 Answer

You can insert into held expressions in a number of ways:

Using ReplaceAll (/.): Defer[a=x]/.x->a

Using function evaluation: Defer[a=#]&[a]

Using With : With[{x=a}, Defer[a=x]

Example:

a = 2; z = 4; w = 5;
{Defer[a + w = x + z] /. x->a, Defer[a + w = # + z]&[a], With[{x = a},Defer[a + w = x + z]]}
(* {a + w = 2 + z, a + w = 2 + z, a + w = 2 + z} *)

-