binary-husky / binary-husky/gpt_academic

[Bug]: Arxiv翻译时定位主Latex文件时出错

Open
#2,192 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
71.3k
Forks
8.3k
PR merge metrics
No merged PRs in 30d

Description

### Installation Method | 安装方法与平台

Please choose | 请选择

### Version | 版本

Latest | 最新版

### OS | 操作系统

Windows

### Describe the bug | 简述

在进行文章https://arxiv.org/pdf/2407.00918 的Latex全文翻译,定位主Latex文件时报告:
Traceback (most recent call last):
File ".\toolbox.py", line 229, in decorated
yield from f(main_input, llm_kwargs, plugin_kwargs, chatbot_with_cookie, history, *args, **kwargs)
File ".\crazy_functions\Latex_Function.py", line 416, in Latex翻译中文并重新编译PDF
yield from Latex精细分解与转化(file_manifest, project_folder, llm_kwargs, plugin_kwargs,
File ".\crazy_functions\latex_fns\latex_actions.py", line 241, in Latex精细分解与转化
merged_content = merge_tex_files(project_folder, content, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".\crazy_functions\latex_fns\latex_toolbox.py", line 443, in merge_tex_files
assert match is not None, "Cannot find documentclass statement!"
^^^^^^^^^^^^^^^^^
AssertionError: Cannot find documentclass statement!

### Screen Shot | 有帮助的截图

![Image](https://github.com/user-attachments/assets/b3f82acf-5c78-4641-9590-71023e90ff66)

貌似可能是正则的问题(.\crazy_functions\latex_fns\latex_toolbox.py文件443行报错):

![Image](https://github.com/user-attachments/assets/c1e74003-3fdd-428f-a2b3-044fe4571506)

### Terminal Traceback & Material to Help Reproduce Bugs | 终端traceback(如有) + 帮助我们复现的测试材料样本(如有)

文章是:https://arxiv.org/pdf/2407.00918

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Arxiv translation failure on Windows with article 2407.00918, then read crazy_functions/latex_fns/latex_toolbox.py around line 443 and the callers in latex_actions.py and Latex_Function.py. Done means the main LaTeX file is located successfully and the translation proceeds without the “Cannot find documentclass statement!” assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.