# how to locate the text besides the center of the line

I used the code below to add the text besides the line, however, it is very near to the bottom node, I wish to add the text besides the center of the line. May someone help me on this?

The code is :

\path [line] (s8) -- node [left]{hotel}(s9);


Now the result is:

You can specify the position either by description such as midway, or by pos= syntax, and control the node position by above, right, etc.

## Notes:

There are numerous other options, refer to the tikz/pgf manual.

## Code:

 \documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[thick, blue, -latex]
\draw (0,0) -- (3,-2) node [red, below] {A};
\draw (2,0) -- (5,-2) node [red, midway, right] {A};
\draw (4,0) -- (7,-2) node [red, pos=0.1, above] {A};
\end{tikzpicture}
\end{document}