Question: Coloring comments after #

using worksheet mode, is there a way to automatically color any comments after (#) with a different color than the default red?

I have been using Maple for years and did not need to significantly document or comment on my worksheets before because I only needed to share my worksheets with close collegues who have a lot of experience with Maple too. However, now I need to share my code with a general audience that might not be a Maple user. So I need to add enough comments after each line, and I have been manually changing the color of comments after the # to green to give the reader the indication that this is a comment and not part of the code, like this for example:

 

restart;

f:=(x,y)->sin(sqrt(x^2+y^2))/sqrt(x^2+y^2); # Define f as a function of the variables x and y

proc (x, y) options operator, arrow; sin(sqrt(x^2+y^2))/sqrt(x^2+y^2) end proc

(1)

df:=(x,y)->eval(diff(f(a,y),a),a=x); # Define df as the partial derivative of f with respect to x

proc (x, y) options operator, arrow; eval(diff(f(a, y), a), a = x) end proc

(2)

df(1,3); # Evaluate df at x=1, y=3

(1/10)*cos(10^(1/2))-(1/100)*sin(10^(1/2))*10^(1/2)

(3)

 

 

Download Worksheet-coloring-comments.mw



It would be great if Maple can automatically color comments like typical editors do. Is this possible? if not, does anyone have an advice for a nice easy way to add proper documentation to worksheets?

Please Wait...