14
$\begingroup$

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?

$\endgroup$
1

1 Answer 1

16
$\begingroup$

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

SetOptions[$FrontEndSession, AutoStyleOptions -> {"SymbolContextStyles" -> {"highlight`" -> Green}}] 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.

highlight`var1; highlight`var2; 

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

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.