SUSYUSTC / MathTranslate

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

mis-translate \bib item to Chinese #77

Open rotcx opened 9 months ago

rotcx commented 9 months ago

image image

case: 2311.12023

rotcx commented 9 months ago

image

case: 2302.07842

rotcx commented 9 months ago

image

case: 2002.05202v1

rotcx commented 9 months ago

found one issue: \citep [例如][] { ravi_optimization_2017,finn_model-agnostic_2017,hochreiter_learning_2001 }

\citep command with [options] not recognized by regexp

rotcx commented 9 months ago

found one issue: \citep [例如][] { ravi_optimization_2017,finn_model-agnostic_2017,hochreiter_learning_2001 }

\citep command with [options] not recognized by regexp

In LaTeX, when using the natbib package, you can use the citep command with two square brackets to specify prenotes and postnotes for the citation. The first square bracket is for the prenote, which appears before the author and year of the citation, and the second square bracket is for the postnote, which appears after the author and year. For example:

\citep[see][pp.100-101]{smith2000}

This will generate a citation similar to "(see Smith, 2000, pp.100-101)".

Please note that the exact format of the citation may vary depending on the settings of natbib and the style of the bibliography (bibliographystyle).

temp solve by using

    pattern_citep = r'\\citep\[(.*?)\]\[(.*?)\]\{(.*?)\}'
    latex_obj_regex = [
        pattern_citep,

In order to control the scope of impact, I dare not be too abstract...

image

rotcx commented 9 months ago

image

case: 1905.05067v1