binary-husky / binary-husky/gpt_academic

[Feature]: 必要时由用户指定 LaTex 主文件

Open
#1,946 1 comment 0 reactions 0 assignees View on GitHub
Stale
Dominant language
Python
Stars
71.3k
Forks
8.3k
PR merge metrics
No merged PRs in 30d

Description

#### Class | 类型

None

#### Feature Request | 功能请求

我在使用 arXiv 论文翻译插件翻译这篇 [arXiv 论文时](https://arxiv.org/abs/2405.14093),插件误认为 `appendix_ieee.tex` 为 LaTeX 主文件。阅读相关源代码后注意到对主文件的判断是基于文件内容中的关键词的,在一些特殊情况下,这种策略可能无法找到正确的文件。

因此,一方面建议**考虑在特殊函数插件的高级参数输入区添加一个新的输入,允许用户自己指定主 tex 文件**,也许可以避免由于查找策略不准确而导致主文件定位有误的问题。另一方面,**可考虑加入对文件名的判断逻辑**。在该 LaTeX 项目中,主文件实际上是一目了然的(main_ieee.tex),在保留先前打分逻辑的基础上,可以考虑在文件名中查找 `main` 等关键词,以增强插件的主文件定位能力。

我在调试器中将 `maintex` 变量修改为正确的主 tex 文件路径后,论文能够被正确地翻译。下面是 LaTeX 项目的主要结构,供您参考。

```
arXiv-2405.14093v1
│ appendix_ieee.tex
│ main_ieee.bbl
│ main_ieee.tex

├─appendix
│ some tex files...

├─figures
│ some pdf files...

├─sections
│ some tex files...

└─tables
│ some tex files...
```

最后,感谢您精彩的工作!🎉

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the source that scores LaTeX files and assigns the `maintex` variable, then inspect the special-function plugin's advanced-parameter inputs. Reproduce the arXiv-2405.14093 structure with `appendix_ieee.tex` and `main_ieee.tex`. Done means the intended main file can be selected reliably, including when the existing content-based detection chooses the wrong file.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.