¿Cómo pongo "L" y "R" exactamente en el medio de mis líneas tikz?

¿Cómo pongo "L" y "R" exactamente en el medio de mis líneas tikz?

Como pregunta complementaria a mi última pregunta. Si tuviera el siguiente gráfico:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[margin=2.625cm]{geometry}
\usepackage{subcaption}
\begin{document}
\begin{tikzpicture}
\fill (1.5,1.5) circle [radius=0.05] node[above, yshift=-0.03cm, font=\small]{2} ;
\draw[<-, line width=0.3pt, >=stealth] (0.7,0.0) -- (1.5,1.5) node[xshift=-0.4cm, 
 yshift=-0.5cm, font=\tiny]{L};
\draw[<-, line width=0.3pt, >=stealth] (1.5,1) -- (1.5,1.5) node[xshift=0.4cm, yshift=-0.13cm, 
 font=\tiny]{R};

\fill (1.5,1) circle [radius=0.05] node[above, xshift=0.1cm, yshift=-0.03cm, font=\small]{3};
\draw[<-, line width=0.3pt, >=stealth] (0.7,0.0) -- (1.5,1) node[xshift=-0.2cm, yshift=-0.1cm, 
font=\tiny]{L};
\draw[<-, line width=0.3pt, >=stealth] (2.3,1) -- (1.5,1) node[xshift=0.35cm, yshift=0.1cm, font=\tiny]{R};

\fill (2.3,1) circle [radius=0.05] node[above, yshift=-0.03cm, font=\small]{4};
\draw[<-, line width=0.3pt, >=stealth] (2.3,0.0) -- (2.3,1) node[xshift=0.1cm, yshift=-0.4cm, font=\tiny]{L};
\draw[<-, line width=0.3pt, >=stealth] (1.5,1.5) -- (2.3,1) node[above, xshift=-0.9cm, yshift=0cm, font=\tiny]{R};

\fill (1.5,0.5) circle [radius=0.05] node[above, xshift=0.1cm, yshift=-0.03cm, font=\small]{5};
\draw[<-, line width=0.3pt, >=stealth] (0.7,0)-- (1.5,0.5) node[xshift=-0.3cm, yshift=-0.05cm, font=\tiny]{L};
\draw[<-, line width=0.3pt, >=stealth] (1.5,1)  -- (1.5,0.5) node[pos=0.5, font=\tiny]{R};

 \end{tikzpicture}
 \end{document}

¿Cómo pongo la "L" y la "R" exactamente en el medio de la línea? Es realmente complicado intentar hacerlo con xshift e yshift.

Respuesta1

Debes especificar el nodo en el camino y no al final, lo agregué a mitad de camino y lo incliné para los enlaces inclinados.

Te dejaré mejorar este código.

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[margin=2.625cm]{geometry}
\usepackage{subcaption}
\begin{document}
\begin{tikzpicture}[scale=3]
\fill (1.5,1.5) circle [radius=0.05] node[above, yshift=-0.03cm, font=\small]{2} ;
\draw[<-, line width=0.3pt, >=stealth] (0.7,0.0) --node[midway,sloped, above,
font=\tiny]{L}  (1.5,1.5) ;
\draw[<-, line width=0.3pt, >=stealth] (1.5,1) --node[midway,right,
 font=\tiny]{R} (1.5,1.5) ;

\fill (1.5,1) circle [radius=0.05] node[above, xshift=0.1cm, yshift=-0.03cm, font=\small]{3};
\draw[<-, line width=0.3pt, >=stealth] (0.7,0.0) --node[midway,sloped, above,
font=\tiny]{L} (1.5,1) ;
\draw[<-, line width=0.3pt, >=stealth] (2.3,1) --node[midway,above, font=\tiny]{R} (1.5,1) ;

\fill (2.3,1) circle [radius=0.05] node[above, yshift=-0.03cm, font=\small]{4};
\draw[<-, line width=0.3pt, >=stealth] (2.3,0.0) --  node[midway,right, font=\tiny]{L}(2.3,1);
\draw[<-, line width=0.3pt, >=stealth,brown] (1.5,1.5) -- node[above,sloped,midway, font=\tiny]{R}(2.3,1) ;

\fill (1.5,0.5) circle [radius=0.05] node[above, xshift=0.1cm, yshift=-0.03cm, font=\small]{5};
\draw[<-, line width=0.3pt, >=stealth,blue] (0.7,0)-- node[midway,above,sloped, font=\tiny]{L}(1.5,0.5) ;
\draw[<-, line width=0.3pt, >=stealth,red] (1.5,1)  -- node[pos=0.5, right,font=\tiny]{R} (1.5,0.5) ;

 \end{tikzpicture}
 \end{document}

ingrese la descripción de la imagen aquí

información relacionada