change the output of Print command in Article style

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.

=================

  

 

Ok! I will redit it.
– dimitris
Jan 26 at 13:54

  

 

Thanks. What Article style has to do with the problem?
– Kuba
Jan 26 at 13:59

  

 

@Kuba: I wanted to clarify the I don’t use the Default style. I am not sure if this affects really the question.
– dimitris
Jan 26 at 14:01

  

 

So you want to confine it to a single stylesheet?
– JasonB
Jan 26 at 14:01

1

 

So why not creating myPrint[name_, rest___]:=Print[Style[name<>“=”, Red], rest] like in 104839
– Kuba
Jan 26 at 14:04

=================

2 Answers
2

=================

myPrint[lbl_, x__] := Print@Grid[
Join[{{Style[lbl, Blue], SpanFromLeft}},
Partition[Riffle[{x}, “=”, {2, -2, 3}], 3]],
ItemStyle -> {{{Red}, {Red}, {}}, {}}
]

myPrint[“title”, “x”, 1, “y”, 2]

This hardly seems like a shortcut to just typing it all out longhand, but try this

names = {“equivStrainRate”, “equivStrainRateStar”, “aT”, “λ”,
“η”, “DaTDT”, “DλDT”};
vals = {equivStrainRate, equivStrainRateStar,
aTinit, λ, η, DaTDT, DλDT};
Grid[Transpose[
{Style[#, Red] & /@ names, ConstantArray[Style[“=”, Red], 7],
vals}]~Prepend~{Style[“Values of Quantities”, Blue, Bold],
SpanFromLeft}]

  

 

Very close but I guess I am very bizarre! I want the very name, e.g., equivStrainRate= in Red; but not the value of the variable itself (here 0.0136083).
– dimitris
Jan 26 at 14:40

  

 

Thank you very much!
– dimitris
Jan 26 at 14:55