# Is there a way to make ChkTeX ignore TikZ code

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 }

-
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>} .

\documentclass{article}

%\usepackage{tikz}

\usepackage{comment}
\excludecomment{tikzpicture}

\begin{document}

Ceci est un test

\begin{tikzpicture}
\draw (0,0) -- (1,0);
\end{tikzpicture}

Encore un test.

\end{document}

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