$formula_text-->"; if (!is_file($cache_formula_path)) { // Execute gnuplot with the file $tmp="/tmp/tmpplot$ts"; file_put_contents($tmp,$formula_text); $result=shell_exec("gnuplot $tmp 2>&1"); if (!strlen($result)) { $result.=shell_exec("convert /tmp/my-plot$ts.ps /tmp/my-plot$ts.png 2>&1"); $result.=shell_exec("mv /tmp/my-plot$ts.png ".$cache_formula_path); } @unlink("/tmp/my-plot$ts.ps"); @unlink("/tmp/tmpplot$ts"); if (strlen($result)>0) return "

GNUPLOT error:
$result

"; } // returning the image-tag, referring to the image in your cache folder return "
"; } } $mimetex_object = new gnuplot; // this specifies where parsing should be done. one can look up further information on wordpress.org add_filter('the_title', array($mimetex_object, 'parseTex')); add_filter('the_content', array($mimetex_object, 'parseTex')); add_filter('the_excerpt', array($mimetex_object, 'parseTex')); add_filter('comment_text', array($mimetex_object, 'parseTex')); ?>