Home > tikz pgf > Tikz: Lining up input and output nodes in multiple input multiple output diagram

# Tikz: Lining up input and output nodes in multiple input multiple output diagram

February 17Hits:2

I am attempting to draw a multiple input multiple output style diagram, using code that uses the following structure:

\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{positioning}   \begin{document}  \begin{tikzpicture} \tikzset{packet/.style={rectangle, draw, very thick, minimum size=8mm, rounded corners=1mm, fill=blue!50!white!30}} \tikzset{mixing/.style={rectangle, draw, very thick, minimum width=35ex, rounded corners=1mm, fill=red!70!orange!30,rotate=90}}  \node[packet] (A) at (0,0) {Node A}; \node[packet] (B) [right=2cm of A] {Node B}; \node[mixing] (pro) at ($(A) !.5! (B) + (0.0,-1.0)$) {Multiple Input Multiple Output process};  \node[packet] (C) at (0.0,-2.1) {Node C}; \node[packet] (D) [right=2cm of C] {Node D};  \draw[->] (A.east) -- (B.west); \draw[->] (C.east) -- (D.west); \end{tikzpicture} \end{document}  


which produces the following diagram:

What I'd like to know is how to draw the arrows so that the 'Multiple Input Multiple Output process' bisects the line so that it is split into two parts, so there one arrow going into the process on the left (from node A for example) and one going out on the right (for example to node B).

I am aware of the notation which set the entry/exit of a line into a node (something like name_of_node.180, where the 180 specifies the angle of entry/exit to the node relative to the centre of the node), for example here Block Diagrams Multi Input - Multi Output Components in TikZ

However is it possible to force the entry and exit points of the arrows of the 'process' node to be 'level' with a pair of nodes (A and B, or C and D). (Effectively in the diagram below it's as if the process node bisects the arrows, splitting them into two, as mentioned previously).

You can use the perpendicular coordinate system:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}
\tikzset{packet/.style={rectangle, draw, very thick, minimum size=8mm, rounded corners=1mm, fill=blue!50!white!30}}
\tikzset{mixing/.style={rectangle, draw, very thick, minimum width=35ex, rounded corners=1mm, fill=red!70!orange!30,rotate=90}}

\node[packet] (A) at (0,0) {Node A};
\node[packet] (B) [right=2cm of A] {Node B};
\node[mixing] (pro) at ($(A) !.5! (B) + (0.0,-1.0)$)
(mult) {Multiple Input Multiple Output process};

\node[packet] (C) at (0.0,-2.1) {Node C};
\node[packet] (D) [right=2cm of C] {Node D};

\draw[->] (A.east) -- (mult.north|-A.east);
\draw[->] (mult.south|-A.east) -- (B.west);
\draw[->] (C.east) -- (mult.north|-C.east);
\draw[->] (mult.south|-C.east) -- (D.west);
\end{tikzpicture}
\end{document}



A better alternative is to use:

\draw[->] (A.east) -- (mult.north|-A.east);
\draw[->] (mult.south|-A.east) -- (B.west|-A.east);
\draw[->] (C.east) -- (mult.north|-C.east);
\draw[->] (mult.south|-C.east) -- (D.west|-C.east);


Tags:nodes, tikz pgf

## Related Articles

• ### Tikz: Lining up input and output nodes in multiple input multiple output diagramFebruary 17

I am attempting to draw a multiple input multiple output style diagram, using code that uses the following structure: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \t

• ### Input/Output Nodes - Specification and Description LanguageJanuary 7

I am new to TkiZ. I am trying to create the below Input and Output nodes of Specification and Description Language Is there an existing \node or \tikzstyle to achieve the above in the TIKZ package? Tried to read the below: http://mirror.utexas.edu/ct

• ### Variable Input/Output node using a new command March 21

How can I create a variable input/output node using a new command as in the following picture Say for example, I know that the node will have n inputs and m outputs, which I enter the name as an argument for the new command, and at the same time, use

• ### Convenient way of typesetting boxes with multiple input and output wires?October 10

I want to typeset diagrams describing functions which take multiple inputs and return multiple outputs. These should look like boxes with labels in them like "f" or "g" and with some input wires coming in and some output wires going ou

• ### Outputting node fields individuallyNovember 8

I have a node template but instead of outputting $content, I want to have more control over what the template displays by printing each field individually. Below are the fields I want to include:$title field_img \$body What code would I replace with?

