SUSYUSTC / MathTranslate

translate scientific papers in latex, especially arxiv papers
https://github.com/SUSYUSTC/MathTranslate
Apache License 2.0
1.05k stars 69 forks source link

some paper can not process #42

Closed h4rk8s closed 1 year ago

h4rk8s commented 1 year ago
Executing command: translate_arxiv 2206.05982
The current mathtranslate is latest
Start
engine google
language from en
language to zh-CN

arxiv number: 2206.05982

temporary directory /var/folders/vt/qvr9908s2p16x02gpkty4c6h0000gn/T/tmplorc7_cg
trying to download from https://arxiv.org/e-print/2206.05982
main tex files found:
./demo.tex
./supplementary.tex
./main.tex
merging ./section/abstract.tex
merging ./section/introduction.tex
merging ./section/related_work.tex
merging ./section/main.tex
merging ./section/datasets.tex
merging ./section/experiments.tex
merging ./tables/all_tables.tex
merging ./tables/main_content}
Traceback (most recent call last):
  File "/Users/****/bin/translate_arxiv", line 8, in <module>
    sys.exit(main())
  File "/Users/****/lib/python3.10/site-packages/mathtranslate/translate_arxiv.py", line 154, in main
    raise e
  File "/Users/****/lib/python3.10/site-packages/mathtranslate/translate_arxiv.py", line 146, in main
    success = translate_dir('.', options)
  File "/Users/****/lib/python3.10/site-packages/mathtranslate/translate_arxiv.py", line 58, in translate_dir
    process_file.merge_complete(tex)
  File "/Users/****/lib/python3.10/site-packages/mathtranslate/process_file.py", line 27, in merge_complete
    assert os.path.exists(filename)
AssertionError
SUSYUSTC commented 1 year ago

Thank you for your issue! Part of the reason is that there's a small bug in the merging file process, which is already fixed in our latest version, and you just need to update the software and retranslate. However, even after fixing this issue, some part of the paper is not shown in overleaf because there's a table in the paper written in a very ugly way, which cannot be identified by latex. If you really need the translated paper you can delete line 156-400 (\begin{table} ...... \end{table}, line number may be slightly different) in the translated "main.tex", then all other parts can be translated. Usually papers will not be written in such ugly way so this issue should appear very rarely.