On Thu, May 30, 2024 at 02:57:20PM +0200, Grégory Vanuxem wrote:
> 
> 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.

OutputForm can represent each variant and domain's coder can use what
is more appropriate, like:

(2) -> y*(x::OutputForm)^(-1)

           - 1
   (2)  y x
                                                             Type: OutputForm

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

Just produce right OutputForm:

(4) -> )set output tex on                 
(4) -> prefix((sin::OutputForm)^(-1), [a])

           - 1
   (4)  sin   (a)
$$
{{\sin} \sp {-1}} 
\left(
{a} 
\right)
\leqno(4)
$$

                                                             Type: OutputForm

Both your wishes could be done by relatively simple transformation
of OutputForm.  Currently before formattiong OutputForm is transformed
by 'precondition' in OutputFormTools.  In principle 'precondition'
could be replaced by a user function.

-- 
                              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/ZliX7cwIwPxmB7cN%40fricas.org.

Reply via email to