2

I would like to draw lines (arrows) between nodes but do not want the line to "go the full way" but rather stop somewhere before.

Here is what I have:

\begin{tikzpicture}
    \node (xx) at (1.5,0) {$XX$};
    \node (s) at (1.5,2) {$S$};

    \draw [->] (s.south)++(0,-0.2) to (xx.north);
\end{tikzpicture}

That manipulates the starting point, but when I try to do the same thing to the ending point it messes up the arrow and is not stopping right.

How could I achive what I want?

2 Answers 2

3

it is not clear (to me) what you like to obtain .. . shorter line? for this see three examples below:

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}
\node[draw] (m) at (1.5,0) {$MN$};
\node[draw] (n) at (1.5,2) {$NM$};

\draw [shorten >=2mm, shorten <=2mm, ->] (n) to (m);
\draw [blue,->] ([yshift=-2mm] n.south east) to ([yshift=2mm] m.north east);
\draw [red,->]  ($(n.south west)+(0,-2mm)$) to ($(m.north west)+(0,2mm)$);
\end{tikzpicture}
\end{document}
1
  • the shorten-command has done the trick
    – frieder
    Commented Aug 20, 2017 at 9:38
0

enter image description here

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node (xx) at (1.5,0) {$XX$};
\node (s) at (1.5,2) {$S$};

\draw [<-] (xx.north)++(0,0.2) to (s.south);
\end{tikzpicture}   
\end{document}
1
  • If both sides need to be edited, it does not work anymore.
    – frieder
    Commented Aug 19, 2017 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .