On Monday 16 July 2007 02:32:30 pm John Hunter wrote: > On 7/16/07, Michael Droettboom <[EMAIL PROTECTED]> wrote: > > I'm working on some improvements to the mathtext engine on a branch. > > Feel free to join in if curious, but I expect to break lots of things as > > I go. > > > > https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/mathte > >xt_mgd/ > > > > I've collected a bunch of math expressions from the source tree for use > > in regression testing. If you have any math strings of your own that > > you want to make sure I don't break, please send them to me (probably > > should be off-list to conserve noise). > > > > Here's the preliminary TODO list I'm working with in no particular order > > (compiled from the TODO list in mathtext.py and the list of improvements > > in mathtext2.py): > > > > 1. Deal with nested sub/superscripts, such as $x_i_j$, equivalent to > > $x_{i_j}$ > > Hmm, I thought that already worked -- it's been a long time since I > touched that code. What is the problem here?
I think $x_i_j$ is ambiguous. Maybe it is best to stick to Knuth-approved syntax. > > 2. Make the font change tags (\cal, \tt, \rm etc.) behave more like TeX, > > e.g. use ${\rm sin}$ instead of $\rm{sin}$ Would it be possible to include the latex equivalents, like \textrm{} (its not {\textrm ...}), \texttt{}, \textit{}... ? They are more familiar to some of us (like latex's \frac{1}{2} is more familiar than tex's {1\over 2}). > > 3. Support roman function names, e.g. $\sin$ as a shortcut for ${\rm > > sin}$ 4. Implement \frac > > 5. Other layout commands, like large \sqrt (I suspect there's a very > > large list of these things and they will have to be prioritized.) > > You will probably want to implement some primitive drawing in the > ft2font pixel buffer, to support things like a \frac bar (\frac would > be nice BTW) Is mpl's mathtext guided by the algorithms published in "Computers and Typesetting, TeX: The Program"? > > 6. Support kerning (probably best put off until we have good fonts with > > kerning information to use, e.g. STIX fonts) > > Ha, STIX, never made a deadline they could keep. Given their response > to Eric's inquiry, we could be waiting quite a while. They claim their website will be updated the week of July 9. They don't indicate what year. > > (1 and 2 are already implemented in the branch.) > > > > I don't want to start a long thread about all the desired features for > > mathtext -- I'm sure there are lots of them. There will need to be some > > How about a short one :-) I think one of the most important > enhancements will be to support embedded mathtext expressions, eg > > r'some text $\sigma=1$ some more text' > > Currently we have to do something like > > r'$\rm{some text\ }\sigma=1\rm{\ some more text}$' I agree, this is sorely lacking. > which is pretty bad. This might require some changes to how mathtext > is identified -- the presence of an even number of dollar signs is > probably sufficient, but in some corner cases might give the wrong > results, requiring a flag to overrride, etc. THat or we simply adopt > the TeX standard and require all literal $ to be quoted. THe latter > wil break some code but is probably better than anything else. I think we should stick to the (La)TeX standard. The algorithms are available, stable (when was the last time Donald Knuth had to fix a bug in TeX?), and the syntax is familiar. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel