> > The problem is not the conversion to TeX, but rather a strange way of > storing that in OutputForm. > > (12) -> (eq1 :: OutputForm) pretend SExpression > > (12) (= ((PRIME f ",,,") x) (^ x n)) >
You're right, of course. The root of all evil (not all, though) in TEX is found in OUTFORM. However, the line https://github.com/fricas/fricas/blob/master/src/algebra/tex.spad @ line 354 op = 'PRIME => formatSpecial('SUPERSUB, [first args, " "::E, second(args)], prec) makes it even worse. One might change " "::E to hspace(1), but the ugly ",,," will remain (I'd prefer ''' ;). In the console it looks ok. > Wouldn't it make more sense to store it as (PRIME f 3) and let the > Formatter deal with how it is shown? Here eq1::OutputForm does too much. > In other words, I would be in favour of moving the code > > add_prime(a : %, s : %) : % == convert [eform 'PRIME, a, s] > prime(a, nn) == (s := new(nn, char ","); add_prime(a, sform s)) > > away from OutputForm and simply say something like > > prime(a, nn) == > if a is of form (PRIME x n) then > (PRIME x n+nn) > else > (PRIME a nn) > > Then i-output.boot or the various Formatters would have to deal with > translating that s-expression into something nice. Indeed, this would simplify the construction of a reasonable LaTeX string. Moreover it could provide more flexibility (in TexFormat) for multivariate functions as well (e.g. f_x, f_y instead of only f_{,1}, f_{,2}). > > 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/1fb132e8-5dad-c1d0-f234-24382c521621%40gmail.com.
