phfaist / pylatexenc

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

latex2text prints spurious new line in the end #67

Closed lsoksane closed 1 year ago

lsoksane commented 2 years ago

Running

echo foo | latex2text

gives two lines, the second of which is empty.

phfaist commented 2 years ago

Yes, latex2text works like the echo command and adds a newline at the end of the output text. It's more convenient that way when you invoke it with LaTeX code that does not end in a newline, e.g., latex2text -c '\alpha+\beta=1'.

I'll consider adding an option, e.g., -n, to suppress the final newline in a future version of pylatexenc.