4
$\begingroup$

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.

$\endgroup$
  • 3
    $\begingroup$ "[...] without resorting to anything too heavy duty." — Sure, upgrade from v7 :P $\endgroup$ – rm -rf Aug 28 '13 at 22:45
  • $\begingroup$ @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.) $\endgroup$ – Mr.Wizard Aug 28 '13 at 22:58
  • $\begingroup$ 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... $\endgroup$ – rm -rf Aug 28 '13 at 23:15
  • 2
    $\begingroup$ @rm-rf It works in V8 too. $\endgroup$ – halirutan Aug 29 '13 at 0:02
3
$\begingroup$

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:

function.png

$\endgroup$

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.