Author Topic: LATEX Parsing  (Read 31429 times)

Offline treo

  • Jr. Member
  • **
  • Posts: 146
  • Gender: Male
LATEX Parsing
« on: June 18, 2004, 04:25:16 PM »
hi,
I'd like to add this feat. to my forum,
I have root access to the server so there is no problem in installing it.
But how do I add the parsing best?

Offline Oldiesmann

  • Compliance Manager
  • Marketing
  • Simple Machines Super Hero
  • *
  • Posts: 19,634
  • Gender: Male
  • Ask me about the function DB :)
    • Archie Comics Fan Forum
Re: LATEX Parsing
« Reply #1 on: June 19, 2004, 10:38:13 AM »
What exactly is LATEX? Can you give us a link for more info?

Offline Orstio

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 15,420
  • And don't forget that I'm also Gorgeous!
    • Everything Science
Re: LATEX Parsing
« Reply #2 on: June 19, 2004, 12:13:29 PM »
LaTeX is a math environment that makes pretty equations on the web:

http://crab.rutgers.edu/~karel/latex/class4/class4.html

It is an option in vBulletin.  It is used a lot at http://www.physicsforums.com .  If you go there and do a search for LaTeX you will see many examples.

There is a php LaTeX renderer for download here:

http://www.mayer.dial.pipex.com/tex.htm#latexrender
« Last Edit: June 19, 2004, 01:17:33 PM by Orstio »

There are only two reaons for privacy:  security and shame.  Security being the only valid reason.

Offline treo

  • Jr. Member
  • **
  • Posts: 146
  • Gender: Male
Re: LATEX Parsing
« Reply #3 on: June 27, 2004, 09:54:32 AM »
I've done that little modding :)

What you need is (debian packages ;) ):
tetex
tetex-extra
gs
imagemagick

and

http://www.mayer.dial.pipex.com/latexrender.zip

Rename otherPHP to latex, and edit latex.php.
Upload the latex folder to the Sources Folder and make chmod 777 tmp and chmod 777 pictures.
Try Out wether it works with the example.php. If it works delete example.php and do that change:

in Subs.php add after line 727:
include_once('Sources/latex/latex.php');
$message = latex_content($message);

Now you can use [tex][/tex] in your posts.
Additionally someone could create a button for it and add it to the template.

EDIT:
If you want to see it in action:
http://10e.ath.cx/index.php/topic,34.0
« Last Edit: June 27, 2004, 10:15:23 AM by treo »

Offline Anguz

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 3,455
  • Gender: Male
    • cristianlavaque.com
Re: LATEX Parsing
« Reply #4 on: June 29, 2004, 06:18:12 AM »
nice :)

* Anguz wishes he could understand those formulas
Cristián Lávaque
My SMF mods - Don't PM me for support.

Offline Jeff Lewis

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 3,322
  • Gender: Male
Re: LATEX Parsing
« Reply #5 on: June 29, 2004, 08:28:55 AM »
Someone should throw that together into a MOD package ;)
Jeff Lewis
Co-Founder, Lewis Media
Co-Founder, SMF

Offline treo

  • Jr. Member
  • **
  • Posts: 146
  • Gender: Male
Re: LATEX Parsing
« Reply #6 on: June 29, 2004, 05:00:42 PM »
tell me how and I'll do it myself ;)
And by now I have fund some things which have to be changed when modding because I first put it into the wrong line,
cause there are some bugs wenn using it over more than one line.
I'll have to repair it tomorow than I also will change that manual to build it in ;)

Offline Oldiesmann

  • Compliance Manager
  • Marketing
  • Simple Machines Super Hero
  • *
  • Posts: 19,634
  • Gender: Male
  • Ask me about the function DB :)
    • Archie Comics Fan Forum
Re: LATEX Parsing
« Reply #7 on: June 30, 2004, 09:35:42 AM »
nice :)

* Anguz wishes he could understand those formulas

