Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.1K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

How can I implement SyntaxInformation and Option defaults in my packages?

Posted 11 years ago

I have a couple of questions related to usage messages and syntax styling in developed packages. Mathematica has a powerful Code Assist functionality, and the fundamental question is how you should code your packages so your packages behave like native Mathematica functions. To examplify my question:

Plot[Sin[x], {x, 0, 2 \[Pi]}, LabelStyle -> Directive[Bold, Medium]]

When typing the functions, Mathematica automatically provides feedback and help:

Code Assistant

The options displayed are those that are only valid for the Plot function. Similarly, when you have selected a valid options, valid alternatives are suggested by Mathematica:

Valid optional arguments

How can I implement this functionality in my own packages? And the second question, how can I prettify my usage messages to be displayed with mathematical typesetting? Mathematica provides nicely typeset usage messages: Typesetting usage messages

2 Replies
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard
Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use