In the code below, I poorly put a text below the middle of a polyline. I would like to automate this: the parameter is -.75 in ++(0,-.75) used to draw the polyline. What is the best way to achieve that?
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows.meta, calc}
\tikzset{
->,
>=Stealth,
node distance=3cm,
every state/.style={thick},
initial text =,
}
\newenvironment{tikzautomata}{
\begin{center}
\begin{tikzpicture}[shorten >=1pt, on grid, auto]
}{
\end{tikzpicture}
\end{center}
}
\begin{document}
\begin{tikzautomata}
\node[state]
(0) {$0$};
\node[state, right of=0]
(1) {$1$};
\node[state, right of=1]
(2) {$2$};
\node[state, right of=2]
(3) {$3$};
\node[state, right of=3]
(4) {$4$};
\node[state, right of=4]
(5) {$5$};
% Poor positioning by hand... :-(
\draw
(0.south) |- ++(0,-.75) -| (5.south);
\node (tag) at ([yshift=-47.5pt]$(0)!0.5!(5)$) {Some text};
\end{tikzautomata}
\end{document}