# Creating a (tensor) network using TikZ [duplicate]

This question already has an answer here:

I am trying to draw a very simple network diagram. My code:

    \begin{tikzpicture}
\node[draw, shape=circle] (v0) at (0,0) {$v_0$};
\node[draw, shape=circle] (v1) at (1,0) {$v_1$};
\node[rectangle,minimum width=6em,draw] (v3) at (0.5,-1) {$v_3$};
\draw [thick] (v0) -- (v1)
(v0) -- (v3)
(v1) -- (v3);
\end{tikzpicture}


This produces the following figure:

I want the lines from the upper two nodes to go straight down towards the edge of the rectangle. Is there a simple way to do this?

## marked as duplicate by Ignasi tikz-pgf StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 12 '16 at 21:24

yes, it is :-):

\documentclass[tikz,
border=3mm]{standalone}

\begin{document}
\begin{tikzpicture}
\node[draw, shape=circle] (v0) at (0,0) {$v_0$};
\node[draw, shape=circle] (v1) at (1,0) {$v_1$};
\node[rectangle,minimum width=6em,draw] (v3) at (0.5,-1) {$v_3$};
\draw [thick] (v0) -- (v1)
(v0) -- (v0 |-  v3.north) % <-- changed coordinates
(v1) -- (v1 |- v3.north); % <-- changed coordinates
\end{tikzpicture}
\end{document}


|- means that lines go first "verticaly" and than "horzontaly" .... (v0 |- v3.north) determine coordinate in intersection of vertical lines through v0.center and horizontal line through v3.north.

• Wow, that IS easy! Thank you very much for the quick and thorough help!! – Grim Reaper Oct 12 '16 at 19:47
• Your are welcome! Happy TeXing! – Zarko Oct 12 '16 at 20:00