December 1, 2004

MTValidate is up to version 0.3, with some gratuitous dependencies removed and even more helpful error messages from the W3C.

itex2MML is up to version 0.9. Only the binary changed, not the plugins for MovableType, WordPress or ecto. Particularly if you were having trouble using it with Markdown or Textile, you might want to check out the latest version. As usual, my distribution comes with the source code and a precompiled MacOSX binary. If James and Abiola are up to it, I’ll post links to precompiled Linux and Windows binaries, when they’re available.

Posted by distler at December 1, 2004 12:09 AM

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/478

Hello, I have done some modfication on the wordpress itexToMML plugin to make sure that itex2MMl only convert the string between two [mathml] tags into MathML
the following code is my two cents:

itexToMML ($text) { // customize this location$itex2MML = ‘/usr/local/bin/itex2MML’;

$text = str_replace(“\r\n”, “\n”,$text);
if (ereg(“^.+$mathml$.+$”,$text)):
$sptag = “$mathml$”;$mathmls = split($sptag,$text);
global $text;$text = $mathmls[0]; for ($i = 1; $i array(‘pipe’, ‘r’), 1 => array(‘pipe’, ‘w’), 2 => array(‘pipe’, ‘w’) );$itex_process = proc_open($itex2MML,$fspec, $pipes); if (is_resource($itex_process)) {
fwrite($pipes[0],$mathmls[$i]); //fwrite($pipes[0], $text); fclose($pipes[0]);

$mathmls[$i] = ”;
while (!feof($pipes[1])) {$mathmls[$i] .= fgets($pipes[1], 1024);
}
fclose($pipes[1]); fclose($pipes[2]);
proc_close($itex_process);$mathmls[$i] = str_replace(“nn”, “n”,$mathmls[$i]);$text .= $mathmls[$i];
$text .=$mathmls[$i+1]; } } endif; return$text;

}

Posted by: Gong Y. Liao on February 19, 2005 11:37 PM | Permalink | Reply to this

The line
$mathmls[$i] = str_replace(“\n\n”, “\n”, $mathmls[$i]);
is used for avoiding the bug of the markdown plugin that can’t handle correctly tags
inserted in a paragraph and that contain an empty line.

Posted by: Gong Y. Liao on February 19, 2005 11:51 PM | Permalink | Reply to this

WordPress modifications

Are you using my latest release of itex2MML? Only rather old versions produce blank lines that could screw up Markdown.

Indeed, the current version of Markdown (distributed with WordPress 1.5) requires no modifications at all, in order to work with my itexToMML plugin.

The Texturize filter has some real problems, though, and that has delayed my releasing a new version to go with WordPress 1.5.

I’m also unclear why, in a entry which had, say, 20 equations in it, you would want to spawn 20 processes (with bidirectional pipes) to process it, when you could process the entire post with a single itex2MML instance.

Posted by: Jacques Distler on February 20, 2005 12:09 AM | Permalink | PGP Sig | Reply to this

Re: WordPress modifications

Oh, sorry, my bargain English made some misunderstandings
the block [mathml] [mathml] can be used as:
[mathml] 3 itex blocks [mathml] or [mathml] 1 itex block[mathml] + [mathml]2 itex block[mathml]

the orignal intention to make the modifcation ( may be i should use other words, 150 is my tofel best) is to avoid the situation that the itex2mml plugin may conflict with other plugins like http://scott.yang.id.au/2004/05/syntax-hilight-enscript/
so, in the situation that a post with (top to down )1 itex block + 1 c++ code block + 1 perl code block + 2 itex block + 1 matlab code block + plain text block, if the post regarded as a single string, and the plugins may influence the blocks that have no matter of itex or something else.

And the last update of itex2MML binary makes the line to strip the “\n\n” is not needed any more.

Thanx for your patient on my bargain English and your great works for web-based publishing.

Posted by: Gong Y. Liao on February 20, 2005 12:48 AM | Permalink | Reply to this

Plugin compatibility

Thanx for your patient on my bargain English and your great works for web-based publishing.

No apologies necessary. Your English is much better than my Chinese.

The orignal intention to make the modifcation ( may be i should use other words, 150 is my tofel best) is to avoid the situation that the itex2mml plugin may conflict with other plugins

I see. In an ideal world, the itexToMML plugin would always execute first and other plugins would be written to ignore all content between $...$.

John Gruber, the author of Markdown, was very happy to incorporate the small changes to Markdown to make it work well with itex2MML. I think most plugin authors would be willing to do the same with their plugins.

In the particular case of Scott Yang’s plugin, I don’t see where the conflict is. His plugin only acts on blocks of the form

<pre lang="..">...</pre>

I would not expect there to be MathML in those blocks.

The only thing you might have to worry about is the appearance of “$” in your text. That character is special to itex2MML. If you are displaying , say, Perl code, you’d have write “&#36;” instead of “$”, to prevent itex2MML from thinking you want to start an equation.

MovableType is nicer, in that way, as you can decide on a post-by-post (and comment-by-comment) basis whether to apply itex2MML filtering.

Posted by: Jacques Distler on February 20, 2005 1:22 AM | Permalink | PGP Sig | Reply to this