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

TikZ trims spaces from named points only sometimes #747

Closed
PhelypeOleinik opened this issue Sep 15, 2019 · 2 comments
Closed

TikZ trims spaces from named points only sometimes #747

PhelypeOleinik opened this issue Sep 15, 2019 · 2 comments

Comments

@PhelypeOleinik
Copy link
Member

From this TeX.SX thread: https://tex.stackexchange.com/q/508391/134574
TikZ trims spaces around node names, but only sometimes. Apparently when the node name is followed by a ) the space is not removed:

\input tikz
\tikz{
  \coordinate (A) at (0,0);
  \coordinate (B) at (1,1);
  \draw ( A ) -- (B);
  %        ^ No shape named 'A ' is known;
  \draw ( A -| B ) -- (B-|A);
  %             ^ No shape named 'B ' is known;
}
\bye

But leading spaces apparently are always removed.

I would say TikZ should always trim the spaces around the node name.

One could argue that this can break existing code which relies on this feature, but relying on trailing spaces is weird, I think :-)

If not, then perhaps the error message could be changed to add quotes around the node name so that the trailing space is more easily seen (suggested here: https://tex.stackexchange.com/q/389388/134574).

@hmenke
Copy link
Member

hmenke commented Sep 15, 2019

One could argue that this can break existing code which relies on this feature, but relying on trailing spaces is weird, I think :-)

That is the reason why I will probably not fix this in the core. I'm already breaking too much stuff. However, I could provide a fix as a library.

@hmenke hmenke added the node label Sep 15, 2019
hmenke added a commit to hmenke/pgf that referenced this issue Nov 3, 2019
So that leading and trailing spaces are easier to spot.
@hmenke hmenke added this to the 3.1.5 milestone Nov 3, 2019
@hmenke
Copy link
Member

hmenke commented Nov 4, 2019

I've implemented the suggestions with the quotes but I will not change the core behaviour. I'm thus marking it as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants