axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Small TeX output patch


From: Dylan Thurston
Subject: [Axiom-developer] Small TeX output patch
Date: Mon, 13 Oct 2003 14:06:54 -0400
User-agent: Mutt/1.5.4i

While going through the TeXmacs tutorial, I've noticed several display
bugs.  I already reported one to the BTS (#5906), but here's another
small fix, which fixes the display of infinity.

Test case input:
)set output tex on
plusInfinity()

Desired output:
$$
\infty
\legno(1)
$$


---------- snip here ------------
Index: tex.spad.pamphlet
===================================================================
RCS file: /cvsroot/axiom/axiom/src/algebra/tex.spad.pamphlet,v
retrieving revision 1.2
diff -u -r1.2 tex.spad.pamphlet
--- tex.spad.pamphlet   9 Oct 2003 10:45:03 -0000       1.2
+++ tex.spad.pamphlet   13 Oct 2003 17:44:55 -0000
@@ -140,11 +140,11 @@
     specialStrings : L S :=
       ["cos", "cot", "csc", "log", "sec", "sin", "tan",
         "cosh", "coth", "csch", "sech", "sinh", "tanh",
-          "acos","asin","atan","erf","...","$"]
+          "acos","asin","atan","erf","...","$", "infinity"]
     specialStringsInTeX : L S :=
       ["\cos","\cot","\csc","\log","\sec","\sin","\tan",
         "\cosh","\coth","\csch","\sech","\sinh","\tanh",
-          "\arccos","\arcsin","\arctan","\erf","\ldots","\$"]
+          "\arccos","\arcsin","\arctan","\erf","\ldots","\$","\infty"]
 
     -- local function signatures
 
---------- snip here ------------

However, I'm a little concerned about this (and the general approach):
after all, if you type "infinity" at the prompt, it gets interpreted as
a variable named "infinity", not as an element of OrderedCompletion.
The same goes for "sin", of course:

--------------
   (4)  sin
$$
\sin 
\leqno(4)
$$

                                                           Type: Variable sin
--------------

The output really should be similar to what I would get if I typed
"sine" (which is currently buggy, but that's another issue), but because
the code patched above looks only at the text of the string to be output
(which is the only thing available to it), and not the type that was
producing the output, there are sure to be display glitches.

For the moment, I think the patch above should be applied, but a
long-term project would be to rethink how TeX output is produced to
deal with situations like this in a more principled way.

Also, another project would be to remove the "latex" command, which
seems to be an abortive attempt at another method of producing LaTeX
output.  It's not used much, and should be incorporated into one of the
other mechanisms, and even things as simple as "latex (x+y)" produce
"Unimplemented".

(I'm not sure what the etiquette is.  Should I just go ahead and file
the bugs myself, and will anybody notice if I do?  Is there a way for me
to subscribe to the BTS?  I count three bugs here:
1) Patch for output of "infinity";
2) Revamp output mechanisms so that "sin" as a variable is treated
   differently from "sin" the trigonometric function; and
3) Remove the "latex" function from Category SetCategory.)

Peace,
        Dylan

Attachment: signature.asc
Description: Digital signature


reply via email to

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