> ++ \spad{scripts(f, l)} where l is ++ \spad{[sub, super, presuper,
> presub]} creates a form ++ for f with scripts on all 4 corners. If
> l has less ++ than 4 elements corresponding script is absent.
Yes.
>> but wouldn't it be simpler to have
>>
>> rsl : List(L) := [ss.sub, ss.sup, ss.presup, ss.presub] sl: List L
>> := [commaSeparate z for z in rsl | not empty? z x0 :=
>> outputForm(name(x) pretend Symbol) x1 := scripts(x0, sl)
> That would not do: we can only skip scripts at the end.
Ooops. I was too quick. :-(
rsl : List(L) := [ss.sub, ss.sup, ss.presup, ss.presub]
while not empty? rsl and empty? first rsl repeat rsl := rest rsl
sl: List L := [commaSeparate z for z in rsl]
> And we have to skip scripts because otherwise we would get ugly
> output.
Well... can you give an example?
Looking at
http://axiom-wiki.newsynthesis.org/SandBoxScriptedSymbol
\begin{axiom}
L ==> List OutputForm;
rsl: List L := [[x1::OutputForm],[],[],[]];
sl: L := [commaSeparate(z)$OutputForm for z in rsl];
of: OutputForm := scripts(v::OutputForm, sl)$OutputForm;
tex(of)
sy: Symbol := script('v,[[x1::OutputForm],[],[],[]]);
tex(sy::OutputForm)
\end{axiom}
doesn't show me a technical difference in the TeX output.
So my while loop above is not necessary.
For my TexFormat it doesn't matter anyway, since it yields
\SCRIPTS{\SYMBOL{v}}{\SYMBOL{x1}}{}{}{}
which translates to
\tensor*[^{}_{}]{v}{_{x1}^{}}
is handled nicely by the tensor.sty package.
> We can omit test for '#sl = 1'. I special case '#si = 1' because
> this leads to different OutputForm and I wanted maximal compatibility
> with old code (which did the same).
OK, but eventually OutputForm should not have so many special cases.
In fact, also the treatment of scripted symbols in Symbol is somewhat
strange. It encodes the numbers of sub/super/presuper/presub scripts
into the name of the symbol, and then concats all scripts into a flat
list. Why not storing something like script('a, [[x1,x2],[y1],[z1,z2]]) as
(a (x1 x2) (y1) (z1 z2))
? If that is a performance issue when comparing symbols then we should
think of creating a hashtable for scripted symbols (indexed by Lisp
symbols). So all elements of Symbol are lisp symbols but some of them
appear in the hash table and would have to be translated into scripted
symbols at output time.
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.