Move latex specific stuff out of the base lexer implementation.