[OS X TeX] Error in TikZ code hard to find
Ross Moore
ross.moore at mq.edu.au
Wed Nov 12 00:54:20 CET 2014
Hi Don,
On 12/11/2014, at 10:40 AM, Don Green Dragon 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]
What happens if you put a set of braces around the first {tikzpicture} environment?
i.e.
{
\begin{tikzpicture}
...
\path (7, 0.5) node[right[ {Picture of blah blah blah}
...
\end{tikzpicture}
}
I'd expect that the error should now show up much earlier,
instead of 100+ lines later.
> $.
>
> 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
Hope this helps,
Ross
------------------------------------------------------------------------
Ross Moore ross.moore at mq.edu.au
Mathematics Department office: E7A-206
Macquarie University tel: +61 (0)2 9850 8955
Sydney, Australia 2109 fax: +61 (0)2 9850 8114
------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.png
Type: image/png
Size: 5257 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20141112/47cd2d90/attachment.png>
-------------- next part --------------
More information about the macostex-archives
mailing list