0

I measured the distance between the center of the north anchor and north of a node and got 7.20068 pt which is 0.1 inches. This is for a especial case as below: enter image description here

Here is my code:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary {positioning}
\usetikzlibrary { calc}
\begin{document}

\begin{tikzpicture} [simple/.style={rectangle,draw, inner sep=0pt,minimum size=10 pt}]

\node[simple] (the node) {}; \node (the anchor) [red,above] at (the node.north) {$a < b$};

\draw[latex-latex] let \p1 = ($(the anchor.center)-(the node.north)$), \n1={veclen(\x1,\y1)} in (the node.north) -- node[above] {\n1} (the anchor.center); \end{tikzpicture}

\end{document}

The main question is: assuming the fontsize is constant let us say 10 pt, how the length of the string inside anchor affects this distance? If instead of $a > b$ we make a longer string such as $aaaaaaaaaaaaa$ the distance described above changes. The question is how it varies.

Aria
  • 1,523
  • Hi Aria, I answered your question, but without context what you want to achieve, it is hard to help. I therefore had to stick to the questions, as they were worded. – TobiBS Jul 23 '20 at 10:48

1 Answers1

1

As you are not disclosing for what purpose you need to know the distance between node center and north anchor, it is really hard to help here, therefore I answer your questions straight:

Is this true in general?

No it is not, because the size of a node is dependent on its content, therefore imagine your node has another font size, like \node (the anchor) [red,above] at (the node.north) {\LARGE $a < b$};, then the distance is different, too:

enter image description here

If not, what is the default distance?

Following the logic of the size dependency from the content, there cannot be a default distance.

Marijn
  • 37,699
TobiBS
  • 5,240