Le jeu. 30 mai 2024 à 13:15, Ralf Hemmecke <[email protected]> a écrit :

> Hi Greg,
>
> You now get a more personal view from my side.
>
> > I am wondering what is the use of the 'latex' function in FriCAS.
>
> Nothing, currently. I have no idea about the history, but I do not see
> much use of it now.
>
> You could actually think of this: each element "know" how it should be
> represented in LaTeX.
>
> > And, more importantly, why it is not used by TeXFormat.
>
> I guess, historical reasons and maybe a different view. There is
> basically the following question to solve.
>
> You have n object types (basically elements from different domains) and
> m output formats (like 1d, 2d, latex, html, etc.). How do you implement
> that each domain can be output in each output format?
>
> In FriCAS the view is that each element type can be converted to
> OutputForm and each OutputForm can be converted to each of the possible
> Formats.
>
> You could also say each element type (i.e. each domain) knows how to
> format for each output format. Introducing a new output format then
> would require to add new functions to every domain in the library to
> support such output. (Looks like that this does not scale very well.)
>
> The other extreme approach is that for each output format there is a
> function that knows how to represent each and every element type in this
> respective format. (Looks like that this is also not the best, because
> every time a new domain is added to the library, all the formatting
> functions must be told about it.
>
> OutputForm is the FriCAS way to have a common API. I do not claim that
> this is perfect, but it's a reasonable approach.
>
> > Apparently the TeX format which is used when one issue ')set output
> > tex on' in the interpreter uses only the "official" OutForm to
> > translate it in LaTeX.
>
> You should start to write the actual problem in your mails.
>
> > In fact I would like to have better control of the output.
>
> I can only guess that I can help you with your problem. The formatting
> framework that I have programmed, is very flexible. Without looking at
> my old code, I would claim that you can even extend the formatters at
> runtime in order to handle new (i.e. unofficial)  OutputForm operators.
> Just specify precisely what you want to achieve.
>
> Warning, I will be away till Monday.


Hello Ralf,

I know and I was waiting somewhere for your reply, there is Spad code from
you in FriCAS about that . Just quick notes, I'll respond more clearly when
time allows, my thoughts are vague and scattered. But think about sqrt(x)
or asin(x) in LaTeX, they may be formatted differently if you use \sqrt,
\asin or sin^1 (x), x^(1/2), negative power for rational numbers, etc. The
way OutputForm works doesn't allow a domain's coder to choose which
representation to display. And if you want to have different
representations as an option, that doesn't seem to be possible. From my
point of view, if you want another format, you have to write a whole new
format. It's just not practical.

For tables and other “containers”, I am pretty sure that's not easy to
manage, but for relatively simple operations or numbers implemented in
LaTeX that should be doable I think.

Other vague ideas, there are generalizations of input/output type like
MIME, OS file extensions and much more. Since from tracing the TeX
formatter, the 'display' function is used at end, why not, a dream,
display-ing with a "draw" format the .xpm in the FriCAS graphic window,
there is also png or other, "image/png" etc. I do not think to all possible
data types of course I will not edit videos in FiCAS ;) And to add to this,
yes, OutputForm is a very handy general "representation".

Just thoughts. The first part of my mail respond to "state your problem":

How to handle for example \asin or \sin ^{-1}(a) in LatTeX.

- Greg



>
> Ralf
>
> --
> You received this message because you are subscribed to the Google Groups
> "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/b4b868a7-5a86-4962-8636-52b83680bd2b%40hemmecke.org
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2darDKNXd1T6owX4utb5REO%3DunpadNThbDrvgafaofzSAA%40mail.gmail.com.

Reply via email to