Skip to main content
added 72 characters in body
Source Link
Cheng Zhou
  • 349
  • 1
  • 3
  • 4
 \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning} \begin{document} \pagestyle{empty} \tikzstyle{decision} = [diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, node distance=3.5cm,minimum height=2em] \tikzstyle{cloud} = [draw, ellipse, node distance=3.5cm, minimum height=2em] \tikzstyle{line} = [draw, -latex'] 
 \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture}  \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} \end{document} 
 \tikzstyle{decision} = [diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, node distance=3.5cm,minimum height=2em] \tikzstyle{cloud} = [draw, ellipse, node distance=3.5cm, minimum height=2em] \tikzstyle{line} = [draw, -latex'] 
 \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} 
 \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning} \begin{document} \pagestyle{empty} \tikzstyle{decision} = [diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, node distance=3.5cm,minimum height=2em] \tikzstyle{cloud} = [draw, ellipse, node distance=3.5cm, minimum height=2em] \tikzstyle{line} = [draw, -latex']  \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} \end{document} 
added 397 characters in body
Source Link
Cheng Zhou
  • 349
  • 1
  • 3
  • 4

Use positioning can control the individual vertical position of nodes. But is there any way to control the default vertical spacing?

 \tikzstyle{decision} = [diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, node distance=3.5cm,minimum height=2em] \tikzstyle{cloud} = [draw, ellipse, node distance=3.5cm, minimum height=2em] \tikzstyle{line} = [draw, -latex'] 
 \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} 

Like this. I changed the vertical position of 2nd2 but others remains. Do I have to add individual vertical spacing control of every nodes?

Use positioning can control the individual vertical position of nodes. But is there any way to control the default vertical spacing?

\begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} 

Like this. I changed the vertical position of 2nd2 but others remains. Do I have to add individual vertical spacing control of every nodes?

Use positioning can control the individual vertical position of nodes. But is there any way to control the default vertical spacing?

 \tikzstyle{decision} = [diamond, draw, text width=4.5em, text badly centered, node distance=3.5cm, inner sep=0pt] \tikzstyle{block} = [rectangle, draw, text width=6em, text centered, rounded corners, minimum height=4em, node distance=3.5cm,minimum height=2em] \tikzstyle{cloud} = [draw, ellipse, node distance=3.5cm, minimum height=2em] \tikzstyle{line} = [draw, -latex'] 
 \begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} 

Like this. I changed the vertical position of 2nd2 but others remains. Do I have to add individual vertical spacing control of every nodes?

Source Link
Cheng Zhou
  • 349
  • 1
  • 3
  • 4

How to define the default vertical distance between nodes?

Use positioning can control the individual vertical position of nodes. But is there any way to control the default vertical spacing?

\begin{tikzpicture}[node distance = 1cm, auto] \node [block] (1st) {1st}; \node [block, right of=1st] (2nd1) {2nd1}; \node [block, above=0.7cm of 2nd1] (2nd2) {2nd2}; \node [block, below of=2nd1] (2nd3) {2nd3}; \node [block, right of=2nd1] (3rd1) {3rd1}; \node [block, above of=3rd1] (3rd2) {3rd2}; \node [block, above of=3rd2] (3rd3) {3rd3}; \node [block, below of=3rd1] (3rd4) {3rd4}; \node [block, below of=3rd4] (3rd5) {3rd5}; \path [line] (1st) -- (2nd1); \path [line] (2nd1) -- (2nd2); \path [line] (2nd1) -- (2nd3); \path [line] (2nd2) -- (3rd3); \path [line] (2nd1) -- (3rd1); \path [line] (1st) -- (2nd1); \end{tikzpicture} 

Like this. I changed the vertical position of 2nd2 but others remains. Do I have to add individual vertical spacing control of every nodes?