- #TODO This should move into the setup file.
- my $tex = '\documentclass['.$height.'pt]{scrartcl}';
- $tex .= '\usepackage[version=3]{mhchem}';
- $tex .= '\usepackage{amsmath}';
- $tex .= '\usepackage{amsfonts}';
- $tex .= '\usepackage{amssymb}';
- $tex .= '\pagestyle{empty}';
- $tex .= '\begin{document}';
- $tex .= '$$'.$code.'$$';
- $tex .= '\end{document}';
+ if (!defined $config{teximg_prefix}) {
+ $config{teximg_prefix} = $default_prefix;
+ }
+ if (!defined $config{teximg_postfix}) {
+ $config{teximg_postfix} = $default_postfix;
+ }
+ if (!defined $config{teximg_dvipng}) {
+ $config{teximg_dvipng} = length `which dvipng 2>/dev/null`;
+ }
+
+ my $tex = $config{teximg_prefix};
+ $tex .= '\['.$code.'\]';
+ $tex .= $config{teximg_postfix};
+ $tex =~ s!\\documentclass{article}!\\documentclass[${height}pt]{article}!g;
+ $tex =~ s!\\documentclass{scrartcl}!\\documentclass[${height}pt]{scrartcl}!g;