use Digest::MD5 qw(md5_hex);
use File::Temp qw(tempdir);
use HTML::Entities;
+use Encode;
use IkiWiki 3.00;
my $default_prefix = <<EOPREFIX;
\\documentclass{article}
+\\usepackage[utf8]{inputenc}
\\usepackage{amsmath}
\\usepackage{amsfonts}
\\usepackage{amssymb}
$height = 12;
}
- my $digest = md5_hex($code, $height);
+ my $digest = md5_hex(Encode::encode_utf8($code), $height);
my $imglink= $params->{page} . "/$digest.png";
my $imglog = $params->{page} . "/$digest.log";
}
my $tex = $config{teximg_prefix};
- $tex .= '$$'.$code.'$$';
+ $tex .= '\['.$code.'\]';
$tex .= $config{teximg_postfix};
- $tex =~ s!\\documentclass{article}!\\documentclass[${height}pt]{article}!g;
- $tex =~ s!\\documentclass{scrartcl}!\\documentclass[${height}pt]{scrartcl}!g;
+ $tex =~ s!\\documentclass\{article}!\\documentclass[${height}pt]{article}!g;
+ $tex =~ s!\\documentclass\{scrartcl}!\\documentclass[${height}pt]{scrartcl}!g;
my $tmp = eval { create_tmp_dir($digest) };
if (! $@ &&