Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

positioning library: error when using coordinates with numbers #728

Closed
u-fischer opened this issue Aug 7, 2019 · 4 comments
Milestone

Comments

@u-fischer
Copy link

@u-fischer 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

This comment has been minimized.

Copy link
Member

@hmenke 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.

@hmenke hmenke closed this Aug 8, 2019
@u-fischer

This comment has been minimized.

Copy link
Author

@u-fischer 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

This comment has been minimized.

Copy link
Member

@hmenke hmenke commented Aug 9, 2019

Aha! That should of course be fixed. Sorry for the misunderstanding.

@hmenke hmenke reopened this Aug 9, 2019
@hmenke hmenke added manual and removed closed-wont-fix labels Aug 9, 2019
@hmenke hmenke added this to the 3.1.5 milestone Nov 3, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Nov 4, 2019
@hmenke hmenke added the closed-fixed label Nov 4, 2019
@hmenke hmenke closed this Nov 4, 2019
@Mo-Gul

This comment has been minimized.

Copy link
Contributor

@Mo-Gul 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.