[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 that pdflatex 
and pdf2svg are installed. The resulting SVG is then displayed using Lasem. 
Both versions still require some work (resolution settings, bounding boxes, 
caching, clean up). Comments & PRs are very welcome.

Best,

Alex.


[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 
fork [3] until it is merged.  You are going to need pdf2svg (I didn't have 
it and got strange errors).  I guess that it will be much slower, as you 
said, but at least it is something you can use to compare with other 
solutions.

[1] https://github.com/sisl/TikzPictures.jl
[2] https://github.com/sisl/TikzPictures.jl/issues/1
[3] https://github.com/pwl/TikzPictures.jl

W dniu środa, 8 października 2014 11:00:54 UTC+2 użytkownik Alex napisał:
>
> 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 rendered images. This approach will not help if you have to plot many 
> different labels though.
>
> The problem with using LaTeX is probably (a) it is a huge dependency 
> (although most of us will have it installed anyways), (b) that everything 
> has to go via the filesystem(?) and (c) that LaTeX itself is not famous for 
> being fast :-) Using caching etc this might be not so dramatic for typical 
> situations though. 
>
> If you have some code which gives me a SVG from a LaTeXString I can try 
> this out (maybe PGFPlots.jl has already something in place?). Meanwhile I 
> will try to clean up my code and put it on github ...
>
> Best,
>
> Alex.
>
> On Wednesday, 8 October 2014 10:21:57 UTC+2, Paweł Biernat wrote:
>>
>> 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 
>> get that on some (most?) systems LaTeX is not installed but if it is why 
>> not use it?
>>
>> Best,
>> Paweł
>>
>

[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 rendered images. This approach will not help if you have to plot many 
different labels though.

The problem with using LaTeX is probably (a) it is a huge dependency 
(although most of us will have it installed anyways), (b) that everything 
has to go via the filesystem(?) and (c) that LaTeX itself is not famous for 
being fast :-) Using caching etc this might be not so dramatic for typical 
situations though. 

If you have some code which gives me a SVG from a LaTeXString I can try 
this out (maybe PGFPlots.jl has already something in place?). Meanwhile I 
will try to clean up my code and put it on github ...

Best,

Alex.

On Wednesday, 8 October 2014 10:21:57 UTC+2, Paweł Biernat wrote:
>
> 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 
> get that on some (most?) systems LaTeX is not installed but if it is why 
> not use it?
>
> Best,
> Paweł
>


[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 
get that on some (most?) systems LaTeX is not installed but if it is why 
not use it?

Best,
Paweł

W dniu środa, 8 października 2014 09:56:44 UTC+2 użytkownik Alex napisał:
>
> 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 
> same
> code to render formulas and text with real latex, convert the output to 
> svg and display the svgs since lasme also supports svgs. I guess this route 
> is not very fast though (one would need to cache the svgs somehow).
>
> Best,
>
> Alex.
>
>>
>
> 
>
>

[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 
same
code to render formulas and text with real latex, convert the output to svg 
and display the svgs since lasme also supports svgs. I guess this route is 
not very fast though (one would need to cache the svgs somehow).

Best,

Alex.

>




[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, gdk, 
cairo, pangocairo, libxml, bison, flex), at least if one is using Gtk.jl 
anyways.

Accessing it from Julia was actually quite easy (see below). If there is 
some interest we could turn this into a package to explore this direction 
further ...

Best,

Alex.


 







[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:
>
> mimetex seems to be output=gif only. Is this what we want?
>


[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 way to allow alternative text rendering in Winston/Cairo (maybe 
Mike or Tim have some suggestions?). Maybe we could have an abstract 
TextRenderer type. The current Pango-based routines would then belong to  
PangoTextRenderer. Then we could have a MimeTeXRenderer, which renders text and 
fomrulae to bitmaps and shows those instead.


Best,

Alex.



On Saturday, 27 September 2014 11:57:29 UTC+2, Paweł Biernat  wrote:
> 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 Andreas Lobinger 
> napisał:
> 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-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 Andreas Lobinger 
napisał:
>
> 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-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/matplotlib/mathtext.py


[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 Pango to render MathML). Going 
>the other route (via latex/mathjax) might actually be easier, but requires 
>quite some stuff to be installed. Also if one has a nice svg renderer and 
>requires latex anyways one might  as well use pgfplot et al for the whole plot?

Maybe one could have a look at matplotlib to get an idea how they do this?

Best,

Alex.


On Thursday, 18 September 2014 11:11:52 UTC+2, Andreas Lobinger  wrote:
> 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 could be re-implemented somewhere. I mean, 
> even TeX itself is available only a literate programming.
> 
> So options i considered:
>  * wait until it's integrated in Pango (you will wait a long time)
>  * try to integrate a latex/pdflatex run to produce dvi or pdf and use that. 
> And find a dvi or pdf to cairo renderer.
>  * run mathjax.js via a java script engine to svg and use Rsvg or similat to 
> render on cairo.
>  * rewrite mathjax.js in julia (might have licensing issues).
> 
> 
>  



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ł
> 
> W dniu czwartek, 18 września 2014 13:37:44 UTC+2 użytkownik Tim Holy
> 
> napisał:
> > 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:07:01 AM Paweł Biernat wrote:
> > > 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 I couldn't figure out how they achieved this as I
> > 
> > don't
> > 
> > > know Cairo/Pango at all.
> > > 
> > > [1] http://www.pango.org/ScriptGallery
> > > 
> > > W dniu czwartek, 18 września 2014 08:16:33 UTC+2 użytkownik Alex
> > 
> > napisał:
> > > > Hi Pawel,
> > > > 
> > > > AFAIK the rendering of the labels is actually handled by Cairo.jl
> > 
> > (look
> > 
> > > > for tex2pango in Cairo.jl
> > > > <
> > 
> > https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJuliaLang%2FCairo
> > 
> > 
.jl%2Fblob%2Fmaster%2Fsrc%2FCairo.jl&sa=D&sntz=1&usg=AFQjCNF3Cp9Rz43PyR88F
> > 
> > > > NO1BoKYIulrjg>). There some TeX commands (\it, \rm, _, ^, etc) are
> > > > translated into Pango markup format
> > > > .
> > > > Additionally many/most TeX symbols are converted into unicode. More
> > > > sophisticated commands, like \frac, are not handled at the moment.
> > > > 
> > > > It would be great to have more complete support, but I guess it is not
> > 
> > so
> > 
> > > > easy since it would require a custom typesetting system (or one
> > 
> > delegates
> > 
> > > > the rendering to some external program, but then all the text has to
> > 
> > go
> > 
> > > > through this). Maybe there is some TeX/MathML engine using Pango one
> > 
> > could
> > 
> > > > use?
> > > > 
> > > > 
> > > > Best,
> > > > 
> > > > Alex.
> > > > 
> > > > On Wednesday, 17 September 2014 22:59:38 UTC+2, Paweł Biernat wrote:
> > > >> Hi,
> > > >> 
> > > >> Is it possible to use LaTeX labels in Winston?  In the examples.jl
> > 
> > there
> > 
> > > >> is a point [1] where some LaTeX-like syntax is used in a label.
> > > >> 
> > > >> I was trying to push "$\frac{1}{2}$" as a label and already tested
> > > >> various escaped versions, including "\$\\frac{1}{2}\$" and
> > 
> > "\\frac{1}{2}"
> > 
> > > >> but I didn't achieve the expected result.
> > > >> 
> > > >> [1]
> > 
> > https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
> > 
> > > >> 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 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:07:01 AM Paweł Biernat wrote: 
> > 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 I couldn't figure out how they achieved this as I 
> don't 
> > know Cairo/Pango at all. 
> > 
> > [1] http://www.pango.org/ScriptGallery 
> > 
> > W dniu czwartek, 18 września 2014 08:16:33 UTC+2 użytkownik Alex 
> napisał: 
> > > Hi Pawel, 
> > > 
> > > AFAIK the rendering of the labels is actually handled by Cairo.jl 
> (look 
> > > for tex2pango in Cairo.jl 
> > > <
> https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FJuliaLang%2FCairo 
> > > 
> .jl%2Fblob%2Fmaster%2Fsrc%2FCairo.jl&sa=D&sntz=1&usg=AFQjCNF3Cp9Rz43PyR88F 
> > > NO1BoKYIulrjg>). There some TeX commands (\it, \rm, _, ^, etc) are 
> > > translated into Pango markup format 
> > > . 
> > > Additionally many/most TeX symbols are converted into unicode. More 
> > > sophisticated commands, like \frac, are not handled at the moment. 
> > > 
> > > It would be great to have more complete support, but I guess it is not 
> so 
> > > easy since it would require a custom typesetting system (or one 
> delegates 
> > > the rendering to some external program, but then all the text has to 
> go 
> > > through this). Maybe there is some TeX/MathML engine using Pango one 
> could 
> > > use? 
> > > 
> > > 
> > > Best, 
> > > 
> > > Alex. 
> > > 
> > > On Wednesday, 17 September 2014 22:59:38 UTC+2, Paweł Biernat wrote: 
> > >> Hi, 
> > >> 
> > >> Is it possible to use LaTeX labels in Winston?  In the examples.jl 
> there 
> > >> is a point [1] where some LaTeX-like syntax is used in a label. 
> > >> 
> > >> I was trying to push "$\frac{1}{2}$" as a label and already tested 
> > >> various escaped versions, including "\$\\frac{1}{2}\$" and 
> "\\frac{1}{2}" 
> > >> but I didn't achieve the expected result. 
> > >> 
> > >> [1] 
> https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18 
> > >> 
> > >> Best, 
> > >> Paweł 
>
>

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:07:01 AM Paweł Biernat wrote:
> 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 I couldn't figure out how they achieved this as I don't
> know Cairo/Pango at all.
> 
> [1] http://www.pango.org/ScriptGallery
> 
> W dniu czwartek, 18 września 2014 08:16:33 UTC+2 użytkownik Alex napisał:
> > Hi Pawel,
> > 
> > AFAIK the rendering of the labels is actually handled by Cairo.jl (look
> > for tex2pango in Cairo.jl
> >  > 
.jl%2Fblob%2Fmaster%2Fsrc%2FCairo.jl&sa=D&sntz=1&usg=AFQjCNF3Cp9Rz43PyR88F
> > NO1BoKYIulrjg>). There some TeX commands (\it, \rm, _, ^, etc) are
> > translated into Pango markup format
> > .
> > Additionally many/most TeX symbols are converted into unicode. More
> > sophisticated commands, like \frac, are not handled at the moment.
> > 
> > It would be great to have more complete support, but I guess it is not so
> > easy since it would require a custom typesetting system (or one delegates
> > the rendering to some external program, but then all the text has to go
> > through this). Maybe there is some TeX/MathML engine using Pango one could
> > use?
> > 
> > 
> > Best,
> > 
> > Alex.
> > 
> > On Wednesday, 17 September 2014 22:59:38 UTC+2, Paweł Biernat wrote:
> >> Hi,
> >> 
> >> Is it possible to use LaTeX labels in Winston?  In the examples.jl there
> >> is a point [1] where some LaTeX-like syntax is used in a label.
> >> 
> >> I was trying to push "$\frac{1}{2}$" as a label and already tested
> >> various escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}"
> >> but I didn't achieve the expected result.
> >> 
> >> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
> >> 
> >> Best,
> >> Paweł



[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 could be re-implemented somewhere. I mean, 
even TeX itself is available only a literate programming.

So options i considered:
 * wait until it's integrated in Pango (you will wait a long time)
 * try to integrate a latex/pdflatex run to produce dvi or pdf and use 
that. And find a dvi or pdf to cairo renderer.
 * run mathjax.js via a java script engine to svg and use Rsvg or similat 
to render on cairo.
 * rewrite mathjax.js in julia (might have licensing issues).


 





[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 I couldn't figure out how they achieved this as I don't 
know Cairo/Pango at all.

[1] http://www.pango.org/ScriptGallery

W dniu czwartek, 18 września 2014 08:16:33 UTC+2 użytkownik Alex napisał:
>
> 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 
> . 
> Additionally many/most TeX symbols are converted into unicode. More 
> sophisticated commands, like \frac, are not handled at the moment.
>
> It would be great to have more complete support, but I guess it is not so 
> easy since it would require a custom typesetting system (or one delegates 
> the rendering to some external program, but then all the text has to go 
> through this). Maybe there is some TeX/MathML engine using Pango one could 
> use?
>
>
> Best,
>
> Alex.
>
>
> On Wednesday, 17 September 2014 22:59:38 UTC+2, Paweł Biernat wrote:
>>
>> Hi,
>>
>> Is it possible to use LaTeX labels in Winston?  In the examples.jl there 
>> is a point [1] where some LaTeX-like syntax is used in a label.
>>
>> I was trying to push "$\frac{1}{2}$" as a label and already tested 
>> various escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" 
>> but I didn't achieve the expected result.
>>
>> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>>
>> Best,
>> Paweł
>>
>

[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 UTC+2 użytkownik Kaj Wiik 
napisał:
>
> 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 Wiik wrote:
>>
>> 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 examples.jl there 
>>> is a point [1] where some LaTeX-like syntax is used in a label.
>>>
>>> I was trying to push "$\frac{1}{2}$" as a label and already tested 
>>> various escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" 
>>> but I didn't achieve the expected result.
>>>
>>> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>>>
>>> Best,
>>> Paweł
>>>
>>

[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 . 
Additionally many/most TeX symbols are converted into unicode. More 
sophisticated commands, like \frac, are not handled at the moment.

It would be great to have more complete support, but I guess it is not so 
easy since it would require a custom typesetting system (or one delegates 
the rendering to some external program, but then all the text has to go 
through this). Maybe there is some TeX/MathML engine using Pango one could 
use?


Best,

Alex.


On Wednesday, 17 September 2014 22:59:38 UTC+2, Paweł Biernat wrote:
>
> Hi,
>
> Is it possible to use LaTeX labels in Winston?  In the examples.jl there 
> is a point [1] where some LaTeX-like syntax is used in a label.
>
> I was trying to push "$\frac{1}{2}$" as a label and already tested various 
> escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" but I 
> didn't achieve the expected result.
>
> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>
> Best,
> Paweł
>


[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 Wiik wrote:
>
> 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 examples.jl there 
>> is a point [1] where some LaTeX-like syntax is used in a label.
>>
>> I was trying to push "$\frac{1}{2}$" as a label and already tested 
>> various escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" 
>> but I didn't achieve the expected result.
>>
>> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>>
>> Best,
>> Paweł
>>
>

[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 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 examples.jl there 
>> is a point [1] where some LaTeX-like syntax is used in a label.
>>
>> I was trying to push "$\frac{1}{2}$" as a label and already tested 
>> various escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" 
>> but I didn't achieve the expected result.
>>
>> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>>
>> Best,
>> Paweł
>>
>

[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 examples.jl there 
> is a point [1] where some LaTeX-like syntax is used in a label.
>
> I was trying to push "$\frac{1}{2}$" as a label and already tested various 
> escaped versions, including "\$\\frac{1}{2}\$" and "\\frac{1}{2}" but I 
> didn't achieve the expected result.
>
> [1] https://github.com/nolta/Winston.jl/blob/master/test/examples.jl#L18
>
> Best,
> Paweł
>