latex: removed newlines when ending environments