1

According to section 101.5.3 (Command for Declaring New Shapes) of chapter 101 (Nodes and Shapes) of the TikZ & PGF manual for version 3.0.1a (p. 1034), the following code-snippet is the definition of PGF's built-in coordinate node shape.

\pgfdeclareshape{coordinate}{%
    \savedanchor\centerpoint{%
        \pgf@x=.5\wd\pgfnodeparttextbox%
        \pgf@y=.5\ht\pgfnodeparttextbox%
        \advance\pgf@y by -.5\dp\pgfnodeparttextbox%
    }
    \anchor{center}{\centerpoint}
    \anchorborder{\centerpoint}
}

Note the use of the macro \pgfnodeparttextbox. This macro is created automatically by PGF and stores the textbox (a simple TeX box) of the coordinate's label. This textbox is placed such that its lower left corner coincides with the text anchor. If no such anchor is explicitly defined, it is at the origin by default (this is stated in the bottom of p. 1036).

Therefore, I would expect the center of the node to be located at .5(W,H), where W is \pdfnodeparttextbox's width, and H is \pdfnodeparttextbox's total height, i.e. <label height> + <label depth>. However according to the above code, the \pgf@y of the center of the node is at .5*(<label height> - <label depth>).

Evan Aad
  • 11,066

1 Answers1

2

The manual says

This anchor (text) is used upon creation of a node to determine the lower left corner of the text label (within the private coordinate system of the shape). By default, the text anchor is at the origin, but you may change this.

This is not saying that the lower left corner will coincide the text, the origin. The preceding paragraph might makes more sense if it reads

This anchor (text) is used upon creation of a node to determine the position of the text label (within the private coordinate system of the shape). By default, the text anchor is at the origin, but you may change this.

or

This anchor (text) is used upon creation of a node to determine the left endpoint of the baseline of the text label (within the private coordinate system of the shape). By default, the text anchor is at the origin, but you may change this.


As @percusse suggested in the comment in your another question, you should not take the explanation in the manual too seriously. It might happen that the author changed the implementation but forgot to update counterpart in the manual. Reading the source code you may learn more.

Symbol 1
  • 36,855