Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a bit of a long shot but I am wondering if it is possible to enable syntax highlighting in a function defined with \[Function] without resorting to anything too heavy duty.

For example I would like the a in the second line to be colored as it is in the first:

enter image description here

This is apparently enabled out of the box in versions 8 and 9.

share|improve this question
"[...] without resorting to anything too heavy duty." — Sure, upgrade from v7 :P – R. M. Aug 28 '13 at 22:45
@rm-rf lol -- well, I'm glad to know it's fixed. Why don't you post that as an answer? (Was this fixed in v8 or v9? I'll tag accordingly.) – Mr.Wizard Aug 28 '13 at 22:58
I'm not sure about 8; perhaps someone with v8 currently installed on their machine can comment on it. As for posting that as an answer, I'd rather the question be focused to version-7 (or 8) and the actual answer be a workaround to introduce syntax highlighting (if that's possible), since that would be more valuable than a simple acknowledgment (you can add it to the question, if you like). From some quick tinkering, it didn't seem like it was possible. Function's local variable info seems to be baked in and not easily modified by SyntaxInformation. I assume you've tried your usual tricks... – R. M. Aug 28 '13 at 23:15
@rm-rf It works in V8 too. – halirutan Aug 29 '13 at 0:02
up vote 3 down vote accepted

This question has been answered in the comments, so this answer is just for the record.

The problem described has been fixed in versions of Mathematica later than V7. The following image shows the expression in question as it is formatted in V9:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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