SourceForge logo
SourceForge logo
Menu

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

From: Jae-Joon L. <lee...@gm...> - 2008年08月29日 16:04:38
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 backend. Although this seems fine to me, I'll see if
I can extract the depth of the text without running the dvipng.
Regards,
-JJ
On Fri, Aug 29, 2008 at 7:59 AM, Michael Droettboom <md...@st...> wrote:
> 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 & = 2
> y & = 2
> \end{align}
>
> Plus, Sphinx is BSD-licensed, so it should be fine to copy-and-paste
> whatever code is necessary.
>
> Of course, latex-preview is required to be installed, but I think it's a
> pretty common package.
>
> See here:
>
> http://svn.python.org/projects/doctools/trunk/sphinx/ext/pngmath.py
>
> Cheers,
> Mike
>
> Jae-Joon Lee wrote:
>>
>> On Thu, Aug 28, 2008 at 4:18 PM, John Hunter <jd...@gm...> wrote:
>>
>>>
>>> On Thu, Aug 28, 2008 at 2:57 PM, Jae-Joon Lee <lee...@gm...>
>>> 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; what we need to do is a clean
>>> room implementation with no copying. You can best answer that, so if
>>> you tell us your patch is cleanly implemented, we can accept it.
>>>
>>> JDH
>>>
>>>
>>
>> Thanks for the response.
>>
>> Well, the only part I borrowed from PyX is TeX related commands they
>> use (there is not much of implementation as far as TeX-related code is
>> concerned). From their code, I learned the meaning and usage of the
>> following TeX commands
>>
>> \newbox
>> \setbox
>> \immediate\write16
>>
>> And I used the same TeX commands in my code.
>> But I personally think this is not a (code) copy.
>>
>> Other than this, the code is clean.
>> Regards,
>>
>> -JJ
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>
>

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /