I am working with the Article-style.
How can I change globally the output of Print
command?
For example typing
x=3;
Print["x", x]
will produce the same output with
x = 3;
Print[Style["x=", Red], x]
without the need to specify the Style
.
Thanks.
EDIT 2
I apologize for the inconvenience. I thought that I could get what I want with a minimal example. I should have been more specific from the very beginning.
In reality I have my definitions (below is just a part).
ruls = {Nc0 -> 35.794, Nc1 -> 509.74, Ns0 -> 18.275,
Ns1 -> 27.971, β -> 0.8, m -> 0.0304, τ -> 1.4503,
zp0 -> 1000, zp1 -> 1,
α -> 5.3/10^3, χ -> 1., Tref -> 298.15,
C1 -> 45.685, C2 -> 245.06, η0 -> 0.2343,
Tinit -> 294.75, Δt -> 0.003};
elstrain = {0.00005, 0, 0, 0, 0, 0};
Δelstrain = {0.00005, 0, 0, 0, 0, 0};
Δstrain = {0.00005, 0, 0, 0, 0, 0};
equivStrainRate =
Sqrt[2/3 Δstrain.Δstrain]/\
Δt /. ruls;
aT[T_] := 10^(-C1 (T - Tref)/(C2 + (T - Tref)));
aTinit = aT[Tinit] /. ruls;
λ = aT[Tinit] equivStrainRate /. ruls;
η = η0 /. ruls;
DaTDT = D[aT[T], T] /. T -> Tinit /. ruls;
DλDT = DaTDT equivStrainRate;
Print[Style["Values of Quantities\n", Blue,
Bold], "equivStrainRate=", equivStrainRate, "\n", \
"equivStrainRateStar=", equivStrainRateStar, "\n", "aT=", aTinit, "\n\
", "\[Lambda]=", \[Lambda], "\n", "\[Eta]=", \[Eta], "\n", "DaTDT=", \
DaTDT, "\n", "D\[Lambda]DT=", D\[Lambda]DT]
I want the equivStrainRate=
, equivStrainRateStar=
, etc in above output to appear Red.
myPrint[name_, rest___]:=Print[Style[name<>"=", Red], rest]
like in 104839 $\endgroup$