On Thu, May 30, 2024 at 12:53:26PM +0200, Grégory Vanuxem wrote:
> Hello,
>
> I am wondering what is the use of the 'latex' function in FriCAS. And,
> more importantly, why it is not used by TeXFormat.
Well, I suspect that there were multiple parallel attempts to
create output framework for Axiom. OutputFrom got implemented
and works reasonably well, 'latex' was just a try, mostly
unimplemented. But few people here wanted 'latex' to stay,
so now it just uses TeXFormat. And of course since 'latex'
uses TeXFormat using 'latex' to implement TeXFormat would
lead to infinte loop. In other words, you can delegate work
only finitely many times, at the end somebody has to do real work.
> 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.
>
> Is it possible to bypass this mechanism or am I wrong here?
OutputForm is supposed to contain enough information to allow
needed formatting. If not, we can extend OutputForm.
The point here is that algebra structures are defined in recursive
way, no single domain knows everthing. And we want multiple formats.
OutputForm allows to decompose formating work between various
domains. For example, SparseMultivariatePolynomial knows that
there are variables, that powers of variables are multiplied together
and preceeded by coefficients. But SparseMultivariatePolynomial does
not know how to format coefficients, this is delegated to coefficient
domain. Similarly SparseMultivariatePolynomial does not know how
to format variables, this is delegated to variable domain.
> In fact I would like to have better control of the output.
Well, currently there is bunch of choices:
- you can use different formatter or different options to
given formatter
- if domain supports this you can set options in the domain
(like for Float)
- you can create a new domain which re-uses old domain, but
has new coercion to OutputForm
Admitedly, creating new domain only to have different output
is clumsy. In principle we could have more options at
OutputForm level. OTOH bypassing OutputForm is likely to
lead to _less_ control because is such case places needing
changed bahaviour would be spread out and hard to find and
influence.
--
Waldek Hebisch
--
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/ZliPEHSpSInDLuER%40fricas.org.