[julia-users] Re: LaTeX labels in Winston

2014-10-26 Thread Alex
Hi! I finally got around to push my code to github: https://github.com/acroy/Lasem.jl There is a directory winston, which contains two variants of replacing the Winston text-rendering functions. One version uses itex2mml + MathML rendering provided by Lasem, while the other version assumes tha

[julia-users] Re: LaTeX labels in Winston

2014-10-08 Thread Paweł Biernat
I think TikzPictures.jl [1] is what you are looking for, but it does not seem to work with Julia 0.4 out of the box (judging by the automatic PackageEvaluator issue it broke only recently [2]). I fixed the issue (at least I think I did) and it now works as expected so you can get it from my fo

[julia-users] Re: LaTeX labels in Winston

2014-10-08 Thread Alex
I have not tested the speed of lasme, but using it would very likely be slower than the current code since it has to convert tex to mathml and then parse that to render the formula. I guess for most use cases one could optimize this difference almost away by caching the mathml (DOM) or even the

[julia-users] Re: LaTeX labels in Winston

2014-10-08 Thread Paweł Biernat
I would definitely be an improvement over the current text renderer. By the way, do you have an idea of how will it affect the speed of plotting? On the other hand, what is the main reason for not using the system LaTeX renderer and use lasme (or any other built-in renderer) as a fallback? I

[julia-users] Re: LaTeX labels in Winston

2014-10-08 Thread Alex
So lasme+Winston would look like in the attached picture. There are still some rough edges: I am not sure the alignment and bounding boxes for the rotated text are correct and the fontsize is fixed to whatever lasme gives back (I think it is 10pt). The nice thing is that one could use almost the

[julia-users] Re: LaTeX labels in Winston

2014-10-02 Thread Alex
Hi, I think lasem (https://github.com/GNOME/lasem) could actually be useful until we have our own rendering engine. It uses Cairo+Pango as backend(s) and can actually deal with SVG, MathML and also latex input (via itex2mml). The dependencies are not so horrible (gobject, glib, gio, gdk-pixbuf,

[julia-users] Re: LaTeX labels in Winston

2014-09-29 Thread Alex
Ok, maybe mimetex is not exactly what we need (seems there is no way to control the resolution of the output image). But it was fun to play with :-) julia> using MimeTeX julia> tex2raster("f(x)=\\int_{-\\infty}^x e^{-t^2}dt",2) ⠀⢀⡀⠀⠐⢹⠉⠃⠀⣀⠀ ⠀⠀⢀⠤

[julia-users] Re: LaTeX labels in Winston

2014-09-28 Thread Alex
Yes, mimetex only produces bitmaps, which is not really optimal. Ideally we want something that yields vector graphics. But maybe mimetex is worth a try anyways ... (as Pawel said until we have something better). Best, Alex. On Sunday, 28 September 2014 14:57:31 UTC+2, Andreas Lobinger wrote:

[julia-users] Re: LaTeX labels in Winston

2014-09-28 Thread Andreas Lobinger
mimetex seems to be output=gif only. Is this what we want?

[julia-users] Re: LaTeX labels in Winston

2014-09-28 Thread Alex
That sounds like a reasonable approach to try. I think one way to do this might be 1. Wrapping mimetex into a package to use it from Julia. Maybe one could turn it into a shared library first (there seems to be a DLL version already)? This might be useful also for other purposes. 2. Find some

[julia-users] Re: LaTeX labels in Winston

2014-09-27 Thread Paweł Biernat
I found out that mimetex [1] produces images of reasonable quality, is small and has no dependencies. Do you think it could be used as a temporary solution until a TeX parser is implemented? [1] http://www.forkosh.com/mimetex.html W dniu sobota, 20 września 2014 08:50:38 UTC+2 użytkownik Andre

[julia-users] Re: LaTeX labels in Winston

