@@ -553,6 +553,7 @@ END;
if (count($matches) > 3)
$graphicspath = $matches[2];
$tex = preg_replace("/\\\\includegraphics\s*(?<R>\[((?:[^\[\]]+|(?&R))*)\])(?<Q>{((?:[^{}]+|(?&Q))*)})/i",'\includegraphics${1}{'.$d."/".$graphicspath.'${4}}',$tex);
+ $tex = str_replace("$graphicspath$graphicspath","$graphicspath",$tex);
global $sloppy_begin;
global $sloppy_end;
$tex = preg_replace("/\s*\\\\bibliography\s*(?<R>{((?:[^{}]+|(?&R))*)})/i","\n".$sloppy_begin.'