diff --git a/crazy_functions/crazy_functions_test.py b/crazy_functions/crazy_functions_test.py index 23d328f..3fd648a 100644 --- a/crazy_functions/crazy_functions_test.py +++ b/crazy_functions/crazy_functions_test.py @@ -185,6 +185,7 @@ def test_Latex(): txt = "C:/Users/fuqingxu/Desktop/旧文件/gpt/paperx" txt = "C:/Users/fuqingxu/Desktop/旧文件/gpt/papery" txt = r"C:\Users\fuqingxu\Desktop\旧文件\gpt\latex2pdf\2023-06-03-14-57-06" + txt = r"C:\Users\fuqingxu\Desktop\旧文件\gpt\latex2pdf\2023-06-03-15-40-20" for cookies, cb, hist, msg in (Latex翻译中文并重新编译PDF)(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port): cli_printer.print(cb) # print(cb) diff --git a/crazy_functions/latex_utils.py b/crazy_functions/latex_utils.py index 8fe609d..10d82d3 100644 --- a/crazy_functions/latex_utils.py +++ b/crazy_functions/latex_utils.py @@ -156,6 +156,8 @@ class LatexPaperSplit(): split_worker(root, r"\\begin\{figure\*\}(.*?)\\end\{figure\*\}", re.DOTALL) split_worker(root, r"\\begin\{table\}(.*?)\\end\{table\}", re.DOTALL) split_worker(root, r"\\begin\{table\*\}(.*?)\\end\{table\*\}", re.DOTALL) + split_worker(root, r"\\begin\{minipage\}(.*?)\\end\{minipage\}", re.DOTALL) + split_worker(root, r"\\begin\{minipage\*\}(.*?)\\end\{minipage\*\}", re.DOTALL) split_worker(root, r"\\begin\{align\*\}(.*?)\\end\{align\*\}", re.DOTALL) split_worker(root, r"\\begin\{align\}(.*?)\\end\{align\}", re.DOTALL) split_worker(root, r"\\begin\{equation\}(.*?)\\end\{equation\}", re.DOTALL) @@ -341,7 +343,7 @@ def remove_buggy_lines(file_path, log_path, tex_name, tex_name_pure, n_fix, work return False, 0, [0] -def compile_latex_with_timeout(command, timeout=90): +def compile_latex_with_timeout(command, timeout=60): import subprocess process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) try: