latex lexer: proper handling of whitespaces without changing (too much) the input string