more efficient latex input check
fix generic completions