Daniel Gruss 2 年之前
父节点
当前提交
2a204d6b5e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      generator.php

+ 3 - 0
generator.php

@@ -468,6 +468,7 @@ END;
         $tex = preg_replace("/\\\\includegraphics\s*(?<R>\[((?:[^\[\]]+|(?&R))*)\])(?<Q>{((?:[^{}]+|(?&Q))*)})/i",'\includegraphics${1}{'.$d.'/${4}}',$tex);
         $tex = preg_replace("/\n\s*\\\\maketitle/i","",$tex);
         $tex = preg_replace("/\\\\IEEEoverridecommandlockouts/i","",$tex);
+        $tex = preg_replace("/\\\\twocolumn/i","",$tex);
         $tex = preg_replace("/\n\s*\\\\tikzexternalize/i","",$tex);
         [$ups,$ps] = getusepackages($tex);
         global $included_usepackages;
@@ -502,6 +503,8 @@ END;
 
         if (stripos($tex,"\appendices") !== false || stripos($tex,"\appendix") !== false)
           $tex = handle_appendix($tex);
+        if (!str_starts_with($tex,"\\makeatletter\n\def\\relativepath{\\import@path}\n\\makeatother\n"))
+          $tex = "\\makeatletter\n\def\\relativepath{\\import@path}\n\\makeatother\n" . $tex;
         file_put_contents($file,$tex);
       }
     }