positioning library: error when using coordinates with numbers #728

Closed
opened this issue Aug 7, 2019 · 4 comments
Labels
Milestone

u-fischer commented Aug 7, 2019

 The documentation claims (on page 237) that the of part of a positioning spec can be a coordinate without parentheses but with numbers: An example would be of somenode.north or of 2,3. But of 2,3 errors with Package pgf Error: No shape named 2 is known.` It works if one adds braces: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \draw[help lines](0,0)grid(5,5); %\node [above=1mm of 2,3]{x}; %error \node [above=1mm of {2,3}]{x}; %works \end{tikzpicture} \end{document}

hmenke commented Aug 8, 2019

 Ehm, comma is the list separator, so you have to use braces around it. It's the same for [], which will also not work. For example: \node[label=[red]center:foo] {}; So this is definitely a wont-fix.
closed this Aug 8, 2019
added the label Aug 8, 2019

u-fischer commented Aug 8, 2019

 Sorry I didn't meant that this should be fixed, but that the documentation should be corrected: if explicitly shows the wrong of 2,3.

hmenke commented Aug 9, 2019

 Aha! That should of course be fixed. Sorry for the misunderstanding.
reopened this Aug 9, 2019
added and removed labels Aug 9, 2019
added this to the 3.1.5 milestone Nov 3, 2019
added a commit to hmenke/pgf that referenced this issue Nov 4, 2019
added the label Nov 4, 2019
closed this Nov 4, 2019

Mo-Gul commented Nov 4, 2019

 Maybe it's even worse to add a sentence why the curly braces are needed as you did in your above comment. So something like: For the latter case the curly braces are needed, because the comma is the list separator and thus TikZ cannot distinguish if you provided a coordinate or another optional argument.