
How can i create this kind of connected and cascading block diagram in Latex?

How can i create this kind of connected and cascading block diagram in Latex?

\documentclass{article}
\begin{document}
\lineskip0pt
\framebox[3cm]{\strut Text1}
\makebox[3cm]{\strut\vrule}
\framebox[3cm]{\strut Text2}
\makebox[3cm]{\strut\vrule}
\framebox[3cm]{\strut Text3}
\end{document}
picture environment, but the simplicity of this is astonishing;).
– mbork
May 07 '13 at 20:42
\strut and play with \vrule height 6pt etc. - though this is not the LaTeX way;).
– mbork
May 07 '13 at 20:47
\baselineskip to 0pt as well as \lineskip. (Both settings should be inside a group if it is not the whole document)
– David Carlisle
May 07 '13 at 20:53
\lineskip=0pt into \offinterlineskip and enclose everything in a group. Though correcting David is definitely outside my competence zone...
– mbork
May 07 '13 at 20:53
Here you can specify the width of the boxes (it will be adjusted to fit if too short) and the separation between the boxes.
\documentclass{article}
\usepackage{keyval}
\makeatletter
\define@key{cascading}{width}{\cascading@wd=#1}
\define@key{cascading}{sep}{\def\cascading@sep{#1}}
\newdimen\cascading@wd
\newcommand{\cascadingblocks}[2][]{%
\setkeys{cascading}{sep=2ex,#1}%
\leavevmode\vbox{\offinterlineskip
\@for\next:=#2\do{%
\settowidth{\dimen@}{\next}%
\ifdim\dimen@>\cascading@wd
\cascading@wd=\dimen@
\fi
}%
\@for\next:=#2\do{%
\cascading@rule
\hbox{\fbox{\hb@xt@\cascading@wd{\hss\next\hss}}}%
}
}
}
\def\cascading@rule{%
\def\cascading@rule{%
\hb@xt@\dimexpr\cascading@wd+2\fboxsep+2\fboxrule\relax
{\hss\vrule\@height\cascading@sep\hss}%
}%
}
\makeatother
\begin{document}
% natural width, default sep
\cascadingblocks{foo,bar,foobar,foobazzzz}
% 3cm width, 3pt sep
\cascadingblocks[width=3cm,sep=3pt]{foo,bar,foobar,foobazzzz}
% 1cm width (automatically increased), default sep
\cascadingblocks[width=1cm]{foo,bar,foobar,foobazzzz}
\end{document}

Another option, using TikZ and chains:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
start chain=going below,
node distance=3mm,
every node/.style={on chain,join},
every join/.style={-},
block/.style={draw, text width=3cm,align=center}
]
\foreach \i in {1,...,5}
\node[block] {Text \i};
\end{tikzpicture}
\end{document}

The Code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
[auto,
block/.style = {rectangle, draw, text width = 6em, align =center},
line/.style = {draw, thick, -}]
\matrix[every node/.style = block, row sep=6mm]{
\node (t1) {Text 1}; \\
\node (t2) {Text 2}; \\
\node (t3) {Text 3}; \\
\node (t4) {Text 4}; \\
};
\path[line] (t1) -- (t2) -- (t3) -- (t4);
\end{tikzpicture}
\end{document}
The Output:

With PSTricks.

\documentclass[preview]{standalone}
\usepackage{pst-node,multido}
\def\mybox#1{\psframebox{\makebox[3cm]{#1}}}
\begin{document}
\offinterlineskip
\psmatrix[rowsep=.5]
\mybox{A}\\
\mybox{B}\\
\mybox{C}
\endpsmatrix
\multido{\ia=1+1,\ib=2+1}{3}{\ncline{\ia,1}{\ib,1}}
\end{document}
schemabloc... Working on an example... – 3isenHeim May 07 '13 at 20:35