From: Robert D. <rob...@gm...> - 2015-12-12 01:38:58
|
On 2015-12-11, Roland Salz <ma...@ro...> wrote: > I would like to propose consideration of the following mechanism as a > possible solution to resolve these handicaps of present maxima. Bold as well > as sub-/superscripted identifiers are encoded by wxmaxima into simple > character strings, then being passed to maxima as the corresponding > identifier names. I dunno. Instead of encoding display stuff into the name, a more natural Maxima-ish solution would be to define expressions and then write display code for them. E.g. presuper(A, k) => k before and above A, presub(A, k) => k before and below A, etc. Writing display code is somewhat obscure but it could probably be largely adapted from existing stuff -- e.g. DIMENSION-SUPERSCRIPT in src/displa.lisp. I believe wxMaxima has its own display system so some hacking is necessary there too. Probably the easiest display system to handle would be Maxima's 'tex' function, since it's only necessary to generate the appropriate output and TeX will handle the rest. This is easy to arrange via 'texput'. As for properties such as bold or special fonts, presumably it's enough to attach such properties to the main symbol (e.g. A in the above example), or to use a suitable character set (e.g. to get the aleph for aleph-null or whatever). For another look at displaying such stuff, take a look at MathML, which amounts to an expression representation using XML syntax. See e.g.: http://www.w3.org/TR/REC-MathML/chap3_4.html Some Maxima functions handle expressions as variables (e.g. diff, integrate, solve) which means that presuper(A, k), etc would be OK as variables, but others don't (e.g. taylor); I think that's a bug. On a related note, maybe we'd like presuper(A, k), etc to be considered mapatoms (i.e. more like symbols than expressions). best, Robert Dodier |