Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3259

Re: Convenient way to add inline formatting to usage Messages

From Mike Bryniarski <michael.bryniarski@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Convenient way to add inline formatting to usage Messages
Date 2011-06-23 11:29 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <itv82a$pci$1@smc.vnet.net> (permalink)

Show all headers | View raw


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.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Convenient way to add inline formatting to usage Messages Mike Bryniarski <michael.bryniarski@gmail.com> - 2011-06-23 11:29 +0000

csiph-web