1

So I'm beginning to learn LaTeX and often find myself mistyping control sequences like \idotsint. I use editor plugins which call lacheck and chktex on the document which helps catch some errors, but whenever I mistype a control sequence, neither tool reports any issue. Instead, tools like pdflatex are left to realize \idotqint doesn't exist.

Is there any way I can get a syntax checker / linter to report if I use an undefined control sequence in my document, preferably so my editor and such can know which line number to point out?

EDIT: I am using vim with the vimtex plugin.

1
  • 1
    Welcome to TeX.SX! This is really an editor issue, so you should say what editor you use to write latex.
    – user30471
    Mar 24, 2016 at 4:10

2 Answers 2

3

It seems that the vimtex plugin actually supports opening the quickfix window when the document fails to compile, but using Neovim prevented vimtex from completely working.

See here for how get it working with Neovim.

2

A long comment, not an answer: The problem is: What is the list of "legal" commands?

A command (aka control sequence) may be defined (and the exist) with several methods (\def, \newcommand, etc.) in the preamble, or in the documental class (.cls file), or in a package (.sty file), or a package loaded with another package or the document class, or a child document include with \input. Moreover a definition could be aplicable to all the document, or only to some part. This works:

\documentclass{article}
\begin{document}
{\def\Me{I exist} \Me  }
\end{document}

But this produce the undefined control sequence error:

\documentclass{article}
\begin{document}
{\def\Me{I exist} \Me } \Me
\end{document}

In summary, it is a hard task for an editor (even for vim) know when a command is defined or not, and therefore the question should not focus in in a syntax checker plugin but in the best plugin to dealing with error messages (but then will be a duplicate of Errors/Warnings in LaTeX Output).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .