a := az + 1
b := bz + 5
list := {a, b}
I'd like mathematica to print
a = az + 1
b = bz + 5
so basically it needs to first print the name of the variable in the list, followed by "=", and followed by the actual content of the variable.
update (1):
so here is something close to what I want
a := az + 1
b := bz + 5
list := {Hold@a, Hold@b}
Column[Table[Print[list[[i]], "=", ReleaseHold@list[[i]]], {i, 1, 2}]]
outputs:
Hold[a]=1+az
Hold[b]=5+bz
However, I don't know how to get rid of Hold[]
. I'm also hoping there is a more elegant way.
HoldForm
works likeHold
except that it isn't printed. Therefore I guess replacingHold
withHoldForm
should satisfy your needs. $\endgroup$