I understand it perfectly (for the most part). I'll explain them for you (I won't go into too much detail on the third thing because it's pretty complicated)

\sqrt(number) displays the formula for the square root of the number
\frac {numerator} {denominator} displays the fraction with the specified numerator (top number) and denominator (bottom number)

not sure what \displaystyle is

The third thing is calculus related. Basically, that means that the area under the curve created by graphing that function (the big x4(1-x)4 over 1+x2 fraction thing) from x=0 to x=1 is approximately 22/7 - pi. It's called an integral. If I tried to explain it to you, I'd probably end up confusing you even more, so I won't even try.
« Last Edit: June 30, 2004, 09:56:30 AM by Oldiesmann »

Offline Anguz

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 3,455
  • Gender: Male
    • cristianlavaque.com
Re: LATEX Parsing
« Reply #8 on: June 30, 2004, 11:23:54 AM »
thank you for taking your time to tell me Oldiesmann

and happy birthday! (^_^)

tell me how and I'll do it myself ;)
And by now I have fund some things which have to be changed when modding because I first put it into the wrong line,
cause there are some bugs wenn using it over more than one line.
I'll have to repair it tomorow than I also will change that manual to build it in ;)

cool... get it to work as well as possible before releasing it and then you can get an existing package and see how it's done, a good one for that is [Unknown]'s named Say Something! he wrote it with the purpose of showing how it's done iirc
« Last Edit: June 30, 2004, 11:25:32 AM by Anguz »
Cristián Lávaque
My SMF mods - Don't PM me for support.

Offline Orstio

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 15,420
  • And don't forget that I'm also Gorgeous!
    • Everything Science
Re: LATEX Parsing
« Reply #9 on: July 01, 2004, 09:07:24 PM »
For those who do not have tetex, or as in my case, are on a server where the host has disabled exec(), you can also use the mimetex version available in the download link that Treo provided.

You'll need the precompiled mimetex.cgi binary, which is not easy to come by, but I did find one, so I've provided a Linux version: DOWNLOAD LINK

If you need another version, go here:

http://moodle.org/download/mimetex/

right-click on the file that you need, and save as mimetex.cgi .

Upload this file to your cgi-bin and CHMOD to 755.

Just like Treo's version:

Upload the mimetex folder inside your Sources folder.  CHMOD the pictures folder to 777.

Edit mimetex.php to your server settings.

Try example.php .  If it works, do the mod:

in Subs.php, after line 728 add:

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

You can see it in action here:

LINK



There are only two reaons for privacy:  security and shame.  Security being the only valid reason.

Offline Anguz

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 3,455
  • Gender: Male
    • cristianlavaque.com
Re: LATEX Parsing
« Reply #10 on: July 01, 2004, 09:20:58 PM »
great! thanks for your help

I downloaded the one you provided with this link
http://www.everything-science.com/mimetex.zip
and added it as an attachment to this post

* Anguz remembers the YaBB SE mod threads with broken links (^^;)
Cristián Lávaque
My SMF mods - Don't PM me for support.

Offline Orstio

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 15,420
  • And don't forget that I'm also Gorgeous!
    • Everything Science
Re: LATEX Parsing
« Reply #11 on: July 01, 2004, 10:08:33 PM »
Quote
* Anguz remembers the YaBB SE mod threads with broken links (^^;)

Thanks for attaching the file here;  I would have, but I'm not able to post attachments.  I also remember the broken links at YaBB SE, and also at the YaBB Mod forums.

There are only two reaons for privacy:  security and shame.  Security being the only valid reason.

Offline stevem

  • Semi-Newbie
  • *
  • Posts: 19
Re: LATEX Parsing
« Reply #12 on: July 15, 2004, 01:38:06 PM »
I've done that little modding :)
...
If you want to see it in action:
http://10e.ath.cx/index.php/topic,34.0 [nofollow]

