0

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 describes the placement of a node's label with respect to the node's shape as follows (p. 1035).

For a node part called XYZ the TeX-box \pgfnodepartXYZbox is placed at anchor XYZ.

I find the expression 'placed' ambiguous. How is the box placed at the anchor? Which point of the box coincides with the anchor, and what is the box's direction?

  • 1
    user defines the anchor. The orientation is horizontal what else? I don't see any ambiguity – percusse Jul 23 '17 at 9:24
  • @percusse: Which point of the box coincides with the anchor when the box is placed? We are talking about TeX boxes here. TeX boxes don't have anchors. – Evan Aad Jul 23 '17 at 9:26
  • So from that we can conclude what? Exactly a tex box placement rule – percusse Jul 23 '17 at 9:28
  • @percusse: I don't know what the TeX box placement rule is with respect to a specified point. – Evan Aad Jul 23 '17 at 9:28
  • Again I think you need to define a node to see what uses what. You are judging the code by its manual. The main part TeX box size defines the location of the anchors. See the section for \pgfmultipartnode is defined as the paragraph continues. – percusse Jul 23 '17 at 9:34
4

Honestly I had not read carefully this part of the manual. I learned everything about nodes by looking carefully into the big pictures listed under Libraries -> Shape Library together with the source code. For instance

Now let me try to answer your question.

How is the box placed at the anchor?

  • First, PGF shifts the coordinate system (using \pgftransformshift) so that the anchor becomes the origin.
  • Then, PGF executes \pgfqboxsynced which will write the box content into the PDF file, with the information that the box is placed at the origin of the current coordinate system.

Which point of the box coincides with the anchor

  • Conventionally it will be the left endpoint of the baseline of the box that coincides with the anchor.

What is the box's direction?

  • There is only one direction one can place a box. All boxes should be upright unless the canvas transform kicks in.
  • You wrote: "Conventionally it will be the left endpoint of the box that coincides with the anchor.". So how do you explain this? I'm tending to believe that it's actually the left baseline point that coincides with the anchor. – Evan Aad Jul 23 '17 at 12:01
  • @EvanAad (1) I miss one word: the left endpoint of the baseline of the box. (2) I am about to answer the question. – Symbol 1 Jul 23 '17 at 12:02
  • I tend to agree with you, however this goes contrary to the following statement made on p. 1037 of the manual: "This anchor is used upon creation of a node to determine the lower left corner of the text label". I think maybe there's an accidental omission in this statement just like the one you originally made in your answer, as you indicated in the comment above. – Evan Aad Jul 23 '17 at 12:06
  • 1
    @EvanAad Or maybe it is very difficult to keep in mind that boxes have depth. There is a place where you can report bugs in the manual . – Symbol 1 Jul 23 '17 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.