I'm trying to get a leftrightarrow under a chunk of text with text centered under each arrow so it would look something like this
v = (0 1 ... 1 0 ... 0)
<-----> <----->
n p
I've tried
\begin{array}{lccr}
v = (0 & \underleftrightarrow{1 \cdots 1} & \underleftrightarrow{0 \cdots 0} &) \\
& p & n &
\end{array}
But I find there is not enough vertical space between 1 ... 1 and the arrow, but there is too much space between the arrow and p. Also, the horizontal spacing is uneven.
The spacing here is rather better
\begin{align*}
v = (0\ & 1 \cdots 1\ 0 \cdots 0) \\
& \overleftrightarrow{\phantom{1 \cdots 1}}\ \overleftrightarrow{\phantom{0 \cdots 0}}
\end{align*}
but then I don't know how to attach text under the arrows.
Writing text over a \leftrightarrow doesn't cut it for me, since I want the v = etc to be aligned to the rest of the line with the arrow underneath.


