login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #324 Bug in width$OutputForm revision 4 of 4

1 2 3 4
Editor: test1
Time: 2014/05/06 19:32:21 GMT+0
Note:

added:

From test1 Tue May 6 19:32:21 +0000 2014
From: test1
Date: Tue, 06 May 2014 19:32:21 +0000
Subject: 
Message-ID: <20140506193221+0000@axiom-wiki.newsynthesis.org>

Status: open => rejected 


Submitted by : (unknown) at: 2007-11-17T22:26:34-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

In OutputForm there is a function width that returns the amount of space taken by some element of OutputForm when printed as ASCII. For example

fricas
)se ou alg on
 
fricas
)se ou tex off
sin x
(1) sin(x)
Type: Expression(Integer)
fricas
width((sin x)::OutputForm)$OutputForm
The function width is not implemented in OutputForm .

However, the width for squares and fractions seems to be wrong:

fricas
x^2
2 (2) x
Type: Polynomial(Integer)
fricas
width((x^2)::OutputForm)$OutputForm
The function width is not implemented in OutputForm .

I would expect 2 here.

fricas
1/2
1 (3) - 2
Type: Fraction(Integer)
fricas
width((1/2)::OutputForm)$OutputForm
The function width is not implemented in OutputForm .

I would expect 1 here.

The function is unfortunately not implemented in SPAD but rather calls outformWidth coded in BOOT in the file i-output.boot.

It would be good to have a similar function for TeX output, by the way.

Width of output depends on formater. In case of formats such as TeX or MathML the actual typesetting happens outside FriCAS and we have no way to know true width. So width in OutputForm? is ill-defined and for this reason removed from FriCAS. Martin

Status: open => rejected