• ### TikZ: lineto to a just created nodeSeptember 5

Often, when drawing diagrams with TikZ, I'd like link nodes by edges just as I draw them. But when doing it the naive way, e.g. \draw (0,0) node {A} -- (1,0) node {B}; the line intersects with the node labels. I get the desired result by drawing the

• ### Configuring Barnyard2 Output Plug-In Per Input SourceOctober 17

I am currently using snort-2.9.3.1 outputting unified2 log format and using barnyard2-1.9 to process the alerts and send them to both syslog and a database. In some cases I have multiple instances of snort running on the same host and would like to l

• ### linux arecord: capture sound card output rather than microphone inputMay 19

I am trying to capture sound card output and encode it in Vorbis ogg format using the following command: arecord -f cd -t raw | oggenc - -r -o file.ogg However, the computer's microphone input is recorded rather than the sound card output. The output

• ### Is there a program that allows me to send audio output to a microphone input (either real or virtual microphone)?June 3

I've tried using VAC virtual audio cable, as well as virtual audio streaming. Unfortunately, none of these solutions provide a way to send audio output to a microphone input. None of the virtual audio cable related posts on here or internets address

• ### How can I migrate from filter-on-output to filter-on-input?September 18

I recently joined a company with a million+ lines-of-code PHP app. The security approach to XSS appears to be to filter output whenever the dev thought of it. Not surprisingly, they didn't catch everything, and we've got some real doozy XSS opportuni

• ### How can I get the A2DP output option and the input working again?November 3

I have a bluetooth headset which works perfectly on Ubuntu 13.04. Now I update to 13.10, and here is what's happing: After installing blueman, bluetooth-suport, pulseaudio-module-bluetooth and so on, I can find my device, pair it and connect to the h

• ### Python Stand Alone ArcGIS toolbox output feature class becomes input feature class within same tool?December 6

Developing a script in toolbox. I have a table that I use to make X Y layer (input 1) I am saving that created layer as a point feature class. (output 1) I then want to run kriging on that newly created point feature class, based on one of the column

• ### Does a "Buck Step Down Voltage Regulator" provide constant output voltage regardless of input voltage?July 25

I've got a small solar cell panel rated at 20V on a good sunny day. I need to regulate this down to 13.8V to charge a lead battery. Can I use a "Buck Step Down Voltage Regulator" for this? I'm uncertain about whether the regulator will provide 1

• ### Audio solution for multiple inputs and outputsOctober 1

I have multiple 3.5mm Audio inputs (PC, TV and the ability to expand in the future) and I have multiple 3.5mm outputs which I'd like them to play to (Speakers, a headset and soon to purchase a ButtKicker Gamer 2) I would like to have all the inputs p

• ### How actually sign reversal of output signal and the input signal takes place in case of amplification of transistor?November 28

How actually sign reversal of output signal and the input signal takes place in case of amplification of transistor? I am a class 12 student so make me understand accordingly. --------------Solutions------------- You are probably asking about the com

• ### HDMI output to DVI-D Input full HD?January 16

I have: A Dell LCD back-light LED monitor which have VGA, DP and DVI-D input ports. And I have a that have a HDMI output and supports Full HD (1920x1080). I want to connect my satellite receiver with monitor to use my monitor as a TV, so please help

• ### Unable to get service for dashDB output node in IBM bluemixFebruary 5

While configuring dashDB output node in IBM Bluemix, the drop-down list for service displays nothing all the time. Can anyone explain this and how can I set that service? --------------Solutions------------- You have to create a service in Bluemix an

• ### Altium error: Nets containing multiple input ports. What does this error mean?January 21

I am relatively new to Altium, and I am running into the following errors when compiling my schematic: Net SDI contains multiple Input Ports (Port SDI,Port SDI) Net CLK contains multiple Input Ports (Port CLK,Port CLK) What I am trying to do is conne

• ### Can you use a 5 input NAND gate as a 4 input one?April 6

I have a circuit that has 4 inputs and am only allowed to use 5-, 3- and 2-input NAND gates. Yes this is an assignment question but I have already solved the design of the circuit. I just don't know how to use (if possible) 4 outputs with a 5-input N

• ### Multiple input fields from PHP tableJuly 23

To summarize from a previous question, the user selected a starting date, an ending date, and a region. From these choices, an array of weeks and regions are created, and users enter values ("points") that correspond to a particular week and reg