axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] TeX output of a**bc


From: kp
Subject: Re: [Axiom-developer] TeX output of a**bc
Date: Thu, 12 Jul 2012 01:21:24 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

To tell the whole story, I've written a new TeXmacs plugin for Axiom (in
Python) that displays only the TeX output, which latter I expected to be
reliable. To obtain nice output (subscripted exponents) I enter for example

  a^b__1 => Axiom removes one underscore =>  TeX output $$a^b_1$$

hence I see in fact an {a_1}^b rendered instead of a^{b_1}. Strange
enough, a^(x+bc), a^(x+b*c), a^(b*c) or a^123 produce correct output
(Axiom inserts an extra space in case of *). By the way, there is no
difference using tex or latex to compile. I think adding the missing
braces would at least give correct math output (modulo the ambiguity in
products/multichar identifiers you remarked earlier).

Thank you for your interest.
Kurt


(3) -> a^(x+bc)

         x + bc
   (3)  a
$$
a \sp {\left( x+bc
\right)}
\leqno(3)
$$


(4) -> a^(x+b*c)

         x + b c
   (4)  a
$$
a \sp {\left( x+{b \  c}
\right)}
\leqno(4)
$$


(2) -> a^123

         123
   (2)  a
$$
a \sp {123}
\leqno(2)
$$


(5) -> a^(b*c)

         b c
   (5)  a
$$
a \sp {\left( b \  c
\right)}
\leqno(5)
$$



Am 11.07.2012 22:39, schrieb William Sit:
> In the case c is literally an integer, and b is a symbol, then most
> likely c is meant to be a single subscript---of course, it could also be
> a superscript, but we can't tell. For subscript, the TeX code would be
> $a^{b_{c}}$. If c is meant to be a double subscript, like b13 to mean
> b_{1,3}, then it may be necessary to pass the integer string c.
> 
> Rather than guessing what the user has in mind, in case it is a^b13, I
> think your workaround a^{b13} is fine. Or you can use \verbatim to
> capture Axiom input and output lines.
> 
> William
> 
> On Wed, 11 Jul 2012 21:10:28 +0200
>  kp <address@hidden> wrote:
>> Yes, indeed. I didn't even think of the interpretation as a^{b c}
>> because in fact c were integers in my examples, so it didn't attract
>> much attention when rendered, but it's definitively not to distinguish
>> when c is literal. I have to review my workaround.
>>
>> Thank you for pointing this out.
>> Kurt
>>
>>
>> Am 11.07.2012 19:48, schrieb William Sit:
>>> In TeX, a^bc would be interpreted mathematically as (a^b)c, whereas
>>> a^{bc} would be interpreted as a^{b c}, where the exponent is a product
>>> of b and c, or an application of b on c. Neither interpretation is what
>>> is intended if bc is a single identifier.
>>>
>>> One would need something like a^{\rm bc}, but even that is possibly
>>> ambiguous; but some change in font is needed.
>>>
>>> William
>>>
>>>
>>>
>>> On Tue, 10 Jul 2012 21:48:10 +0200
>>>  kp <address@hidden> wrote:
>>>> Hello,
>>>>
>>>> by accident I noticed the following irregularity in the TeX output
>>>> (missing {}):
>>>>
>>>> a**bc (or a^bc).
>>>>
>>>> Axiom:
>>>> $$
>>>> a^bc
>>>> \leqno(4)
>>>> $$
>>>>
>>>> OpenAxiom, Fricas:
>>>> $$
>>>> a \sp bc
>>>> \leqno(6)
>>>> $$
>>>>
>>>> Usually, one uses only one character variables :)
>>>> I'm using Axiom mostly via Python (TeXmacs, IPython) so that
>>>>  re.sub(r"\\sp ([^ \t\r\n\f\v\\]*)", r"^{\1}", tex)
>>>> is a workaround for the moment.
>>>>
>>>> Cheers
>>>> Kurt
>>>>
>>>>
>>>> _______________________________________________
>>>> Axiom-developer mailing list
>>>> address@hidden
>>>> https://lists.nongnu.org/mailman/listinfo/axiom-developer
>>>
>>> William Sit, Professor Emeritus
>>> Mathematics, City College of New York
>>> Office: R6/291D Tel: 212-650-5179
>>> Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/
>>
>>
> 
> William Sit, Professor Emeritus
> Mathematics, City College of New York
> Office: R6/291D Tel: 212-650-5179
> Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]