patchGNU TeXmacs - Patches: patch #9981, New version of the Giac plugin

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9981: New version of the Giac plugin

Submitter:  Luka Marohnić <luka>
Submitted:  Fri 16 Oct 2020 10:14:44 AM UTC
   
 
Category:  Plugins Action:  Done
Privacy:  Public Assigned to:  vdhoeven
Open/Closed:  Closed Release: 
Fixed Release:  Stable: 

Jump to the original submission

Tue 08 Jun 2021 10:23:52 AM UTC, comment #12: 

Thanks for your work, Luka.
The improvements have been integrated in TeXmacs 1.99.21.

Joris van der Hoeven <vdhoeven>
Group administrator
Sun 03 Jan 2021 04:02:06 PM UTC, comment #11: 

Good news:
After few weeks of struggling, Bernard and I managed to compile giac with mingw64, which means we have a native Windows build. It can be installed in Windows using the following installer:

https://www-fourier.ujf-grenoble.fr/~parisse/giac/xcaswininst.exe

It was required to change the executable name in init-giac.scm from "giac" to "icas" (I attached the changed file below). Then giac finally works from texmacs (I tested with version 1.99.18). To obtain plots in giac sessions, one needs to install either miktex or ghostscript. If the latter is installed, then the paths to bin and lib folders in gs installation directory must be added to PATH variable (it can be edited by typing "env" in Windows start menu). On my system these are C:\Program Files\gs\gs9.53.3\bin (and also \lib).
There are some flaws which are being worked on, but it finally works.

Happy New Year!

(file #50632)

Luka Marohnić <luka>
Sun 06 Dec 2020 03:33:56 PM UTC, comment #10: 

Hi Joris,

A new version of Giac/Xcas was released today, which includes up-to-date MacOS installation file here (for OS X version 10):

https://www-fourier.ujf-grenoble.fr/~parisse/giac/xcas_osx10.dmg.gz

This version should include the texmacs-compatibility functionality. To provide plots in texmacs, giac calls eps2eps script (which is part of Ghostscript) so it must be in PATH.

I don't have access to a MacOS machine so I can't test giac in texmacs myself.

Luka Marohnić <luka>
Fri 04 Dec 2020 07:16:56 PM UTC, comment #9: 

In the previous message there is a mistake, the third line of the c++ code snippet should be

putchar(TEXMACS_DATA_END);

Luka Marohnić <luka>
Fri 04 Dec 2020 07:14:27 PM UTC, comment #8: 

Hi Joris,

Unfortunately, I wasn't able to start an interactive giac commandline/cygwin session in windows using the available binaries.
So I tried to compile giac on Windows 10 using MinGW and Visual Studio but that turned out to be extremely complicated.
It gets difficult mainly because of FLTK integration which must be enabled to provide graphics features.
I will soon start working on a Qt version of giac and a new, cross-platform CLI interface. Another option that I will try is to create a CLI application within giac plugin for texmacs, which would link to giac.dll (available in the official Xcas installation for Windows).

About interactive giac sessions in texmacs 1.99.16 (Ubuntu 20.04): results display as expected in the generic style, but if I switch to tmdoc style i get question marks instead of results. That does not happen with Maxima, for example.
Perhaps this behaviour somehow related to the fact that giac sends answers in texmacs Scheme while other CAS-es typically send latex code. The answer to a giac session query is formatted as follows:

(equation* (document EXPR))

where EXPR is e.g. "1+1". Is the above formatting correct? Am I perhaps missing math-mode somewhere? I could easily adjust the formatting in giac.
Just to be clear, giac sends answers to texmacs using

putchar(TEXMACS_DATA_BEGIN);
printf("scheme:ANSWER");
putchar(TEXMACS_DATA_BEGIN);

Thanks as always,
Luka

Luka Marohnić <luka>
Sun 22 Nov 2020 10:03:14 PM UTC, comment #7: 

Hi Luka,

I am not a Windows specialist, so I don't know how to start icas from within cygwin from within mingw.  But, I urge you to investigate whether this is possible, since the same issue may arise for other plug-ins.

Concerning MacOS: yes, I am running the MacOS version.

Concerning <nosymbol>: you should only use it in math-mode.

--Joris

Joris van der Hoeven <vdhoeven>
Group administrator
Sun 22 Nov 2020 07:43:06 PM UTC, comment #6: 

Hi Joris,

Thanks for your posts. I can report that giac 1.6.0 runs in texmacs 1.99.15 without problems at my Linux Ubuntu (focal LTS) platform. I managed to replicate the problem on Windows you mention. I wrote to Bernard Parisse about it and he replied:

"About icas under windows (cygwin), it works if I run it from cygwin bash, but not from windows commandline. More precisely it does not work interactively, but it works more or less in batch mode (like in icas 'factor(x**4-1)' > log). Maybe it would be better if compiled with mingw (or visual studio, but I
have no project ready to do that)."

