pylatexenc icon indicating copy to clipboard operation
pylatexenc copied to clipboard

latex2text prints spurious new line in the end

Open lsoksane opened this issue 4 years ago • 1 comments
trafficstars

Running

echo foo | latex2text

gives two lines, the second of which is empty.

lsoksane avatar Sep 22 '21 07:09 lsoksane

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.

phfaist avatar Nov 04 '21 16:11 phfaist