phfaist / pylatexenc

Simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion
https://pylatexenc.readthedocs.io
MIT License
299 stars 37 forks source link

Fail to extract Title in common cases in both pylatexenc V2 and V3 #114

Open MrForExample opened 3 days ago

MrForExample commented 3 days ago

For example, when title in .tex file have following format:

latex_to_text -> nodelist_to_text -> macro_node_to_text would fail to extract the text completely and return the empty string

MrForExample commented 2 days ago

Update:

I dig into the https://github.com/phfaist/pylatexenc/blob/main/pylatexenc/latex2text/_defaultspecs.py#L175

Turns out value is stored in LatexNodes2Text._doc_title variable

Right now, it can work for \title{FlexiTex: Enhancing Texture Generation with Visual Guidance} But still fail on \title[DeepMimic: Example-Guided Deep Reinforcement Learning of Physics-Based Character Skills]{DeepMimic: Example-Guided Deep Reinforcement Learning\\ of Physics-Based Character Skills}, which will return '['