[OS X TeX] Error in TikZ code hard to find

George Gratzer gratzer at me.com
Tue Nov 11 21:03:01 EST 2014


My experience is different. TikZ catches almost no errors except missing “;”. 

Type only few lines, typeset.

I error, comment out new lines, and introduce them a line (or two, if necessary) at a time.
Should save you hours of grief.

If your TikZ code is correct, it will be typeset correctly. Same with LaTeX.
But TikZ is even worse than LaTeX.

How bad: it cannot typeset the first introductory example in the TikZ manual…

GG


> On Nov 11, 2014, at 6:40 PM, Don Green Dragon <fergdc at shaw.ca> wrote:
> 
> Hello All,
> 
> I hope the following will not be too trivial for the knowledgeable people on this list but possibly it will help someone who regularly creates graphics with the wonderful TikZ package.
> 
> Was working on a document with three chapters and was revising certain parts of chapter 1, hence it was the only chapter whose source code was active.
> 
> Decided to include another {tikzpicture} environment. It was very simple and short and I was confident that the code would work, so typeset. TeXShop replies with an error of the form
> 
> .Chapters/Chapter1.tex: 5805: Undefined control sequence
> \Generic error …
> 					#4 \errhelp  \@err@ ...
> 
> l. 5805 … y over the closed interval $[0 \,..\, p]
> 										   $.
> 
> I get those kind of messages all the time because I make careless mistakes in typing; e.g., type \em[h{. . .} instead of \emph{. . .}. Usually the error message identifies the offending control sequence, but in this case I could not figure out which string was the offender.
> 
> By the way, I use  source code fragments of the form $[a \,..\, b]$ often and they had caused no problems in the past. I focused on what appeared to be the offending  $[0 \,..\, p]$.
> 
> After a couple of hours of trying this and that, including a suspicion that TeXShop was acting badly and so  RESTART and SHUT DOWM were tried, and much more, which I will avoid relating. Here follows my error. 
> 
> In the code for {tikzpicture} I had written (not including the line number 5682)
> 
> 5682 \path (7, 0.5) node[right[ {Picture of blah blah blah};
> 
> instead of 
> 
> 5682 \path (7, 0.5) node[right] {Picture of blah blah blah};
> 
> and it was that incorrect occurrence of `[‘ that triggered the error that was reported about line 5805.
> 
> I know! I should have checked the tikzpicture code right away since the attempt to typeset it resulted in `strange’ behaviour. Usually, TikZ catches those sort of errors so you can track them down.
> 
> That’s it.
> 
> 
> don green dragon
> fergdc at shaw.ca
> 
> 
> 
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex



More information about the MacOSX-TeX mailing list