Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6339 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2011-11-10 12:05 +0000 |
| Last post | 2011-11-10 12:05 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: proportional vs monospace font in usage text Bob Hanlon <hanlonr357@gmail.com> - 2011-11-10 12:05 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2011-11-10 12:05 +0000 |
| Subject | Re: proportional vs monospace font in usage text |
| Message-ID | <j9gem2$p1n$1@smc.vnet.net> |
Use TraditionalForm
QBinomial::usage =
"QBinomial[n, m, q] gives the q-binomial coefficient given by\n\n\t\" <>
ToString[TraditionalForm[QBinomial[n, m, q]]] <> " = " <>
ToString[HoldForm[TraditionalForm[
(QPochhammer[q^(1 + m), q]*
QPochhammer[q^(1 - m + n), q])/ (QPochhammer[q, q]*
QPochhammer[q^(1 + n), q])]]] <> " = " <>
ToString[HoldForm[TraditionalForm[
Product[(1 - q^(k + m + 1)) (1 - q^(k - m + n + 1))/
((1 - q^(k + 1)) (1 - q^(k + n + 1))), {k, 0, Infinity}]]]];
?? QBinomial
Bob Hanlon
On Wed, Nov 9, 2011 at 6:25 AM, Ralf Hemmecke <hemmecke@gmail.com> 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"
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web