News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

LATEX Parsing

Started by treo, June 18, 2004, 04:25:16 PM

Previous topic - Next topic

stevem

Is the .ps file being created correctly? Do you also get the .dvi file? If so, then the path to /tmp is correct but Imagemagick is not working and you must check the path to convert & identify is correct. Are you allowed shell access to check this? If so, then you can run some of the commands class.latexrender.php issues and see any errors it produces.

ccheaton

I probably have shell access, though I haven't used it before.  I'll check into it in a few days -- right now, I have to get through final exams!   :o

hefesto

I know that this topic is quite old, but I can't find a solution.

I've performed the first steps, and I can get the example.php file working (the equations are rendered). But I'm using SMF 1.1RC2, and I can't get it to work.

I've added the mimetex function at the end of the subs.php file, but I can't find the code to be replaced...

Thanks in advance for your help.

Orstio

Find this in Subs.php (~line 2356):

// Cache the output if it took some time...
if (isset($cache_key, $cache_t) && array_sum(explode(' ', microtime())) - array_sum(explode(' ', $cache_t)) > 0.05)
cache_put_data($cache_key, $message, 240);


And add this immediately after it:

$message = mimetex($message);

hefesto

Thanks very much for your quick reply, Orstio.

So, is it still necessary to add

include_once('Sources/mimetex/mimetex.php');
$message = mimetex($message);


after line 728?

Mimetex function is already added at the end of subs.php file.

It worked for the first formula, but no more. Maybe I'm using the wrong mimetex.cgi. I've tried a couple (both of them for Linux). Where should I look for the correct one?

Orstio

QuoteSo, is it still necessary to add


Code:
include_once('Sources/mimetex/mimetex.php');
$message = mimetex($message);
after line 728?

No.  Those instructions were for SMF 1.0 RC2.

hefesto

All right, it's working fine now (I was having a problem with file permissions).

Thanks very much Orstio  ;).

Avinash4

Hey, I can't get example.php working for mimetex. This is what I get:
This is just text but [Mimetex cannot convert this formula] should be shown as an image and so should [Mimetex cannot convert this formula].

Another formula is [Mimetex cannot convert this formula]

Any ideas? I followed all instructions precisely.

Also, I was wondering which is more efficient, mimetex or the latex using imagemagick + textex.
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

stevem

Have you tried changing $system_disabled=0; to $system_disabled=1; in mimetex.php? Is mimtex.cgi working correctly - try http://put_your_path_here/mimetex.cgi?x^2 and see if it gives an image of x-squared.

Quote from: Avinash4 on June 13, 2006, 12:09:25 PM
Also, I was wondering which is more efficient, mimetex or the latex using imagemagick + textex.
I'm not sure what you mean by efficient. LaTex gives a much better image but, unlike mimeTeX, it requires LaTeX, ImageMagick and GhostScript to be installed on the server and not just on your part of it.

Avinash4

Thanks for the quick reply. When I run that this is what happens:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

stevem

Good news - that usually just means you have forgotten to change the permissions on mimetex.cgi to 755. If that's not the problem then check with your host that they haven't disabled use of cgi programs.

Avinash4

[R] SITE CHMOD 755 mimetex.cgi
[R] 200 Permissions changed on mimetex.cgi
[R] PASV

I did that through FTP, and still the same error  >:(
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

Avinash4

This is what tech support said:

Basil: The file /cgi-bin/mimetex.cgi is not a cgi script. It is a binary executable file. this file can not be run on our servers.
Basil: It is possible to run executables but not using a .cgi extension.
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

stevem

Hmm - it may not be possible to run mimetex.cgi on your server, but before giving up contact mimeTeX's author John Forkosh (see http://www.forkosh.com/mimetex.html [nofollow] for his email address) and tell him what tech support say. He may be able to help.

Avinash4

Thanks for all the help stevem. Just one last question. If mimetex cannot run properly, if I manage to convince my host to install GhostScript and Latex, will Latex rendering work?
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

stevem

Provided Latex, ImageMagick and Ghostscript are all working then you should have no trouble using LatexRender with SMF -see treo's demo at http://demoboard.hostspace.ath.cx/index.php?topic=2.0 [nofollow] for example.

Avinash4

I contacted my hosting support today about installing Latex for me, and this was their response:
Quote from:  hostgator support:
Hello,

Please confirm if you need only Latex installed. Latex has other libraries like texvc etc, are you sure you do not need those ?

Now, I have no clue what this means. I saw earlier in this thread that you need:
tetex
tetex-extra
gs
imagemagick

I know that ImageMagick is already installed. Should I tell him to install all of those plus latex. Or Just the ones above, and not Latex itself?
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

stevem

Yes you do need all those installed. tetex is in fact a very common LaTeX distro for Linux/Unix so it is actually LaTeX. You don't need texvc though

Avinash4

Quote from: stevem on July 25, 2006, 09:19:41 AM
Yes you do need all those installed. tetex is in fact a very common LaTeX distro for Linux/Unix so it is actually LaTeX. You don't need texvc though
Thanks a lot. I'll let my host know, and hopefully they still agree to install it.
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

Avinash4

One more question, where can I find tetex-extra for RHEL (red hat linux). I only found one for debian right now. My host installed the rest, but not tetex-extra. Any ideas?
McMaster University's Largest Online Community
http://mac-central.com
Powered by SMF and Mambo

Advertisement: