]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/teximg.pm
calendar: Display the popup mouseover when there is only 1 page for a given day,...
[git.ikiwiki.info.git] / IkiWiki / Plugin / teximg.pm
index f92ed01326b7df203b59e4e05e423ce4f6f8209f..3d6fa9942c11f3dd304026458655b22ab30e5e50 100644 (file)
@@ -8,10 +8,12 @@ use strict;
 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}
@@ -31,6 +33,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
+                       section => "widget",
                },
                teximg_dvipng => {
                        type => "boolean",
@@ -102,7 +105,7 @@ sub create ($$$) {
                $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";
@@ -141,7 +144,7 @@ sub gen_image ($$$$) {
        }
        
        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;