tag:blogger.com,1999:blog-9266717.post6790578728995645299..comments2021-02-10T15:42:13.225-04:00Comments on Only Python: svg mathematical equationAndré Robergehttp://www.blogger.com/profile/08131391818998844540noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-9266717.post-48537336834798489732013-06-01T18:35:36.014-03:002013-06-01T18:35:36.014-03:00How did you achieve this?How did you achieve this?Yinglaihttps://www.blogger.com/profile/18159872721908731749noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-61806656096436700072009-04-04T20:46:00.000-03:002009-04-04T20:46:00.000-03:00@Anonymous:As I wrote in a previous comment, this ...@Anonymous:<BR/><BR/>As I wrote in a previous comment, this is just the result of a quick hack, using matplotlib. If you search for "docpicture" on code.google.com, you will find the code I used. Perhaps after the summer is over someone will have extracted the relevant code from matplotlib as a Google Summer of Code project. I'm just guessing, as I have no connection to the matplotlib project.André Robergehttps://www.blogger.com/profile/08131391818998844540noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-13696666658800342372009-04-04T20:17:00.000-03:002009-04-04T20:17:00.000-03:00is this available? I would love to be able to use ...is this available? I would love to be able to use it to display an equation in a Traits based applicationAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-9266717.post-48568846422954706532008-10-30T18:16:00.000-03:002008-10-30T18:16:00.000-03:00@mdboom: I'm not sure I could contribute much of ...@mdboom: I'm not sure I could contribute much of a patch to matplotlib; I just did a quick hack, without diving into the source of matplotlib at all.<BR/><BR/>I'd be interested to see your notes about extracting the TeX engine. While I doubt I'd be able to do this quickly, given that you had planned a whole SoC project for it (and I'm only working on this as a hobby, a few nights a week at best), I might be eventually able to do it, or get enough of a start to help a student complete it next summer.André Robergehttps://www.blogger.com/profile/08131391818998844540noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-10531545175288957492008-10-30T11:49:00.000-03:002008-10-30T11:49:00.000-03:00Probably also worth mentioning here:We had a Googl...Probably also worth mentioning here:<BR/><BR/>We had a Google SoC project this year to extract the math rendering engine from matplotlib and make it more standalone (and replace some of the compiled extensions with pure Python where possible). Unfortunately, the student got a "real job" just a few days into it, so it never got done. But I have detailed notes and a suggested plan of attack if anyone is interested in taking this on...Michael Droettboomhttps://www.blogger.com/profile/01218345860953044412noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-45327481631480155592008-10-30T11:22:00.000-03:002008-10-30T11:22:00.000-03:00It's rewarding to see this! We'd happily accept a...It's rewarding to see this! We'd happily accept a patch to matplotlib based on your work to make writing SVG math expressions more convenient.<BR/><BR/>@brandon:<BR/>matplotlib contains a Python "port" of a subset of the TeX math layout algorithms. I wrote it with the book "Computers and Typesetting, Volume B: TeX: The Program" (which is basically the annotated source code of TeX) sitting on my desk. There was no way I was going to improve on what had already been worked out there.<BR/><BR/>matplotlib is able to use the Computer Modern fonts (converted to TrueType), the newer STIX mathematical fonts, or any arbitrary TrueType font with a Unicode mapping (though few general-purpose fonts have all the necessary characters).<BR/><BR/>@stelt: Until SVG fonts are widely supported (i.e. in Firefox), that approach was a non-starter for us. Instead, matplotlib embeds the character outlines as paths in the SVG. Certainly SVG fonts will be a better option in the future when they are practical -- but it's a bit of a chicken/egg problem right now.Michael Droettboomhttps://www.blogger.com/profile/01218345860953044412noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-6856082995394154382008-10-30T10:12:00.000-03:002008-10-30T10:12:00.000-03:00I was about to roll my eyes at the thought of some...I was about to roll my eyes at the thought of someone else taking on the problem of rendering mathematical functions, after Donald Knuth spend years solving the problem correctly the first time in the 1970s... and then I thought: "Hey, wait! Are those the Computer Modern fonts I see staring out of this SVG image in my web browser?"<BR/><BR/>Are they? Does matplotlib somehow have TeX "inside", so that we're benefitting here from all the work Knuth did in the 1970s to create a perfect mathematical typesetting system?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9266717.post-65734021322396037132008-10-30T07:16:00.000-03:002008-10-30T07:16:00.000-03:00Maybe use SVG fonts for accessibility?For copy/pas...Maybe use SVG fonts for accessibility?<BR/>For copy/paste and readability purposes.Ruud Steltenpoolhttps://www.blogger.com/profile/06049882271100102394noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-81906871101566632232008-10-30T07:15:00.000-03:002008-10-30T07:15:00.000-03:00I tried embedding it, but the simple attempt I did...I tried embedding it, but the simple attempt I did was unsuccessful.André Robergehttps://www.blogger.com/profile/08131391818998844540noreply@blogger.comtag:blogger.com,1999:blog-9266717.post-79542909857413751562008-10-30T07:13:00.000-03:002008-10-30T07:13:00.000-03:00Why download and open?Why not just put it right in...Why download and open?<BR/><BR/>Why not just put it right in this blog?<BR/>If blogger.com makes this impossible, complain !!Ruud Steltenpoolhttps://www.blogger.com/profile/06049882271100102394noreply@blogger.com