# Clear Style to standard output expressions in the same cell

I would like to reset an expression in a Standar Output inside a Cell.

For example,

c + Style[a+b, Red] (*I want the a+b part in red *)

Style[%, Blue]  (*Now I would like all the expression in Blue or Black*)


The last output will give c+( ) in blue but the inside parenthesis a +b will remain red, because this is equivalent to

Style[c + Style[a + b, Red], Red]



But I want my last Output as

Style[c + a + b, Red]



This would be simple if there would be a way to clear all the % style.

• maybe Style[ToExpression@StripBoxes@ToBoxes@%, Blue]?
– kglr
Sep 15 '20 at 23:32
• ... or Style[% /. Style -> (# &), Blue]?
– kglr
Sep 15 '20 at 23:50

c + Style[a + b, Red]
Style[% /. Style -> (# &), Blue, 24]


c + Style[a + b, Red]

Style[% /. Style -> (HoldForm@# &), Blue, 24]

ReleaseHold @ %


After many hours trying to solve this, I found out that with simply

c + Style[a + b, Red]
%/. Style[x__, y__] -> x



clear the Style. Thanks all!!