SVGLatex installation

69 views
Skip to first unread message

Uroš Simović

unread,
Jun 26, 2009, 4:27:21 AM6/26/09
to svgkit
Hello.
I'm student of electrical engeeniring and we are working on project,
where we need solution for equations. We tried ASCIImathml, but than I
found svgkit. SVGLatex is doing really nice equations (demo on your
page).

But there is a problem. I realy dont know how to install svgkit on our
page? Why dont you have any documention? So, could you help me,
please. We have ubuntu server. What do we need to do on our server.
Please help. Project is powered by MediaWiki. I know mediawiki has
some solutions but we need .SVGs.

Here is another question. An example:
I made new page, where are some equations. SVGLatex will transform
this equations to svg, when page is loaded. Is there some kind of
cache, that page will be loaded quickier?

Thats it. Sorry for my english, it's not good.

Best regards

Uros Simovic
Student of Faculty of Electrical Engineering, Ljubljana, Slovenia
http://www.fe.uni-lj.si/welcome-E.html

Jason Gallicchio

unread,
Jun 26, 2009, 11:23:54 AM6/26/09
to svg...@googlegroups.com
It is not fully documented because it was never fully finished. The
features mentioned do all work. Sorry about that.

The first thing to do is look at the page

http://svgkit.sourceforge.net/SVGLaTeX.html

and install the software under "Server-Side Software Requirements"

Then to test the server-side software look at "Basic Procedure". Start
by making a new TeX file called eqn.tex with the example content and run
the three commands.

Once this is working, you need to get the apache web server to run
python CGI scripts -- basically having a cgi-bin directory with the
right execution permissions on all the files. I don't remember how to
do this, but I'm sure the web knows.

Download the whole source code because you'll need the cgi-bin,
Mochikit, SVGKit, and test directories:

http://svgkit.sourceforge.net/download.html

Then put the latex2svg.py in your web server's cgi-bin directory, make
sure it is executable, and change all of the program locations to match
your server, like the variables bin_dir and latex_program. Also
results_dir is where the .tex, .dvi, and .svg files will end up being
created. And results_url is the web address location relative to the
cgi-bin directory where the browser can grab the resulting .svg from.

You can get latex2svg.py from the big SVGKit.zip or from

http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/cgi-bin/latex2svg.py?revision=406

There is some code to see if the .svg file has already been created
based on the md5 checksum of the .tex source, but I seem to have
bypassed that (maybe for testing, I don't remember) in the line:

if True or not os.path.isfile(results_dir+svg_name):

Maybe if you remove "True or" the caching will work.

You also have to put SVGKit.js and SVGLaTeX.js in some directory that
apache serves web pages out of, and you may have to change the
SVGKit._cgi_dir variable in SVGKit.js to match your cgi-bin directory.

http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/SVGKit/SVGLaTeX.js?revision=406
http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/SVGKit/SVGKit.js?revision=406

In the tests directory, make sure latex_tests.html points properly to
the JavaScript files. Maybe it's best to make sure tests/svg_tests.html
is working first because the LaTeX stuff requires so many annoying paths
to be correct.

Let me know if this helped and if you get things to work. Also, if you
make any useful changes to any source, I'd be happy to incorporate them.

Uroš Simović

unread,
Jul 7, 2009, 11:08:07 AM7/7/09
to svgkit
Hello. Sry for late post. I haven't got any e-mail so I though there
was no reply. I installed python script but there was some errors so I
donw know how to fix that. Never mind.
Meanwhile I made my own php script that exectues latex, dvips,
pstoedit on my server. So thank you for long reply to my answer. Sorry
for that.
But I have new questions. On bottom of your demo page you can get svg
from latex without javascript. But there is problem you can't see
equation, unless if you open it in adobe illustrator (you know that).
I want something like: http://eele.tsckr.si/svg/example.svg
I think the dvips is making a problem. Do you have any idea how to fix
that?
And another less important question.
In equation (link above) super and subscript letters are a little too
big. How can I reduce them?

Sry again and bye bye.
Uroš Simović


On Jun 26, 5:23 pm, Jason Gallicchio <ja...@physics.harvard.edu>
wrote:
> It is not fully documented because it was never fully finished.  The
> features mentioned do all work.  Sorry about that.
>
> The first thing to do is look at the page
>
> http://svgkit.sourceforge.net/SVGLaTeX.html
>
> and install the software under "Server-Side Software Requirements"
>
> Then to test the server-side software look at "Basic Procedure".  Start
> by making a new TeX file called eqn.tex with the example content and run
> the three commands.
>
> Once this is working, you need to get the apache web server to run
> python CGI scripts -- basically having a cgi-bin directory with the
> right execution permissions on all the files.  I don't remember how to
> do this, but I'm sure the web knows.
>
> Download the whole source code because you'll need the cgi-bin,
> Mochikit, SVGKit, and test directories:
>
> http://svgkit.sourceforge.net/download.html
>
> Then put the latex2svg.py in your web server's cgi-bin directory, make
> sure it is executable, and change all of the program locations to match
> your server, like the variables bin_dir and latex_program.  Also
> results_dir is where the .tex, .dvi, and .svg files will end up being
> created.  And results_url is the web address location relative to the
> cgi-bin directory where the browser can grab the resulting .svg from.
>
> You can get latex2svg.py from the big SVGKit.zip or from
>
> http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/cgi-bin/latex2s...
>
> There is some code to see if the .svg file has already been created
> based on the md5 checksum of the .tex source, but I seem to have
> bypassed that (maybe for testing, I don't remember) in the line:
>
> if True or not os.path.isfile(results_dir+svg_name):
>
> Maybe if you remove "True or" the caching will work.
>
> You also have to put SVGKit.js and SVGLaTeX.js in some directory that
> apache serves web pages out of, and you may have to change the
> SVGKit._cgi_dir variable in SVGKit.js to match your cgi-bin directory.
>
> http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/SVGKit/SVGLaTeX...http://svgkit.svn.sourceforge.net/viewvc/svgkit/trunk/SVGKit/SVGKit.j...
Reply all
Reply to author
Forward
0 new messages