2014-09-19 Thread Andreas Lobinger
Just to note, the file starts with a header: matplotlib.mathtext is a module for parsing a subset of the TeX math syntax gtkmathview does not seem to be maintained anymore. On the js side there is http://khan.github.io/KaTeX/

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Steven G. Johnson
On Thursday, September 18, 2014 3:55:41 PM UTC-4, Alex wrote: > > Maybe one could have a look at matplotlib to get an idea how they do this? Matplotlib implemented its own LaTeX parser and renderer (about 3000 lines of code): https://github.com/matplotlib/matplotlib/blob/master/lib/matplotl

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Alex
Hi Andreas, >From time to time I was also thinking that the equation rendering should be >doable somehow... In the end, this usually led me to the conclusion that it is >probably not so easy. For instance, Searching for MathML rendering doesn't >give very many hits (GtkMathView seems to use Pan

Re: [julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Tim Holy
Thanks for a great contribution! --Tim On Thursday, September 18, 2014 10:26:58 AM Paweł Biernat wrote: > I have added a pull request: https://github.com/nolta/Winston.jl/pull/174, > if you have any further suggestions of what should I include feel free to > send them there. > > Best, > Paweł >

Re: [julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Paweł Biernat
I have added a pull request: https://github.com/nolta/Winston.jl/pull/174, if you have any further suggestions of what should I include feel free to send them there. Best, Paweł W dniu czwartek, 18 września 2014 13:37:44 UTC+2 użytkownik Tim Holy napisał: > > Paweł, there's no one better than

Re: [julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Tim Holy
Paweł, there's no one better than you to do that! Everyone here is a volunteer, and contributing documentation is a terrific way to help out. If you just grep for latex in the Winston source, that should help you find all the relevant information. Best, --Tim On Thursday, September 18, 2014 02

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Andreas Lobinger
It's there in fine print: The typesetting of MathML is done via a component of firefox and then rendered via Cairo/Pango.

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Andreas Lobinger
Hello colleague, on one of these rainy sunday afternoons i sat there and thought: Hey, this can't be that complicated... Math type setting (still) seems to be some black art and an awful of heuristics are put into code and only there. So there is no material in algorithmic form available that

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Paweł Biernat
Thanks, this is missing from the documentation of the Winston package. Maybe someone should add a short info on the typesetting options, so people won't have to go to the mailing list to figure it out. As for Pango rendering MathML there is an example at the end of the script gallery [1]. But

[julia-users] Re: LaTeX labels in Winston

2014-09-18 Thread Paweł Biernat
Well, the PGFPlot certainly produces nicer plots but I can't use them in REPL properly. The function plot() works and displays a plot, but I cannot add any annotations (Axis,Title etc.). Maybe I am missing something from the tutorial you linked to. W dniu czwartek, 18 września 2014 00:01:25 U

[julia-users] Re: LaTeX labels in Winston

2014-09-17 Thread Alex
Hi Pawel, AFAIK the rendering of the labels is actually handled by Cairo.jl (look for tex2pango in Cairo.jl ). There some TeX commands (\it, \rm, _, ^, etc) are translated into Pango markup format

[julia-users] Re: LaTeX labels in Winston

2014-09-17 Thread Kaj Wiik
Hmm, sorry, you asked about general LaTeX. I confirm that at least \frac does not work. Have you tried PGFPlots: http://nbviewer.ipython.org/github/sisl/PGFPlots.jl/blob/master/doc/PGFPlots.ipynb https://github.com/sisl/PGFPlots.jl Kaj On Thursday, September 18, 2014 12:47:24 AM UTC+3, Kaj Wii

[julia-users] Re: LaTeX labels in Winston

2014-09-17 Thread Paweł Biernat
But it does not look like LaTeX is actually used in this example, especially if you cannot use \frac and other commands. Or maybe this is some restricted version of LaTeX. W dniu środa, 17 września 2014 23:47:24 UTC+2 użytkownik Kaj Wiik napisał: > > Hi! > > It works fine with version 0.3.0 Ubu

[julia-users] Re: LaTeX labels in Winston

2014-09-17 Thread Kaj Wiik
Hi! It works fine with version 0.3.0 Ubuntu 14.04: On Wednesday, September 17, 2014 11:59:38 PM UTC+3, Paweł Biernat wrote: > > Hi, > > Is it possible to use LaTeX labels in Winston? In the e