Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-09-02 Thread Jae-Joon Lee
Here is a patch which uses a preview package. It uses a showbox option in the preview package, with a slight tweak (this only patches the texmanager.py. You still need to apply the agg backend patch in my previous post). It would be good if this patch will be accepted, but the extra requirement of

Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-09-02 Thread Chris Walker
Jae-Joon Lee [EMAIL PROTECTED] writes: Here is a patch which uses a preview package. It uses a showbox option in the preview package, with a slight tweak (this only patches the texmanager.py. You still need to apply the agg backend patch in my previous post). It would be good if this patch

Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-08-29 Thread Michael Droettboom
Sphinx contains one way to do this in its new pngmath extension. It uses the LaTeX package preview which does all of this magic internally. And I believe it's a little more general. If I recall, the approach you're taking won't work with some LaTeX constructs such as: \begin{align} x

Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-08-29 Thread Jae-Joon Lee
Thanks, I quickly went through the code of the pngmath.py, and it seems that the depth(descent) of the dvi file is reported by dvipng (but the preview package must be used in the tex file for this to work correctly). Therefore, with this method, we need to run dvipng even if we use ps of pdf

[matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-08-28 Thread Jae-Joon Lee
Hello, AFAIK, current backends (I only tested agg, pdf, and ps) do not properly respect the text baseline when text is rendered using TeX. The get_text_width_height_descent() method in Agg and PS backends simply return 0 for the descent value. While PDF backend uses the dviread module to figure

Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-08-28 Thread John Hunter
On Thu, Aug 28, 2008 at 2:57 PM, Jae-Joon Lee [EMAIL PROTECTED] wrote: First of all, I borrowed this idea from the PyX which is in GPL. Although there is little of copying, other than the basic idea, I'm not 100% sure if this could be BSD-compatible. I think it is fine to borrow the idea;

Re: [matplotlib-devel] a patch to have a correct baseline when usetex=True

2008-08-28 Thread Jae-Joon Lee
On Thu, Aug 28, 2008 at 4:18 PM, John Hunter [EMAIL PROTECTED] wrote: On Thu, Aug 28, 2008 at 2:57 PM, Jae-Joon Lee [EMAIL PROTECTED] wrote: First of all, I borrowed this idea from the PyX which is in GPL. Although there is little of copying, other than the basic idea, I'm not 100% sure if