Take the 2-minute tour ×
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.

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

2 Answers 2

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

\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}
share|improve this answer
1  
ChkTeX is still reading the TikZ code in your example. –  Hans-Peter E. Kristiansen Mar 4 '12 at 13:26

Your Answer

 
discard

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.