TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 7 down vote accepted

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 }
share|improve this answer
Thanks - that was what I needed. Apparently it is only working if .chktexrc is in the folder from which chktex is run. – Hans-Peter E. Kristiansen Mar 4 '12 at 13:32
@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
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.

share|improve this answer
ChkTeX is still reading the TikZ code in your example. – Hans-Peter E. Kristiansen Mar 4 '12 at 13:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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