fix for issue #37.
improved latex text folding