
So I've noticed some traffic to here from various sources, so I guess I should put the instructions for the Movable Type Equation plugin here.
Basically you need to create a file called 'textags.pl' in some text editor (like Notepad for Windows) and put the text below into it.
You then upload this code to your plugins directory of your movable type website and it will work, however, there is an additional step which you may want to take. You may notice a reference in the code to a url, and this is the crux of the plugin.
What this plugin does it uses a script written by John Forkosh and uses it to convert your Tex code into an image, which is inserted into your page just like a regular image. What you should do is download an appropriate (depending on your server set-up) copy of the script here and upload it to your server, then change the url (which is obvious in the code below) to the right location on your own server. Note that the ? in the url is very important.
Now that you have the plugin uploaded, you need to make sure that Movable Type has permissions to execute the script, usually chmod 755 on a Linux server. If you are using another type of server, talk to your server administrator if you are unsure about what I'm talking.
To actually use the plugin, it acts a filter, and should appear in your Text Formatting choices located beneath your entry. You just select it, and whatever Tex you want to show up, you include between
tags.
Contact me if you need any help with this at dweesdesign@gmail.com.
# Quick code + Tex Tags
# a text filter plug-in for bb style [codes]
#
# Modified by David Wees
# ver 1.02 Copyright 2004 Crys Clouse;
use MT;
MT->add_text_filter(textags => { label => 'TexTags', on_format => sub { &qcode }, });
sub qcode {
$_=shift;
fullcodes($_);
}
sub fullcodes {
$s = $_[0];
$s =~ s!\[tex\](.*?)\[/tex\]!<img src="
http://www.forkosh.dreamhost.com/cgi-bin/mimetex.cgi?
$1" alt="$1" />!gis;
$s = maincodes($s);
$s =~ s!\&!&!g;
#$s =~ s!\\!\x5C!g;
return $s;
maincodes($_);
}
sub maincodes {
$s = $_[0];
$s = MT::Util::html_text_transform($_[0]);
$s =~ s!(<p>.*?</p>)!smarty_pnts($1)!geis ;
$s =~ s!<linebreak>!\n!g;
return $s;
}
sub smarty_pnts {
$s = $_[0];
my $smarty =
$MT::Template::Context::Global_filters{'smarty_pants'};
if ($smarty)
{
return $smarty->($s, '1');
}
else
{
return $s;
}
}
1;