MathGroup Archive 2011

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

Search the Archive

Re: proportional vs monospace font in usage text

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122761] Re: proportional vs monospace font in usage text
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Thu, 10 Nov 2011 06:50:23 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201111091125.GAA11143@smc.vnet.net>

Hi,

I personally like usage messages that are normal strings for two
reasons. The first one is, when I write my own stuff, I do it in an
editor where I input text. Creating such nice looking messages would
obviously be hell, when you look what QBinomial::usage // InputForm
shows you.

The second reason is, to see how a command works, I read the
documentation with all its fancy stuff. The usages are good when you
want to quickly lookup the call pattern or reupdate your memory. For my
own functions I think normal strings are completely sufficient.

Therefore, my personal opinions are

> Q1) Is using ascii art a bad idea.

Yes, too much work.

> Q2) How can I enter what Mathematica shows for ?QBinomial inside a f::usage string?

I just showed you above

> Q3) Is it suggested that one should use something like
>     If[$Notebooks, "notebook format", "ascii format"]
>     in order to achieve nice output in either format?

Come on. This would be far too much work.

> Q4) I realized that newlines are handled differently in Mathematica 5.2 and Mathematica 8.
>     What is the right way to enter line breaks?

I don't make newlines, never. I let Mathematica decide where to break. Your newlines will, 
with every user liking its own window size, text size and magnification, always be at the wrong place.

Cheers
Patrick

On Wed, 2011-11-09 at 06:25 -0500, Ralf Hemmecke wrote:
> Documenting a function, one uses f::usage = "...".
> Unfortunately, doing some ascii arts inside this string like (see end of posting) goes completely wrong when shown in the notebook interface due to usage of proportional font.
> 
> I've seen the documentation for Mathematica's builtin QBinomial. While it looks nice in the notebook, in the text interface (math) it shows as
> 
> In[1]:= ?QBinomial
> QBinomial[n, m, q] gives the q-binomial coefficient (n) .
>                                                        q
>                                                      m
> 
> which doesn't look perfect, either.
> 
> Q1) Is using ascii art a bad idea.
> Q2) How can I enter what Mathematica shows for ?QBinomial inside a f::usage string?
> Q3) Is it suggested that one should use something like
>     If[$Notebooks, "notebook format", "ascii format"]
>     in order to achieve nice output in either format?
> Q4) I realized that newlines are handled differently in Mathematica 5.2 and Mathematica 8.
>     What is the right way to enter line breaks?
> 
> Ralf
> 
> ================
> qBinomial::usage = "qBinomial[n, k, q] represents the q-binomial coefficient
> of n and k in base q given by
> 
>                {   n-k+1
>                { (q     ;q)
>    _   _       {           k
>   |  n  |      { -----------,  for k >= 0,
>   |     |  :=  {    (q;q)
>   |_ k _|      {         k
>          q     {
>                { 0,            otherwise.
> 
> For a description of (q;q)  type '?qPochhammer'.
>                           k"
> 





  • Prev by Date: Re: Import files on accessible URL and save in
  • Next by Date: Re: Import files on accessible URL and save in
  • Previous by thread: proportional vs monospace font in usage text
  • Next by thread: Re: proportional vs monospace font in usage text