axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] )set output mathml on


From: Arthur Ralfs
Subject: [Axiom-developer] )set output mathml on
Date: Sat, 10 Feb 2007 18:50:45 -0800
User-agent: Thunderbird 1.5.0.9 (X11/20060911)

This posting is in response to Andrey Grozin's questions here
http://lists.nongnu.org/archive/html/axiom-developer/2005-09/msg00076.html
which were recently referenced by CY.

I wanted to get my mathml package delivering output.  Here's what I did.

1.  created output mathml section in src/interp/setvars.boot.pamphlet by
copying
    and modifying the tex section. Remember to add "<<outputmathmlCode>>" at
    end.
    Copied setvars.boot.pamphlet and ran notangle on it.
    From inside axiom ran )lisp (boottran::boottocl "tmp/setvars.boot")
    which put setvars.clisp into int/interp/setvars.clisp and then replaced
    the lisp in setvars.boot.pamphlet with that in setvars.clisp.
    code chunks:
     <<outputmathmlCode>>
     <<setOutputMathml>>
     <<describeSetOutputMathml>>
    variables:
        setOutputMathml
    $mathmlOutputStream
    $mathmlOutputFile
    $mathmlFormat
    describeSetOutputMathml

2.  create output mathml section in setvart.boot.pamphlet.
     Added line
    mathml        create output in MathML style         Off:CONSOLE
    to \section{output} table

    Added <<outputmathml>> to code chunk <<output>> in \section{output}
    code chunks:
     <<outputmathml>>
    variables:
    setOutputMathml
    $mathmlFormat
    $mathmlOutputFile

3.  Added
    ${OUT}/MMLFORM.o to Layer 17 of Makefile.pamphlet
    So far I've eliminated the analog of TEX1, doesn't seem to be needed.
      I added the line
    "mathml.spad.pamphlet (MMLFORM)" to layer 17 completed spad files.
    I added a dependency in my package so it needs to be in layer 17 rather
    than layer 14 where TEX appears.
    Incidentally why does TEX1 appear in layer 4 when it seems to depend
    on TEX which appears in layer 14?
    Added lines to SPADFILES  and DOCFILES.

4.  Added
    (|MathMLFormat| . MMLFORM)
    to exposed.lsp.pamphlet

5.  Added
    DONE mathml.spad.pamphlet
    DONE )abbrev package MMLFORM MathMLFormat
    to Lattice.pamphlet.
    Stepped through Lattice.pamphlet by searching for "TEX" and
    mimiced everthing for MMLFORM however I can't see that
    Lattice.pamphlet is actually used anymore.

6.  Added mathml.spad subsection to src/doc/axiom.bib.pamphlet.

7.  Added
mathmlFormat expr ==
  mml := '(MathMLFormat)
  mmlrep := '(String)
  formatFn := getFunctionFromDomain("coerce",mml,[$OutputForm])
  displayFn := getFunctionFromDomain("display",mml,[mmlrep])
  SPADCALL(SPADCALL(expr,formatFn),displayFn)
  TERPRI $mathmlOutputStream
  FORCE_-OUTPUT $mathmlOutputStream
  NIL

  to interp/i-output.boot.pamphlet

  To function "output(expr,domain)" add lines for mathml,e.g.
     "if $mathmlFormat then mathmlFormat expr".

After all this I successfully compile axiom (using gold branch) so
now I can do this:

(1) -> )set messages autoload off
(1) -> )set output tex on
(1) -> )set output mathml on
(1) -> (x+y)**2

         2           2
   (1)  y  + 2x y + x
$$
{y \sp 2}+{2 \  x \  y}+{x \sp 2}
\leqno(1)
$$

<math xmlns="http://www.w3.org/1998/Math/MathML"; mathsize="big"
display="block">
<mrow><msup><mrow><mi>y</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow><mo>+</mo><mrow><mn>2</mn><mo>&InvisibleTimes;</mo><mi>x</mi><mo>&InvisibleTimes;</mo><mi>y</mi></mrow><mo>+</mo><mrow><msup><mrow><mi>x</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow>
</math>

                                                     Type: Polynomial
Integer

Arthur Ralfs





reply via email to

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