MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Usage Messages with New Lines

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94798] Usage Messages with New Lines
  • From: "David Park" <djmpark at comcast.net>
  • Date: Fri, 26 Dec 2008 05:40:06 -0500 (EST)

I'm having trouble writing usage messages that several forms of a function
and in which we want a new line for each new function. The problem seems to
occur when there is a box structure within the message.

Here is an example that works properly:

foo::usage="foo[x] is the one argument form of foo.\nfoo[x,y] is the two
argument form.";

?foo 

I can't post the misbehaving form because when I do a copy as Input Text and
paste, the expression is replaced by one that works. 

In the usage definition above, replace x and y by x_1 and x_2, the
subscripted forms using the Ctrl_ keys to enter the subscripts.

?foo

Now, the first time ?foo is evaluated, or if the output is deleted, the
usage message does not display on two lines and "\n" appears literally in
the expression. But if ?foo is evaluated a second time the correct form of
the usage message is displayed.

If one writes the string with embedded subscripts, then copies it with Copy
As, Input Text and then pastes that into the usage message definition, then
things work properly.

foo::usage="foo[x] is the one argument form of
foo.\nfoo[\!\(\*SubscriptBox[\"x\", \"1\"]\),\!\(\*SubscriptBox[\"x\",
\"2\"]\)] is the two argument form.";

?foo

I think this misbehavior was introduced with Version 6 and the new
documentation. Perhaps in the new documentation there is another method for
adding second definitions on new lines. But it has been over a year and a
half since the introduction of the new documentation and we still do not
have these methods available to users and developers. In the meantime having
to work around these problems is a real annoyance.

Another problem with the Version 6 usage messages is that they made them so
that message cells cannot be magnified with Alt+, and of course picked the
smallest possible font size.

David Park

djmpark at comcast.net

 <http://home.comcast.net/~djmpark> http://home.comcast.net/~djmpark/  



  • Prev by Date: Usages Messages
  • Next by Date: Re: Mathematica 7 much slower than Mathematica 6 on Limit
  • Previous by thread: Re: Usages Messages
  • Next by thread: Re: Can mathematica save restart file for Simplify?