summaryrefslogtreecommitdiff
path: root/src/phplatex.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/phplatex.php')
-rw-r--r--src/phplatex.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/phplatex.php b/src/phplatex.php
index f8bebeb..ce6a2fe 100644
--- a/src/phplatex.php
+++ b/src/phplatex.php
@@ -35,24 +35,21 @@ function phplatex_colorhex($r,$g,$b) {
}
-function texify($string,$dpi='90', $r=0.0,$g=0.0,$b=0.0, $br=1.0,$bg=1.0,$bb=1.0,$extraprelude="", $trans=FALSE) {
+function texify($string,$dpi='90',$fore="",$back="",$extraprelude="",$trans=FALSE) {
global $imgfmt,$path_to_latex,$path_to_dvips,$path_to_convert;
if ($dpi>300) $dpi=300;
- $back = phplatex_colorhex($br,$bg,$bb);
- $fore = phplatex_colorhex($r,$g,$b);
-
# Figure out TeX string, either to get the right cache entry, or to compile
# Adds semi-common symbol packages (ams)
# used to include ,landscape in documentclass to avoid page wrapping, but it seems this sometimes implies 90 degree rotation
$totex = "\\documentclass[14pt]{extarticle}\n".
- "\\usepackage{color}\n".
+ "\\usepackage{xcolor}\n".
"\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\usepackage{amssymb}\n".
$extraprelude."\n".
"\\pagestyle{empty}\n". #removes header/footer; necessary for trim
"\\begin{document}\n".
- "\\color[rgb]{".$r.",".$g.",".$b."}\n".
- "\\pagecolor[rgb]{".$br.",".$bg.",".$bb."}\n".
+ "\\color[HTML]{".$fore."}\n".
+ "\\pagecolor[HTML]{".$back."}\n".
$string."\n".
"\\end{document}\n";
$hashfn = sha1($totex).".".$dpi.".".$fore.".".$back.".".intval($trans); #file cache entry string: 40-char hash string plus size