Les distributions en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
des paires de muons
Résumé:
Des distributions en impulsion transverse des paires de muons ( J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
,
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
', Drell-Yan
et IMR (entre 2.1 et 2.7
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
, )), on peut tirer plusieurs informations, en particulier:
- l'élargissement en Pt (ou <
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
>) en fonction de la centralité de la collision, pour lequel il existe différents modèles théoriques
- l'étude de la suppression du J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
en fonction de
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
en faisant le rapport des distributions en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
pour différents bins en centralité
Si l'élargissement en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
est un effet de l'état initial, correspondant à la rediffusion du parton incident (gluon ou quark) sur les nucléons du noyau cible avant formation de la paire ccbar, on peut fitter, dans le cadre d'un formalisme de marche aléatoire,< p
T2 > sous la forme:
pour le J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
< p
T2 >
J/Psi (Et) = < p
T2 >
J/Psipp + a
gN L(Et)
où: L représente la longueur moyenne de la trajectoire parcourue par le parton incident dans la cible avant la formation de la paire ccbar
< pT2 >J/Psi (Et) et L(Et) sont les valeurs correspondantes de < pT2 >J/Psi et L dans un bin d'énergie transverse Et.
Pour le Drell-Yan, à priori seule la rediffusion du quark dans l'état initial élargit le < p
T2 > , puisque le DY n'est pas affecté par les interactions avec les comovers dans l'état final ou le plasma. D'autre part, le J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
subit l'absorption nucléaire de la pré-résonance, si bien que les J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
produits tôt traverseront plus de matière nucléaire, seront plus absorbés et cela déplacera le point effectif de production plus loin. Alors qu'en collision pA, la paire DY est produite à peu près au centre de la cible, l'allongement du chemin parcouru avant la production de la paire ccbar pour le J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
implique plus de rediffusion des partons dans l'état initial, et donc une augmentation du
< p
T2 > .
La comparaison de < p
T2 >
J/Psi et < p
T2 >
DY en fonction de la centralité est de ce fait intéressante.
Expérimentalement dans les collisions pA et SU à 200
GeV?/c, < p
T2 >
J/Psi suit la dépendance linéaire avec L. Dans les collisions
PbPb? Ã 158
GeV?/c, < p
T2 >
J/Psi suit la même dépendance linéaire, ce qui semble contradictoire avec la suppression "anormale"
observée expérimentalement dans ces collisions
PbPb?, ainsi qu'avec les modèles théoriques qui suivent.
Expérimentalement, < p
T2 >
J/Psi dans les collisions
PbPb? commence par augmenter avec l'énergie transverse, puis présente une saturation pour les évènements centraux. Différents modèles théoriques existent.
Compte tenu de la saturation géométrique de L avec Et dans le système
PbPb?, S. Gavin et R. Vogt ont prédit la saturation de
< p
T2 >
J/Psi (idem pour < p
T2 >
DY ) en fonction de Et dans l'hypothèse où cet élargissement n'est dû qu'à la rediffusion des partons.
Dans un modèle de plasma, J.P. Blaizot et J.Y. Ollitrault ont, quant à eux, prédit également la saturation de
< p
T2 >
J/Psi
en fonction de Et dans les collisions
PbPb?, mais dans un scénario où
tous les J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
sont supprimés indépendamment de leur impulsion transverse au-dessus d'une certaine densité d'énergie, autrement dit à partir d'une certaine centralité.
D. Kharzeev et al. ont prédit, toujours dans le cadre d'un modèle de plasma, une augmentation suivie non plus d'une saturation, mais d'une décroissance de < p
T2 >
J/Psi avec Et.
Il est difficile de tirer une conclusion claire.
b. Suppression du J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
en fonction de
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
:
Pour cette étude, on a calculé les rapports Ri(
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
) de la distribution en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
pour le bin i en Et et
de la même distribution obtenue pour le premier bin en Et, ces distributions étant normalisées
au nombre de paires de muons de masse supérieure à 4.2
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
dans les mêmes
bins en Et. L'idée avancée par plusieurs auteurs est que les J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
de haut
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
s'échappent, tandis que ceux de pas
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
sont supprimés. On s'attend alors à ce qu'il
existe une valeur en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
au-delà de laquelle ces rapports devraient saturer et tendre
vers 1.
Expérimentalement, on observe que, pour les collisions
PbPb?, la suppression est plus
importante à bas
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
, et augmente avec la centralité de la collision. Pour les évènements
les plus centraux, il y a suppression pour toutes les valeurs de
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
. Maintenant, la
statistique dont nous disposons ne permet pas de conclure définitivement sur la saturation
ou non de ces rapports à grand
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
.
*
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
est-elle une "bonne" variable? Si non, pourquoi?
* Y a-t-il des modèles plus récents de la dépendance en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
de la production du J/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
, du
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
? Comparaison à la dépendance en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
du DY ?
* Que peut-on dire de la dépendance en
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
du charme ouvert et de la beauté ouverte?
* Il exite des prédictions théoriques du rapport
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
'/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
en fonction de
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
. En existe-t-il pour le rapport
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
'/
/*
* Almost entirely taken from mediawiki :
* http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/includes/
*/
if (!function_exists("wfEscapeHTML"))
{
function wfEscapeHTML( $in )
{
return str_replace(
array( "&", "\"", ">", "<" ),
array( "&", """, ">", "<" ),
$in );
}
}
if (!function_exists("linkToMathImage"))
{
function linkToMathImage ($wgMathPath, $tex, $outputhash )
{
global $wiki;
return "
config["ghostscript_png_ext"]
."\" alt=\"".wfEscapeHTML($tex)."\">";
}
}
if (!function_exists("renderMath"))
{
function renderMath( $tex )
{
global $wiki;
$mf = "math_failure";
$munk = "math_unknown_error";
$math_dir_url = $wiki->config["math_dir_url"];
$math_dir_sys = $wiki->config["math_dir_sys"];
$math_tmp_dir = $wiki->config["math_tmp_dir"];
$math_inputenc = $wiki->config["math_inputenc"];
$math_render_type = $wiki->config["math_render_type"];
/* 0 : "Toujours produire une image PNG",
1 : "HTML si tres simple, autrement PNG",
2 : "HTML si possible, autrement PNG",
3 : "Laisser le code TeX original",
4 : "Pour les navigateurs modernes" (mathml) */
if ($math_render_type == 3)
return ('$ '.wfEscapeHTML($tex).' $');
$md5 = md5($tex);
$md5_sql = mysql_escape_string(pack("H32", $md5));
if ($math_render_type == 0)
$sql = "SELECT math_outputhash FROM ".$wiki->config["table_prefix"]
."math WHERE math_inputhash = '".$md5_sql."'";
else
$sql = "SELECT math_outputhash,math_html_conservativeness,math_html FROM ".$wiki->config["table_prefix"]."math WHERE math_inputhash = '".$md5_sql."'";
$res = $wiki->Query($sql);
if( $rpage = mysql_fetch_object( $res ) ) {
$outputhash = unpack( "H32md5",
$rpage->math_outputhash
. " " );
$outputhash = $outputhash ['md5'];
if( file_exists( "$math_dir_sys/$outputhash"
.$wiki->config["ghostscript_png_ext"] ) )
{
if (($math_render_type == 0)
|| ($rpage->math_html == '')
|| (($math_render_type == 1)
&& ($rpage->math_html_conservativeness != 2))
|| (($math_render_type == 4)
&& ($rpage->math_html_conservativeness == 0)))
return linkToMathImage ( $wiki->config["math_dir_url"],
$tex, $outputhash );
else
{
return $rpage->math_html;
}
}
}
$cmd = $wiki->config["math_texvc_path"]." "
.escapeshellarg($math_tmp_dir)." "
.escapeshellarg($math_dir_sys)." "
.escapeshellarg($tex)." ".escapeshellarg($math_inputenc);
$contents = `$cmd`;
if (strlen($contents) == 0)
return "
".$mf." (".$munk." 1): ".wfEscapeHTML($tex)."";
$retval = substr ($contents, 0, 1);
if (($retval == "C") || ($retval == "M") || ($retval == "L")) {
if ($retval == "C")
$conservativeness = 2;
else if ($retval == "M")
$conservativeness = 1;
else
$conservativeness = 0;
$outdata = substr ($contents, 33);
$i = strpos($outdata, "\000");
$outhtml = substr($outdata, 0, $i);
$mathml = substr($outdata, $i+1);
$sql_html = "'".mysql_escape_string($outhtml)."'";
$sql_mathml = "'".mysql_escape_string($mathml)."'";
} else if (($retval == "c") || ($retval == "m") || ($retval == "l")) {
$outhtml = substr ($contents, 33);
if ($retval == "c")
$conservativeness = 2;
else if ($retval == "m")
$conservativeness = 1;
else
$conservativeness = 0;
$sql_html = "'".mysql_escape_string($outhtml)."'";
$mathml = '';
$sql_mathml = 'NULL';
} else if ($retval == "X") {
$outhtml = '';
$mathml = substr ($contents, 33);
$sql_html = 'NULL';
$sql_mathml = "'".mysql_escape_string($mathml)."'";
$conservativeness = 0;
} else if ($retval == "+") {
$outhtml = '';
$mathml = '';
$sql_html = 'NULL';
$sql_mathml = 'NULL';
$conservativeness = 0;
} else {
if ($retval == "E")
$errmsg = wfMsg( "math_lexing_error" );
else if ($retval == "S")
$errmsg = wfMsg( "math_syntax_error" );
else if ($retval == "F")
$errmsg = wfMsg( "math_unknown_function" );
else
$errmsg = $munk." ".$retval;
return "
".$mf." (".$errmsg.substr($contents, 1)."): "
.wfEscapeHTML($tex)."
";
}
$outmd5 = substr ($contents, 1, 32);
if (!preg_match("/^[a-f0-9]{32}$/", $outmd5))
return "
".$mf." (".$munk." 3): ".wfEscapeHTML($tex)."";
$outmd5_sql = mysql_escape_string(pack("H32", $outmd5));
$sql = "REPLACE INTO ".$wiki->config["table_prefix"]."math VALUES ('"
.$md5_sql."', '".$outmd5_sql."', ".$conservativeness.", ".$sql_html
.", ".$sql_mathml.")";
$res = $wiki->Query($sql);
# we don't really care if it fails
if (($math_render_type == 0) || ($rpage->math_html == '')
|| (($math_render_type == 1) && ($conservativeness != 2))
|| (($math_render_type == 4) && ($conservativeness == 0)))
return linkToMathImage($wiki->config["math_dir_url"],
$tex, $outmd5);
else
return $outhtml;
}
}
echo renderMath($text);
?>
?