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

Simplify \coordinate at parsing #785 #1034

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hmenke
Copy link
Member

@hmenke hmenke commented Jul 29, 2021

Motivation for this change

This is another attempt at fixing #785 to make the \coordinate at
construction compatible with the (as of yet) internal \tikz@dcl@coord@
mechanism.

In some ways this is a quick and dirty fix because it doesn't remove
the flaw of the original implementation of expecting a literal ( at
the start of the coordinate. In principle the same as for
\tikz@scan@one@point should be done which expands tokens until it finds
a literal (.

Checklist

Please check the boxes to explicitly state your agreement to these terms:

This is another attempt at fixing pgf-tikz#785 to make the \coordinate at
construction compatible with the (as of yet) internal \tikz@dcl@coord@
mechanism.

In some ways this is a quick and dirty fix because it doesn't remove
the flaw of the original implementation of expecting a literal ( at
the start of the coordinate. In principle the same as for
\tikz@scan@one@point should be done which expands tokens until it finds
a literal (.
@hmenke hmenke requested a review from muzimuzhi July 29, 2021 15:45
@hmenke
Copy link
Member Author

hmenke commented Jul 29, 2021

Forgot to handle calc. In that case, I can also go the extra mile and loop over expansions.

@muzimuzhi
Copy link
Member

In muzimuzhi@0a2747a I made an attempt to support a simplified \pgfextra (as simple as \pgfutil@firstofone) in node spec, so \coordinate at can eventually call

\tikz@fig ode[<options>] (<name>) \pgfextra{\def\tikz@fig@content{}} a

With the added detection for changed \tikz@fig@content in \tikz@fig@scan@at, #785 could be solved. Though I guess you're not a fan of this use of \pgfextra.

PS: I just realized \path coordinate and \node[coordinate] {<content>} are different. In order to auto insert {} at appropriate position, \path coordinate has a so strict/limited and not-yet-documented syntax. For example, foreach is not supported, and \coordinate (name) [...] at (coord) is not supported too.

@hmenke
Copy link
Member Author

hmenke commented Jul 30, 2021

As always, thanks for your very insightful input. You are definitely right. We have to promote coordinate to a first class member of the syntax instead of rewriting it to \node[shape=coordinate] under the hood.

@hmenke hmenke marked this pull request as draft September 17, 2021 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants