octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Latex interpreter via Mathjax + Qt


From: George Apostolopoulos
Subject: Re: Latex interpreter via Mathjax + Qt
Date: Fri, 29 Jan 2016 16:02:20 +0200

On Fri, 2016-01-29 at 13:59 +0100, Pantxo Diribarne wrote:
> 
> 
> 2016-01-28 17:35 GMT+01:00 Pantxo Diribarne
> <address@hidden>:
>         
>         
>         2016-01-28 16:49 GMT+01:00 George Apostolopoulos
>         <address@hidden>:
>                 On Wed, 2016-01-13 at 01:36 -0800, Pantxo wrote:
>                 > Michael Godfrey wrote
>                 > > On 01/12/2016 11:58 AM, George Apostolopoulos
>                 wrote:
>                 > >> I have reviewed octave's latex+ps combination
>                 which is very interesting.
>                 > >> However, apart from the added processing steps, I
>                 am missing the
>                 > >> possibility to create a single, self-contained
>                 eps file for one figure.
>                 > >> This is required when sending a manuscript to
>                 publishers.
>                 > > I am a bit surprised by this. I cannot remember a
>                 publisher requiring
>                 > > eps. As far as I know the publishers take PDF or
>                 as needed jpeg.
>                 > > This is generally in the scientific literature, or
>                 even IEEE, for example.
>                 > > For various reasons PS and EPS seem to be on the
>                 way out. But, if there
>                 > > is still a need they should be supported.
>                 > >
>                 > > In any case, thanks for taking an interest in
>                 this. Anything that you
>                 > > can do will surely be helpful.
>                 > >
>                 > > Best,
>                 > > Michael
>                 >
>                 > @Michael: in physics at least, there are still many
>                 important publishers
>                 > that prefer eps (e.g. [1, 2]) figure format.
>                 >
>                 > @George: you can produce a standalone eps file using
>                 latex and dvips, e.g.;
>                 > plot (1:10)
>                 > print -depsstandalone foo.tex
>                 > system ("latex foo.tex; dvips foo.dvi -o foo.eps")
>                 >
>                 > But I still think not having to rely on latex being
>                 installed to support
>                 > latex interpreter would be great! Looking forward to
>                 hearing from your
>                 > tests.
>                 >
>                 > Pantxo
>                 >
>                 > [1] IOP :
>                 http://publishing.aip.org/authors/preparing-graphics
>                 > [2] APS (physical review letters and others):
>                 >
>                 
> http://journals.aps.org/authors/tips-authors-physical-review-physical-review-letters
>                 >
>                 >
>                 >
>                 >
>                 > --
>                 > View this message in context:
>                 
> http://octave.1599824.n4.nabble.com/Latex-interpreter-via-Mathjax-Qt-tp4674346p4674370.html
>                 > Sent from the Octave - Maintainers mailing list
>                 archive at Nabble.com.
>                 >
>                 
>                 I finally found the time to put together a test of Qt
>                 + OpenGL + file
>                 output. The results are not encouraging ....
>                 1) The rendering of svg/mathjax on the QGLWidget is
>                 not satisfactory. It
>                 appears to be rasterized.
>                 2) The gl2ps file output does not contain any of the
>                 graphics produced
>                 by Qt painter on the widget. See attached screenshot.
>                 
>                 You can view the test project on
>                 https://github.com/gapost/qgl2ps
>                 
>                 Any ideas are welcome.
>                 
>                 George
>                 
>                 
>                 
>         Unfortunately the first point explains the second: Qt somewhat
>         produces a pixmap that must be rendered on-screen using opengl
>         texture which in turn is not captured by gl2ps (e.g. Octave
>         directly passes images to gl2ps, not through the feedback
>         buffer).
>         
>         
>         You could still parse and draw the svg using opengl primitives
>         (using an external library like
>         https://github.com/micahpearlman/MonkSVG is probably overkill)
>         but this is  harder work than the original project (and
>         probably slow).
>         
>         
>         Pantxo
>         
> @George: did you take a look at this https://github.com/zackr/qt_svg ?
> It renders any svg file on an opengl canvas. I produced the same svg
> equation as yours (using latex/dvisvgm) and at least the on-screen
> output is much better. What differs from what you have done? Is it
> still raster image or opengl primitives?
> 
> 
> Pantxo 
> 
@Panxto: I looked at their code, they do the same thing as I did, i.e.
use a class named "QtSvgRenderer" to draw the svg image on a QGLWidget.
The only difference is that they set an option "HighQualityAntiAliasing"
which is probably why it looks better. I do not know how Qt actually
does the svg rendering, I could look in their source code.

George


reply via email to

[Prev in Thread] Current Thread [Next in Thread]