I'm trying to prepare math exercises for kids. To that end, I have the following minimal turtle ride:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{turtle}
\def\xs{1,2,3}
\begin{document}
\begin{tikzpicture}[turtle/distance=8em]
\draw [thick][turtle={home,right}]
\foreach \i in \xs
{
[turtle={forward,left}] node[above]{\i}
[turtle={forward,right}]
};
\end{tikzpicture}
\end{document}
This yields:
What I'm trying to do is to annotate the horizontal pieces with the numbers in \xs. Is it possible when using turtle?



node[above,pos=0.25] (n\i) {\i}, and then you can usen1,n2andn3. Would be the same in the turtle version. – Torbjørn T. May 09 '17 at 20:32turtleversion? Modify the line in the loop to be-| node[above,pos=0.25] (n\i) {\i} coordinate[midway] (crnr\i) (\i,\i), and use e.g.(crnr1). In a-|path,pos=0.5(which is the same asmidway) is always at the corner of the path. If you want named coordinates at the(\i,\i)corners as well, use e.g.-| node[above,pos=0.25] (n\i) {\i} coordinate[midway] (crnrA-\i) (\i,\i) coordinate (crnrB\i)– Torbjørn T. May 13 '17 at 20:43