Tell me more ×
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.

What is the problem with this TikZ code?

\draw (-3, 0)
      arc (0: 45: \myLengthA)
      coordinate (ddb)
      arc (45: 90: \myLengthA)
      node [above left, inner sep = 0.4mm] {$A_k$}
      -- +(-#1 + 3 * \arcDiagramPointSeparation - 4 * \arcHeightStep, 0)
      coordinate (c3);

I want to draw an arc through 90 degrees, but I want to place a coordinate named (ddb) at the 45 degree point on the arc, for later use. But I get:

Runaway argument?
ddb)arc (45: 90: \myLengthA ) node [above left, inner sep = 0.4mm] {$\ETC.
! Paragraph ended before \tikz@@coordinate@at was complete.
<to be read again> 
                   \par 
share|improve this question
3  
Please post a complete (\documentclass, relevant packages and definitions of the preamble, etc.), and minimal version of your document. – Gonzalo Medina May 29 '11 at 23:43
Surely not necessary. The problem is obviously that the above TikZ code does not parse for some reason (see my own answer below). A document is not needed to address the problem. – Hammerite May 30 '11 at 0:30
5  
@Hammerite The reason to post a minimal document instead of a code fragment is that if someone wants to help you they just have to cut and paste the document in order to play with the code. With a fragment they have to add that stuff (plus in some cases guess at which packages or tikz libraries you've loaded.) It's up to you, of course, but people will be more inclined to help if they don't have to do unnecessary work to help. – Alan Munn May 30 '11 at 0:48
2  
I'd like to second what @Alan Munn said: Especially for your example, it's really hard to play around with the code because of the four undefined commands and the #1. Stuff like that should really be removed before posting the question, because it distracts from the problem. Also, for me the problem doesn't appear when I use \def to define arbitrary values for the four commands, and replace the #1 with a number. Are you using an old version of PGF? – Jake May 30 '11 at 5:16
1  
You can check the version by inserting \pgfversion right after \begin{document}. It should be at least v2.1, otherwise you're going to run into other problems down the road (pre 2.1 versions can't align text in nodes, for example). – Jake May 30 '11 at 5:36
show 2 more comments

closed as not a real question by Joseph Wright Jul 17 '11 at 10:52

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

A workaround is to use node [shape = coordinate] instead, as in:

\draw (-3, 0)
      arc (0: 45: \myLengthA)
      node [shape = coordinate] (ddb) {}
      arc (45: 90: \myLengthA)
      node [above left, inner sep = 0.4mm] {$A_k$}
      -- +(-#1 + 3 * \arcDiagramPointSeparation - 4 * \arcHeightStep, 0)
      coordinate (c3);

Even so, I would like to know what is the problem with the original syntax, because to me it looks perfectly valid.

share|improve this answer
2  
it's not very complicated to give us the definitions of \myLengthA, \arcDiagramPointSeparation and \arcHeightStep to get an ECM ! – Alain Matthes May 30 '11 at 5:57
As others have said, you aren't going to get an answer without more details and/or a minimal example. Using various innocuous definitions for \myLengthA I can't reproduce the problem with the original code, with pgf 2.10 -- it seems to compile and render as expected, no matter how the coordinate is described. So there must be something unexpected in the definition, or possibly a bug in some old version of pgf that is now fixed. – kgr May 30 '11 at 21:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.