Hi all mailing listers:

I want to generate a flowchart like in the picture, which is created by Microsoft Visio. I am a newbie in compiling Tex code. I can generate simple flowchart while the attached one is really complex for me. I don't know how to realize the block shape with being filled texts of "Begin", "Framework A", "Framework B" and "End".

Any suggestion will be greatly appreciated.

PS: I need to fill many mathmatical formulas in this flowchart, so I need Tex coded flowchart. Otherwise, I will directly use Visio-generated one, saving a lot of time especially for a beginner.

Thank you! enter image description here

  • 1
    For the begin shape you can refer to TikZ picture shapes where a bunch of style for flow charts are defined. – Claudio Fiandrino Jun 10 '13 at 8:20
  • Thanks for your reply. Your provided link is really help. By the way, can you help me draw the the shape of "Framework A"? – user22986 Jun 10 '13 at 16:38

Here's one possibility using a chain (requires the chains library) and some styles; the "Begin" shape was produced using a signal shape (with signal to east and west) from the shapes.symbols library; the "Accept" shape is a diamond from the shapes.geometric library:




  text width=4cm,
  text depth=1.75ex,
  text height=3ex,
  on chain,
every join/.style={->},
  signal to=east and west},
  shape aspect=2,
  diamond,text width=1.5cm},
  rounded corners=12pt,
  text width=2cm}

\node[thick,draw=#4,rounded corners=#1,fit=(#2) (#3),inner xsep=40pt,inner ysep=8pt] (f\themyframe) {};
  ([yshift=-#1-5pt]f\themyframe.north west) -- 
  ([yshift=-#1]f\themyframe.north west) 
    arc[start angle=180, end angle=90,radius=#1] --
  ([xshift=#1]f\themyframe.north west) --
  ([xshift=-#1]f\themyframe.north east) 
    arc[start angle=90, end angle=0,radius=#1] -- 
  ([yshift=-#1]f\themyframe.north east) --  
  ([yshift=-#1-5pt]f\themyframe.north east) -- cycle;
\node at ([yshift=-0.5*#1-0.3ex]f\themyframe.north) {#5};


  start chain=going below,
  node distance = 0.7cm,
  yscale=0.9,transform shape
\node[begin] (begin) {Begin};

\begin{scope}[every join/.append style={myblue}]
\node[mynode=myblue,below=2cm of begin] (a1) {A1};
\coordinate (aux1) at ([yshift=40pt]a1);
\node[mynode=myblue] (a2) {A2};
\node[mynode=myblue] (a3) {A3};

\begin{scope}[every join/.append style={myred}]
\node[mynode=myred,yshift=-1.2cm] (b1) {B1};
\coordinate (aux2) at ([yshift=40pt]b1);
\node[mynode=myred] (b2) {B2};
\node[mynode=myred] (b3) {B3};
\node[draw=myred,accept,on chain,join] (acc) {Accept?};
\node[below=-10pt of acc,text width=4cm] (aux3) {};

\node[mynode=black,below=1.1cm of acc] (c1) {C1};
\node[end,on chain,join] (end) {End};

\node[label=above right:Yes] at (c1.north) {};

\TitleBox{aux1}{a3}{myblue}{Framework A}
\TitleBox{aux2}{aux3}{myred}{Framework B}

\draw[->,myblue] (begin) --  (a1.north);
\draw[->,myred] ([yshift=-12pt]aux2) -- (b1.north);
\draw[->,myred] (acc.east) -- node[above,black] {No} +(17pt,0) |- (b1);


enter image description here

The frame with a title around some nodes is produced with the command


that uses the fit library to produce a fitting shape for the coordinates <coordinate1> and <coordinate2> using the color specified by <color> and produces the title given in the fourth argument. The optional argument gives control over the rounded corners value used (default=15pt).

|improve this answer|||||
  • 2
    Thanks Gonzalo Medina. After I posted the question, I also keep trying to make it, but all failed. Thanks very much. I am so surprised by your amaing work! Thanks! Thanks! Thanks! – user22986 Jun 10 '13 at 21:18
  • @user22986 You're welcome! I made some improvements to the code in my updated answer. – Gonzalo Medina Jun 11 '13 at 1:33
  • @ Gonzalo Medina I confronted with another problem that the multiple-row texts filled the block of flowchart are still two double line space. This is because the whole document are doubleline space-typed, so how can I force content of flowchart follow singleline space. Thanks! – user22986 Jun 11 '13 at 23:53
  • @user22986 That should be a follow-up question, since it's not directly related to the issue discussed here. Please, feel free to open a fresh new question with this new requirement and providing all relevant information (for example, hoe are you producing doublespacing in your document?). – Gonzalo Medina Jun 12 '13 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.