Skip to content

Simplify \coordinate at parsing #785#1034

Draft
hmenke wants to merge 1 commit into
pgf-tikz:masterfrom
hmenke:dcl@coord
Draft

Simplify \coordinate at parsing #785#1034
hmenke wants to merge 1 commit into
pgf-tikz:masterfrom
hmenke:dcl@coord

Conversation

@hmenke

@hmenke hmenke commented Jul 29, 2021

Copy link
Copy Markdown
Member

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

hmenke commented Jul 29, 2021

Copy link
Copy Markdown
Member Author

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

@muzimuzhi

Copy link
Copy Markdown
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

hmenke commented Jul 30, 2021

Copy link
Copy Markdown
Member Author

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

hmenke commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

On 2026-06-15 a more comprehensive testsuite was introduced for PGF/TikZ. This tests all new contributions against the examples extracted from the manual and checks whether anything has changed to avoid regressions. Since this pull request was opened before that, these tests were not run automatically. I have run l3build check on the result of the merge of this pull request branch into master. The result can be found below.

Tip

Your pull request might have failed some tests. This does not mean that your contribution will be rejected. In fact, depending on the changes you propose, it might even be expected that some tests fail, however, this needs to be evaluated carefully.

Failed tests
  • pdftex
    • config-examples
      • pgfmanual-en-math-parsing
      • pgfmanual-en-tikz-coordinates
      • pgfmanual-en-tutorial-Euclid
  • latexdvips
    • config-examples
      • pgfmanual-en-math-parsing
      • pgfmanual-en-tikz-coordinates
      • pgfmanual-en-tutorial-Euclid
  • latexdvisvgm
    • config-examples
      • pgfmanual-en-math-parsing
      • pgfmanual-en-tikz-coordinates
      • pgfmanual-en-tutorial-Euclid
  • luatex
    • config-examples
      • pgfmanual-en-math-parsing
      • pgfmanual-en-tikz-coordinates
      • pgfmanual-en-tutorial-Euclid
  • xetex
    • config-examples
      • pgfmanual-en-math-parsing
      • pgfmanual-en-tikz-coordinates
      • pgfmanual-en-tutorial-Euclid

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.

2 participants