Discussion:
[Axiom-math] texmacs
Yigal Weinstein
2006-01-24 19:10:07 UTC
Permalink
Does anyone use and obtain graphics through the draw() command using texmacs
as an interface to axiom. If so please tell me how you managed this.

I have heard that the following method works:

1. get texmacs souce
2. get tm_axiom.c
alter this file so that if there exists a call to AXIOMsys
change to axiom
3. compile tm_axiom.c
4. compile texmacs

if this or something similar is necessary please tell me
it would be great to get graphics working.

Also if anyone has been able to get inline graphics in
texmacs I would really like to know- this would be really
nice.

thanks for reading

Yigal Weinstein
Bill Page
2006-01-25 20:00:41 UTC
Permalink
Post by Yigal Weinstein
Does anyone use and obtain graphics through the draw()
command using texmacs as an interface to axiom. If so
please tell me how you managed this.
At the present time this will only work on the Linux version
of Axiom.
Post by Yigal Weinstein
1. get texmacs souce
You only really need the source of tm_axiom.c
Post by Yigal Weinstein
2. get tm_axiom.c
alter this file so that if there exists a call to
AXIOMsys change to axiom
See below.
Post by Yigal Weinstein
3. compile tm_axiom.c
Yes. Make sure the new binary replaces the existing one.
Post by Yigal Weinstein
4. compile texmacs
This is not necessary.
Post by Yigal Weinstein
if this or something similar is necessary please tell me
it would be great to get graphics working.
On Wed, 12 Oct 2005 03:50:00 -0500 Andrey Grozin wrote:

http://lists.nongnu.org/archive/html/axiom-developer/2005-10/msg00116.html
Post by Yigal Weinstein
It is easy to modify tm_axiom.c to start axiom (with hypertex
and graphics)
Instead of starting AXIOMsys, it should start axiom -noclef
Also, in void session(void), declare
int prompts=0;
and, a few lines later, replace the line
else if (code==PROMPT) break;
by the line
else if (code==PROMPT) { if ((++prompts)==2) break; }
...
See http://wiki.axiom-developer.org/TeXmacs for mor information.
Post by Yigal Weinstein
Also if anyone has been able to get inline graphics in
texmacs I would really like to know- this would be really
nice.
As far as I know, no one has done this. Certainly it is technically
possible, though perhaps a little difficult because of the way
Axiom uses another process to render graphics. This external graphics
processor can be told to save the result in a postscript format
file, then it can be imported by TeXmacs or sent via a stream
to TeXmacs from the tm_axiom interface program.

If you are motivated to work on implementing a solution to this,
I would be glad to help.
Post by Yigal Weinstein
thanks for reading
Thanks for asking :) If you can think of a way of updating the
web page at

http://wiki.axiom-developer.org/TeXmacs

so that this issue is more clearly documented, I would be very
happy if you (or anyone else) could improve the content. (This
web site is an Axiom community wiki - editable website.)

Regards,
Bill Page.
yigal
2006-01-26 00:59:48 UTC
Permalink
I believe I followed the directions given bellow. The only problem with
this tm_axiom is that I don't get output except for graphics. That is:
first prompt
-> x
->
i.e. next line is a new prompt with no output?
The good news is that draw() does work
-> draw(x,x=0..5)
produces the Axiom graphic panel.

If you have time attached is my altered tm_axiom.c file.

Best,
Yigal Weinstein
------------------------------------------------------------------
TeXmacs --Andrey, Wed, 12 Oct 2005 03:49:57 -0500 reply It is easy to
modify tm_axiom.c to start axiom (with hypertex and graphics)

Instead of starting AXIOMsys, it should start axiom -noclef

Also, in void session(void), declare:

int prompts=0;

and, a few lines later, replace the line:

else if (code==PROMPT) break;

by the line:

else if (code==PROMPT) { if ((++prompts)==2) break; }

However, it would be much better to fix this damn double-prompt problem
once and for all. Axiom must not write a prompt when it is not prompting
the user to input something.

Andrey
Bill Page
2006-01-26 09:14:06 UTC
Permalink
Post by yigal
I believe I followed the directions given bellow. The only
problem with this tm_axiom is that I don't get output except
first prompt
-> x
->
i.e. next line is a new prompt with no output?
The good news is that draw() does work
-> draw(x,x=0..5)
produces the Axiom graphic panel.
If you have time attached is my altered tm_axiom.c file.
...
Your modifications look fine and they work for me. The new
tm_axiom.c file compiles and installs with no errors:

1) copy altered tm_axiom.c file into

cp tm_axiom.c ~/TeXmacs-1.0.6-src/plugins/axiom/src

2) compile

cd ~/TeXmacs-1.0.6-src/plugins/axiom
make

3) install new file

sux -c 'cp bin/tm_axiom /usr/local/libexec/TeXmacs/bin'

Did you do something similar to this?

--------

When I run 'texmacs' and Insert/Session/Axiom, I see the
red -> prompt plus an Axiom Hypertex window appears (which
I ignore).

I can enter

-> x

and I see

x (1)

Type: Variable x

When I enter

-> draw(x,x=0..5)

an Axiom graphics window opens with the graph and the
following Axiom output appears in TeXmacs:

Compiling /tmp/gazonk0.lsp
End of Pass 1
End of Pass 2
OPTIMIZE levels ...
Finished compiling ...
Compiling function %B ...
Graph data being transmitted ...
AXIOM2D data being transmitted ...
TwoDimensionalViewPort: "test" (2)

Type: TwoDimensionalViewport

->

-------

I can enter additional Axiom commands with no problem.

I can save the graph as a file by clicking on the graph
and then clicking the PS button.

In TeXmacs I can click Insert/Image/Insert Image
and select 'axiom2d.ps' and the image appears in the
TeXmacs document.

-------

Note: To get rid of the Hypertex window you can change
the line that starts axiom in tm_axiom.c to:

execlp("axiom","axiom","-noclef","-noht",0);

-------

If you are still having problems, could you please
describe in more detail your steps and the specific
output that you see?

What versions of Axiom and TeXmacs are you using?

Regards,
Bill Page.

Loading...