0
$\begingroup$

My code has a problem

Row[Dynamic@Style[#, If[CurrentValue["MouseOver"], Red, Black], 24] & /@ 
    StringSplit[#] &@"If I close a slit, by example \!\(\*SubscriptBox[\(r\), \(2\)]\)", 
 Spacer[5]]

enter image description here

How can I find a solution?

$\endgroup$
2
$\begingroup$
Row[Dynamic@ Style[#, If[CurrentValue["MouseOver"], Red, Black], 24] & /@ 
  Append[StringSplit["If I close a slit, by example"], Subscript[r, 2]], Spacer[5]]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks. My problem was r2 $\endgroup$ – Andres Nov 29 '18 at 12:34
  • $\begingroup$ If my text was: If I close a slit, by example r2 and close r1. I need use Row or other command?. $\endgroup$ – Andres Nov 30 '18 at 0:40
  • $\begingroup$ @Andres, you can do Row[Dynamic@ Style[#, If[CurrentValue["MouseOver"], Red, Black], 24] & /@ Join[StringSplit[ "If I close a slit, by example"], {Subscript[r, 2]}, StringSplit["and close"], {Subscript[r, 1]}, {"."}], Spacer[5]]. $\endgroup$ – kglr Nov 30 '18 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.