With tikz
library calc
, it is possible to center a node between two points:
\node (node3) at ($(node1)!0.5!(node2)$) {centered};
Whatever is the direction of the line passing through node1
and node2
, this makes node3
horizontally centered along this direction.
Is is possible to center instead a node between 4 nodes, when they form a regular shape such as a square, or rectangle, or rhombus? So that the node is both horizontally and vertically centered.
Best Answer
You can perhaps use
barycentric cs
: