[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Adding TeXmacs symbols to FriCAS math-mode input
From: |
François Poulain |
Subject: |
Re: [Texmacs-dev] Adding TeXmacs symbols to FriCAS math-mode input |
Date: |
Thu, 27 Mar 2014 10:27:22 +0100 |
Hi,
Le Wed, 26 Mar 2014 22:13:55 -0400,
Bill Page <address@hidden> a écrit :
> No problem. At this point I would consider more for discussion rather
> than commit. I was hoping to find a few FriCAS or Axiom users here
> with opinions about how best this should be done. I have also
> submitted it to the FriCAS list and so far I received one comment
> which encouraged me to test some cases for which the current patch
> fails. So it should be considered as work-in-progress.
Ok.
> Yes I will do this. The main goal is for both FriCAS input and output
> to be able to support the full (or at least a large subset) of TeXmacs
> math symbols. Things get a little more complicated if we want to
> extend this support to include math mode symbols in text strings, etc.
> That is where the current patch fails since TeXmacs symbols are
> encoded as escaped multi-character identifiers (the Cork names for the
> math symbols). so for example indexing into a string containing such
> "characters" produces somewhat unexpected results.
Yes. This is known as "universal TeXmacs encoding" and was a way to
extends limits of 8bits charsets (someday maybe we will go to
unicode...). See e.g. TeXmacs/doc/devel/format/basics/tm-tree.en.tm
It is not possible to index randomly such a string (it leads to the
same problems than utf8). But it is rather easy to browse/scan it.
> Since FriCAS supports the unicode character set, one solution to this
> problem would be to encode TeXmacs symbols as unicode utf-8
> characters. This would necessitate converting TeXmacs internal form
> to utf-8 before sending it to FriCAS and then re-coding the result
> back to TeXmacs internal form for display.
Using utf8 is probably a good idea.
> Already it seems that
> TeXmacs some attempts to do this but the translation seems to depend
> on the context in a way that I do not understand. So far I have been
> unable to find any documentation of how the TeXmacs session interface
> is intended to work in the case of math-mode symbols and unicode. By
> searching through the source code and by experimentation I have found
> that there are some internal routines in TeXmacs that are intended to
> perform such translations for example in the case of converting to and
> from LaTeX. Some how and in some cases these translations also seem
> to be performed during session input and output. But so far I have
> not been able to produce a patch to the FriCAS scheme interface code
> and/or to FriCAS itself which takes complete advantage of this. Any
> help or references anyone can give me would be greatly appreciated.
Most of the doc is in Help -> Interfacing.
If I correctly understand the code and your needs (I didn't have
tested anything and fricas is not packaged in debian...), I guess you
simply have to call (cork->utf8 arg) from fricas-send-identifier.
François
--
François Poulain <address@hidden>