Re: Convenient way to add inline formatting to usage Messages
- To: mathgroup at smc.vnet.net
- Subject: [mg119801] Re: Convenient way to add inline formatting to usage Messages
- From: Mike Bryniarski <michael.bryniarski at gmail.com>
- Date: Thu, 23 Jun 2011 07:24:38 -0400 (EDT)
- Reply-to: comp.soft-sys.math.mathematica at googlegroups.com
Use ToString[ foo, StandardForm] Example f::usage = "f[" <> ToString[Subscript[Style["x", Italic], "1"], StandardForm] <> "," <> ToString[Text[" \[Ellipsis]"], TraditionalForm] <> "] is a function of a sequence of " <> ToString[Style[Subscript["x", "i"], Italic], StandardForm] On Tuesday, June 21, 2011 4:52:57 AM UTC-5, Alexey Popkov wrote: > Usage Messages of built-in functions have embedded in-line formatting. For example: > > In[1]:= AiryAiPrime::usage // FullForm > Out[1]//FullForm= > "\!\(\*RowBox[{\"AiryAiPrime\", \"[\", StyleBox[\"z\", \"TI\"], \"]\"}]\) gives the derivative of the Airy function \!\(\*RowBox[{SuperscriptBox[\"Ai\", \"\[Prime]\"], \"(\", StyleBox[\"z\", \"TI\"], \")\"}]\). " > > One can see that this in-line formatting is based on the set of styles defined in "Styles for Inline Formatting" section of the Core.nb stylesheet. But I have not found any description of these styles as well as any description of the convenient way to add formatting to usage Messages. > > What is the convenient way to add in-line formatting to user-defined usage Messages in Mathematica? What are the usage rules of default styles for in-line formatting defined in the Core.nb stylesheet? I would like to add in-line formating for messages in my package just with Mathematica, without installing additional components like Workbench etc.