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

Don Green Dragon fergdc at Shaw.ca
Thu Nov 13 09:14:45 CET 2014

Hello George,

On 11Nov2014, at 7:03 PM, George Gratzer <gratzer at me.com> wrote:

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

Yes, it does miss those missing «;» guys. However, it catches much trickier errors than that. Of course, perhaps you do not record as many blunders as I do.  :-)

> Type only few lines, typeset.

In this case I had typed but a few lines — thought they were bulletproof. It was the error message that befuddled me. Ross Moore’s suggestion surprised me for the error was then identified as occurring in the TikZ code.

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

The instance that I related is the ONLY one I’ve experienced wherein an error in the TikZ code was caught but not  identified as occurring within the TikZ code. AND, I have established an impressive  compendium of 'TikZ code' errors. 

> 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…

What «first introductory» example is that? Examples, from Till’s manual that I’ve checked, work.

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

More information about the macostex-archives mailing list