Just come across your post. Would you mind if I put a link to http://10e.ath.cx/index.php [nofollow] on the LatexRender [nofollow] page, plus put a copy of your modding instructions in the download (with attribution of course), so that others can benefit from it?

Steve Mayer

Offline stevem

  • Semi-Newbie
  • *
  • Posts: 19
Re: LATEX Parsing
« Reply #13 on: July 15, 2004, 01:44:02 PM »
For those who do not have tetex, or as in my case, are on a server where the host has disabled exec(), you can also use the mimetex version available in the download link that Treo provided.
...
You can see it in action here:

LINK [nofollow]

Same request  :) to put a copy of your instructions in LatexRender download plus a link to the forum.

Thanks

Offline Orstio

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 15,420
  • And don't forget that I'm also Gorgeous!
    • Everything Science
Re: LATEX Parsing
« Reply #14 on: July 15, 2004, 06:18:27 PM »
I have no problem with anyone using the instructions to get mimetex working with SMF, and links are always appreciated. ;)

I guess we should also extend a thank you for the download package. :D

There are only two reaons for privacy:  security and shame.  Security being the only valid reason.

Offline treo

  • Jr. Member
  • **
  • Posts: 146
  • Gender: Male
Re: LATEX Parsing
« Reply #15 on: July 16, 2004, 08:22:14 AM »
stevem:
Soon I will make an Mod Demo Board where all my mods are in it,
10e.ath.cx is going down, because the class doesen't exist any more

Offline stevem

  • Semi-Newbie
  • *
  • Posts: 19
Re: LATEX Parsing
« Reply #16 on: July 16, 2004, 08:37:03 AM »
Let me know when you are ready and if you want a link. Meanwhile can I use your instructions or would you prefer I wait until the demo board is ready?

Offline treo

  • Jr. Member
  • **
  • Posts: 146
  • Gender: Male
Re: LATEX Parsing
« Reply #17 on: July 19, 2004, 05:12:35 AM »
http://demoboard.hostspace.ath.cx/index.php?topic=2.0
Here is a slighty better description for installing it:

What you need is (debian packages):
tetex
tetex-extra
gs
imagemagick

and

http://www.mayer.dial.pipex.com/latexrender.zip

Safe Mode must be off

From the latexrenderer.zip take only the otherPHP/latexrenderer folder,
edit the latex.php in it so it fits your environment
Rename the latexrenderer folder to latex and put it into your Sources folder.

chmod 777 latex
chmod 777 latex/pictures
chmod 777 latex/tmp

try out wether it works with the example.php (open http://www.example.com/board/Sources/example.php), if it works delete example.php

In Subs.php:
Search for( should be at line 726):
Code: [Select]
                }
        }
        $message = substr(implode('', $parts), 1);

        // Fix things.
        $message = str_replace(
                array('{<{', '}>}', '  ', "\r", "\n"),
and replace it with:
Code: [Select]
                }
        }
        $message = substr(implode('', $parts), 1);
        include_once('Sources/latex/latex.php');
        $message = latex_content($message);
        // Fix things.
        $message = str_replace(
                array('{<{', '}>}', '  ', "\r", "\n"),

Now you can use [tex][/tex] in your Board.
« Last Edit: July 19, 2004, 05:14:14 AM by treo »

Offline stevem

  • Semi-Newbie
  • *
  • Posts: 19
Re: LATEX Parsing
« Reply #18 on: July 19, 2004, 06:17:28 AM »
Thanks. I will put your instructions in the latexrender download plus the link to the demo board.

It shouldn't be necessary to chmod the latex folder, since the program only writes to pictures and tmp (unless you've discovered otherwise?).
« Last Edit: April 02, 2005, 03:36:49 PM by stevem »

Offline ccheaton

  • Semi-Newbie
  • *
  • Posts: 87
  • Gender: Male
Re: LATEX Parsing
« Reply #19 on: December 06, 2004, 08:56:26 PM »
How can I determine, through cPanel, if I have these installed?
tetex
tetex-extra
gs
imagemagick