Hence, unfortunately, icas does not run interactively in Windows commandline as for now; that's why you managed to start giac but did not get an answer to the "1+1" query. Could giac be started within cygwin  from texmacs somehow?
I'll try to initiate some work on proper icas binaries for Windows. Giac is a great CAS kernel but the existing user interfaces could be better...

The warnings in the session banner should not prevent giac from running. They are annoying nevertheless, I will try to write patches for giac source to set proper doc paths and also print giac version in the banner. Note that you can obtain version number by typing "version()" in a giac session. (But it must be running interactively for that of course..)

The version on Windows that should be installed (in Windows 10) is the 64-bit version here:
https://www-fourier.ujf-grenoble.fr/~parisse/install_en#wcas
Also, you can find installation files here:
https://www-fourier.ujf-grenoble.fr/~parisse/giac/
For Windows one needs xcas64inst.exe, while for Ubuntu giac_1.6.0-xx_amd64.deb and giac-dbgsym_1.6.0-xx_amd64.deb are needed (always get the latest version). Instructions for Ubuntu installation (using up-to-date deb files) are here:
https://www-fourier.ujf-grenoble.fr/~parisse/install_en#packages
I don't have access to a Mac machine, but OS X installation files  seem to be outdated (the newest one, xcas_osx10_unstable.dmg.gz, is from 2019).

By the way, there is a possible bug in tmdoc style. Giac sesion displays fine in generic style but in tmdoc I get "<nosymbol>" printed in red instead of nosymbol character in giac session output (that character is there intentionally, it is used for physical units).

Luka

Luka Marohnić <luka>
Sun 22 Nov 2020 05:29:12 PM UTC, comment #5: 

By the way, the banner does not state the version of Giac.  Not very convenient to know whether I have the right version...

Joris van der Hoeven <vdhoeven>
Group administrator
Sun 22 Nov 2020 05:26:24 PM UTC, comment #4: 

Under MacOS, note that I took the latest version of Giac from the website (at least, it seems that I did, because the download page is not overly clear).

Joris van der Hoeven <vdhoeven>
Group administrator
Sun 22 Nov 2020 05:24:58 PM UTC, comment #3: 

Hi Luka,

I have been playing a bit with a Windows laptop that I borroughed and fixed the support for various CAS systems.  TeXmacs now recognizes Giac when you install it at the default location.  But I get some errors when launching it, which prevent it from being usable (unless there is another reason for that):

- Help file /cygdrive/c/xcas/doc/en/aide_cas not found
- Help file /cygdrive/c/xcas/aide_cas not found
- Unable to open HTML doc directory ./doc/

After that, typing 1+1 ENTER fails to produce 2.

Best wishes, --Joris

Joris van der Hoeven <vdhoeven>
Group administrator
Thu 22 Oct 2020 08:27:27 PM UTC, comment #2: 

Hi Joris,

