Quick way to use mimetex with SMF

SMF is a nice web forum package but it doesn’t display mathematics by default. If you want it to render LaTeX, one option is to use mimetex. Here is a quick patch to enable [tex]…[/tex] tags in SMF version 1.1. You can get the latest updates to this patch with:

darcs get http://darcs.superadditive.com/smf-mimetex

7 Responses to “Quick way to use mimetex with SMF”

  1. Stefan Riedel April 14, 2007 at 15:05 #

    Hello Jouan,

    many thanks for your work, your extension to the SMF BBCodes plus the super easy to install mimeTEX greatly simplyfies the use of formulas in SMF.

    I have two tiny improvement to your tag definition:

    1. Many of my users had problems because the did line breaks after the [tex] start tag, so I added a validation code to remove the unwanted ” codes which SMF throws in.
    2. I added a ‘title’ attribute to the IMG tag so even Firefox shows the TEX expression when hovering with the mouse over the image, so the users can learn the forumla expressions more easily.

    Finally, the code to be inserted in /Sources/Subs.php goes like that:

    array(
    ‘tag’ => ‘tex’,
    ‘type’ => ‘unparsed_content’,
    ‘content’ => ”,
    ‘validate’ => create_function(‘&$tag, &$data, $disabled’, ‘$data = strtr($data, array(\’\’ => \’\'));’),
    ),

    Keep up the good work and greetings from Germany,

    Stefan

  2. Stefan Riedel April 14, 2007 at 15:08 #

    Hmpf, the IMG tag was suppressed by your blog system. I repeat it, but use [] instead of :

    [img src="/cgi-bin/mimetex.cgi?$1" alt="$1" title="$1" border="0" align="absmiddle" /]

  3. Grzegorz June 28, 2007 at 13:50 #

    Thanks a lot, this is just what I was looking for. I am using this on my new physics forum :)
    Stefan’s improvements are also great.
    Keep it up, greetings from Poland.

    Greg

  4. jmbr August 6, 2007 at 21:51 #

    Thank you very much, Grzegorz!

  5. Jeff Kelly October 1, 2007 at 20:07 #

    I am very interested in finding a short BBC equation editor much like the LaTex generators I see.

    I know this would be very specialized but I run an aboslutely free chemistry help website

    http://www.mychemistrytutor.com

    just the edition of being able to add fractions would be most useful

    how far away do you believe an in forum equation editor is?

  6. jmbr October 1, 2007 at 21:19 #

    Hello Jeff,

    I wrote the smf-mimetex patch with LaTeX-savvy users in mind so I’m afraid I can’t provide you with an estimate for what you ask.

    I wish you good luck in your search!

  7. Zap1206 October 5, 2007 at 09:33 #

    Jeff,
    I found one here : http://test.izyba.com/equationeditor/equationeditor.php

    There is a download link in the footer.

Leave a Reply:

Gravatar Image

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>