Yes, you can measure the width. With
\sbox0{$\scriptstyle N-$}
and one
\hspace*{.5\wd0}
before and after the actual content would solve this.
But it is easier to use the text width
key (or minimum width
subtracting the /pgf/inner xsep
values). You can use either \widthof
(more robust) or PGFmath’s width
function.
Furthermore you can also simply specify any arbitrary value for minimum width
or text width
.
And if you do not want to give the content before hand you can use the .aux
file as in Dependent node size in TikZ.
Code
\documentclass[tikz,convert=false]{standalone}
\begin{document}
\begin{tikzpicture}[nodes=draw]
\node {$v_{N-1}$};
\node at (0,-.5) {$v_0$};
\end{tikzpicture}
\begin{tikzpicture}[nodes={draw,align=center,text width=\widthof{$v_{N-1}$}}]
\node {$v_{N-1}$};
\node at (0,-.5) {$v_0$};
\end{tikzpicture}
\begin{tikzpicture}[nodes={draw,align=center,text width=width("$v_{N-1}$")}]
\node {$v_{N-1}$};
\node at (0,-.5) {$v_0$};
\end{tikzpicture}
\begin{tikzpicture}[nodes={draw,minimum width=+3.5em}]
\node {$v_{N-1}$};
\node at (0,-.5) {$v_0$};
\end{tikzpicture}
\begin{tikzpicture}[nodes=draw]
\node {$v_{N-1}$};
\node at (0,-.5) {\sbox0{$\scriptstyle N-$}\hspace*{.5\wd0}$v_0$\hspace*{.5\wd0}};
\end{tikzpicture}
\end{document}
Output
Original

\widthof{…}

width("…")

Arbitrary value

Measuring

\sbox0{$\scriptstyle N-$}
and then you can use\hspace{.5\wd0}
on both ends. But why don’t you use theminimum width
key to esnure a certain width for all nodes (bubbles). Or even something like Dependent node size in TikZ?minimum width
key. That fixed my problem.