Skip to content

Anglepic#1369

Open
Qrrbrbirlbel wants to merge 3 commits into
pgf-tikz:masterfrom
Qrrbrbirlbel:anglepic
Open

Anglepic#1369
Qrrbrbirlbel wants to merge 3 commits into
pgf-tikz:masterfrom
Qrrbrbirlbel:anglepic

Conversation

@Qrrbrbirlbel

Copy link
Copy Markdown
Contributor

Fixes #1363

Checklist

Please signoff your commits to explicitly state your agreement to the Developer Certificate of Origin. If that is not possible you may check the boxes below instead:

Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com>
Signed-off-by: Qrrbrbirlbel <qrrbrbirlbel+github@gmail.com>
Comment thread doc/generic/pgf/CHANGELOG.md Outdated
Comment on lines -36 to -39
The three points \meta{A}, \meta{B}, and \meta{C} \emph{must} be the names
of nodes or coordinates; you cannot use direct coordinates like ``|(1,1)|''
here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing, how about rewrite it to

    The three points \meta{A}, \meta{B}, and \meta{C} can be either the names
    of nodes or coordinates, or direct coordinates like ``|(1,1)|''.

to document the extended syntax.

@Qrrbrbirlbel Qrrbrbirlbel Jan 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but it needs to be ``|1,1|'' then because the () are inserted by the pic's setup code. So pic […] {angle = {A--1,1--B.south west}} or pic […] {angle = A--{1,1}--B.south west} would be valid syntax.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.

Then this syntax seems a bit more strange. Is a key-value interface needed here as well?

@Qrrbrbirlbel Qrrbrbirlbel Jan 21, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't mind one. I always put the coordinates in the wrong order anyway. :D
But is it so strange? Sure, in most cases, the () are used to indicate something is a coordinate (and baseline et al uses it to decide between a value and a coordinate).
But there are also many that don't use the ():

  • the technically deprecated (intersection of A--B and C--D) syntax where additional parentheses are missing (it even has the --)
  • (A |- B) (and not ((A) |- (B)) = ({(A)} |- {(B)})) as well as
  • below = of A.

They would all also allow 1, 1, the latter only with {}, of course.


We can check for -- – twice even – and use the old syntax (both for backwards compatibility and for the simple syntax), otherwise use start direction = (A), center = {(1, 1)}, end direction = (B.south west). I'd would even be as fancy as allowing start direction = (A), center = {(1, 1)}, delta angle=60. (But that can give weird results with xyz coordinate systems whose axes don't align with the canvas coordinate system. The arc/circle path operators solve this by choosing one or the other by looking whether the radii have a unit.)

The advantage of a key-value interface would be that it allows to set, say, a center coordinate for multiple angles.

Co-authored-by: Yukai Chou <muzimuzhi@gmail.com>
@hmenke

hmenke commented Jun 15, 2026

Copy link
Copy Markdown
Member

I have merged the regression tests. Could you please rebase this onto master?

@hmenke

hmenke commented Jun 16, 2026

Copy link
Copy Markdown
Member

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-library-angles
      • pgfmanual-en-main-body
      • pgfmanual-en-tikz-pics
      • pgfmanual-en-tutorial
  • latexdvips
    • config-examples
      • pgfmanual-en-library-angles
      • pgfmanual-en-main-body
      • pgfmanual-en-tikz-pics
      • pgfmanual-en-tutorial
  • latexdvisvgm
    • config-examples
      • pgfmanual-en-library-angles
      • pgfmanual-en-main-body
      • pgfmanual-en-tikz-pics
      • pgfmanual-en-tutorial
  • luatex
    • config-examples
      • pgfmanual-en-library-angles
      • pgfmanual-en-main-body
      • pgfmanual-en-tikz-pics
      • pgfmanual-en-tutorial
  • xetex
    • config-examples
      • pgfmanual-en-library-angles
      • pgfmanual-en-main-body
      • pgfmanual-en-tikz-pics
      • pgfmanual-en-tutorial

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.

Pic angle in a pic doesn't respect pic name/name prefix.

3 participants