I want to change the colour of some important variables in my code. My code is quite long and sometimes I have to change these specific variables, but it is quite annoying to search them, beacause their is no contrast and it is hard to find them. Is their a possibility to change their colour?


1 Answer 1


Define a new type of symbol (context) called highlight,

 AutoStyleOptions -> {"SymbolContextStyles" -> {"highlight`" -> 

AppendTo[$ContextPath, "highlight`"];

and before those important variables (symbols) appear for the first time, tell Mathematica to add them to the highlight context (e.g. var1 and var2). They will be green everywhere.


The method was posted in this answer, and it is explained at length therein.


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.