Thanks for applying the patch. I have tested giac 1.6.0 with texmacs 1.99.13 and integrals, double/bold characters and plotting work as epxected on my Ubuntu 20 LTS machine. I have attached a demo session below. Maybe your version of giac is outdated?

Plotting in texmacs should work but it depends on the eps2eps script which has to be available in PATH. Giac calls this script to crop EPS files. FLTK output forces A4 format which results in huge margins around pictures. Could texmacs possibly have an option to automatically crop EPS files during import?

There is something wrong with the help files indeed. I will rewrite them in 1.99.13.

I would like to make giac available within texmacs on Windows and Mac OS platforms, but I don't know how to do it at the moment. Recently I have a new Windows 10 machine at my disposal so I will try to figure it out (I don't have an access to Mac OS, unfortunately).
I suppose that something like this should be added to init-giac.scm for the support in Windows:

(define (giac-launchers)
  (if (os-mingw?)
      `((:launch "Windows command"))
      `((:launch "Linux/Mac command"))))

(plugin-add-windows-path "?" "bin" #f) ;; what does this command do?

(plugin-configure maxima
  (:require (url-exists-in-path? "giac"))
  ,@(maxima-launchers)
  ...

Thanks in advance for any help.

Luka

(file #50057)

Luka Marohnić <luka>
Thu 22 Oct 2020 05:36:32 PM UTC, comment #1: 

Hi Luka,

Thanks for the great work of updating this plug-in.
There are a certain number of problems though:

- It would be nice to recognize Giac when installed at
  the default location under MacOS and Windows.

- For the Qt5 version, I have a problem loading the help.
  No idea why, but it works correctly for the Qt4 version
  and the other plug-ins...

- I don't understand the way several of the symbols
  are converted.  For instance, if you convert <b-up-a>
  as aa, then I would expect to retrieve a bold upright a
  when typing this character and then press return.

- Other example: the <mathd> symbol should be used in order
  to input integrals in their mathematical notation.
  Unfortunately, this is not handled correctly by Giac.

- I hoped to be able to include a plot inside my session,
  but that did not work, at least not out of the box.

I applied the patch, but will leave it open for the moment
so that you can take a look at these problems.

--Joris

Joris van der Hoeven <vdhoeven>
Group administrator
Fri 16 Oct 2020 10:14:44 AM UTC, original submission:  

Hi,

This patch contains an improved version of the Giac plugin for TeXmacs. Most notably, it features vastly improved mathematical input and documentation, including an example session.
The current stable release of Giac/Xcas is 1.6.0, which features an improved export to LaTeX and TeXmacs Scheme. Therefore, the session output is fully compatible with the semantic organization of math formulas in TeXmacs.

There is one issue, though: it seems that <nosymbol> does not translate to the "nosymbol" character. If someone can tell me what is the new specification of that character in TeXmacs Scheme, I could make the appropriate changes in Giac source.

Thanks in advance for considering this patch and for help with the "nosymbol" character problem.

Luka Marohnić

Luka Marohnić <luka>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #50632:  init-giac.scm added by luka (1KiB - application/octet-stream)
file #50057:  giac-session.tm added by luka (375KiB - text/x-texmacs.doc)
file #49991:  giac.zip added by luka (584KiB - application/zip - The attached archive contains the complete giac plugin.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by vdhoeven (Posted a comment)
  • -email is unavailable- added by luka (Submitted the item)
  • -email is unavailable- added by luka
  • -email is unavailable- added by luka
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-08 vdhoeven ActionConfirm Done
        Open/ClosedOpen Closed
    2021-01-03 luka Attached File- Added init-giac.scm, #50632
    2020-10-22 luka Attached File- Added giac-session.tm, #50057
    2020-10-22 vdhoeven ActionNone Confirm
        Assigned toNone vdhoeven
    2020-10-16 luka Attached File- Added giac.zip, #49991
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code