1

I want to know why when I change the distance to 2.5cm the arrow connecting to the ouput node is in the opposite direction as shown in the second diagram. How can I fix this in order for the length of the arrows to be like in the second diagram?

Sample code for the first diagram:

\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\begin{document}

\tikzstyle{block1} = [draw, fill=white!20, rectangle,minimum height=3em, minimum width=10em]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\begin{center}
\begin{tikzpicture}[auto, node distance=2.15cm,>=latex']
    \node [input, name=input] {};
    \node [block1, right of=input] (h_k) {$h(k)=h_1(k)*h_2(k)$};
    \node [output, right of=h_k] (output) {};   
    \draw [->] (input) -- (h_k);
    \draw [->] (h2_k) -- (output);
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

Sample code for the second diagram:

\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\begin{document}

\tikzstyle{block1} = [draw, fill=white!20, rectangle,minimum height=3em, minimum width=10em]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\begin{center}
\begin{tikzpicture}[auto, node distance=2.5cm,>=latex']
    \node [input, name=input] {};
    \node [block1, right of=input] (h_k) {$h(k)=h_1(k)*h_2(k)$};
    \node [output, right of=h_k] (output) {};   
    \draw [->] (input) -- (h_k);
    \draw [->] (h2_k) -- (output);
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

Pedro
  • 183
  • 1
  • 1
  • 6

0 Answers0