ChkTeX does not like TikZ, and will report a bunch of errors. Is there a way to make ChkTex ignore TikZ code?


According to the ChkTeX manual, you can ignore the contents of an enivronment completely by adding its name to the VerbEnvir entry of the configuration file .chktexrc. So in order to not check PGF/TikZ environments, this file should look like this:

# Exclude these environments from syntax checking
VerbEnvir { pgfpicture tikzpicture }
  • 1
    Thanks - that was what I needed. Apparently it is only working if .chktexrc is in the folder from which chktex is run. – hpekristiansen Mar 4 '12 at 13:32
  • 2
    @Hans-PeterE.Kristiansen It should work if .chktexrc is in your home directory. I'm not sure if that works on Windows though. You can always set the environment variable CHKTEXRC to point to the directory containing .chktexrc. – Ivan Andrus Apr 19 '12 at 10:09
  • 1
    FWIW, I have include tikzpicture and pgfpicture as verbatim environments by default in the latest version of ChkTeX (which you'll have to compile yourself at the moment). – Ivan Andrus Jun 10 '12 at 12:19

I don't know how ChkTeX looks through a document (I don't use it), but the following works for me to block out portions of code: use the comment package. First comment out the Tikz related stuff in the preamble, then use the comment package to exclude the tikzpicture environment. Warning: the \begin{tikzpicture} and \end{tikzpicture} must be on lines of their own. This technique won't work for inline \tikz{<code>} .





Ceci est un test

\draw (0,0) -- (1,0);

Encore un test.

  • 1
    ChkTeX is still reading the TikZ code in your example. – hpekristiansen Mar 4 '12 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.