I am trying to create a flowchart using TikZ and i have few difficulties...
- My flowchart doesn't fit into one A4 page
- The text Yes \ No is on the line and not on the side of it.
- The size of decision (diamond) is to big and the text is not spread over the all surface of the diamond.
Is there a way to split the flowchart into to pages? My wish is to fit it into one page...
EDIT
I was able to place Yes \ No on top of the line or an the side of it using above, right, links instead of decision answer.
Should i keep using matrix structure? i saw i could also give below of.... What is better in my case?
Here is my flowchart:
\documentclass[ pdftex,
a4paper,
oneside,
10pt,
openright,
titlepage,
fleqn,
1headlines,
headinclude,
footinclude,
bibliography=totoc,
version=first
]{scrbook}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\selectlanguage{english}
\usepackage{a4wide}
\parindent0pt
\usepackage[fleqn]{amsmath}
\usepackage[fleqn,intlimits]{empheq}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{dsfont}
\usepackage{mathtools}
%
% 9. Paket um Textteile drehen zu kᅵnnen.
%
\usepackage[landscape,a4paper]{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,matrix,decorations.pathreplacing, shapes.geometric}
% Allowing formulas to be spreded over few pages
\allowdisplaybreaks[4]
\begin{document}
\tikzset{decision/.style={diamond, draw, fill=blue!20, text badly centered, node distance=2.5cm, inner sep=0pt,align=center}}
\tikzset{block/.style={drectangle, draw, fill=blue!20, text centered, rounded corners, align=center}}
\tikzset{line/.style={draw, very thick, color=black!50, -latex'}}
\tikzset{start/.style={shape=circle,draw,minimum size=1.2cm,draw=blue!80,fill=blue!20,text centered, align=center}}
\tikzset{decision answer/.style={near start,color=black}}
\tikzset{datashape/.style={ trapezium, draw, trapezium left angle=60, trapezium right angle=-60}}
\begin{tikzpicture}[scale=2, auto, every node/.style={ midway, auto, font=\footnotesize, anchor=center, >=stealth}]
\matrix [column sep=5mm,row sep=7mm]
{
% row 1
&&\node [start] (start){start};&&\\
% row 2
%&&\node [datashape,block,text width=3cm] (buff){Add new measurement, $y_k$ to %buffer};&&\\
&&\node [block,text width=3cm] (measurement){Add new measurement, \\ $y_k$ to
buffer};&&\\
% row 3
&
\node [decision] (reg status){Is \\ regression status \\ equel True};&%
\node [block] (update goodness){update \\ Goodness of Fit \\ $\chi_\mathrm{red}^2$};&%
\node [decision] (line pass){Is \\ $\left|\delta \right| < \left( 3.5\cdot %
\sigma_{\varepsilon} +
\sigma_{\hat{\beta}_k}\right)$\\ and \\ $\chi_\mathrm{red}^2 <
1.6$};&
\node [block] (update beta_k){Update estimated values \\ $\chi_\mathrm{red}^2$, %
$\hat{\beta}_k^i$ and $\operatorname{Cov}$};&\\
% row 4
&&&
\node [block,text width=3cm] (Reg False){Set regression status = %
False};
&\\
% row 5
&&&
\node [block,text width=3cm] (create replica){Create a replica of
current regression solution \\ $i \to i+1$};&
\node [block,text width=3cm] (Update replica){Clean buffer, \\ Update: \\
$\hat{\beta}_k^{i+1}$, $\operatorname{Cov}_k^{i+1}$ and $\chi_\mathrm{red}^2$}; \\
% row 6
\node [decision] (i > 0 1){Is \\ number of regression > 0 \\ $(i > 0)$};&
\node [block] (update estimate){update estimated values \\ $^{i+1}\chi_\mathrm{red}^2$, %
$\hat{\beta}_k^{i+1}$ and $\operatorname{Cov}_k^{i+1}$};&
&&\\
% row 7
&&
\node [decision] (sol val){Is \\ new Solution valid \\ $R^2 < 0.01$};&
\node [block] (new estimation){Compute new estimation \\ $\hat{\beta}_k$, $R^2$ and %
$\operatorname{Cov}_k^{i+1}$};&
\node [decision] (if 2){Is \\ regression solution falsh \\ and \\ sufficent
number of measurements};&\\
% row 8
&&
\node [block] (set reg true){Set regression status \\ to true};&
&\\
% row 9
&
\node [decision] (i>0 2){Is \\ \# of regression solutions > 0 \\ $(i> 0)$};&
\node [decision] (uniqueness){Does \\ the two samples, \\ $\hat{\beta}_k^i$,
$\hat{\beta}_k^n$ \\ independent};&
\node [block] (new to i+1){Copy new solution \\ estimation in $i+1$ \\ solution
estimation};&\\
% row 10
&&&
\node [block] (i to i+1){Delete solution $i$ \\ and instead place \\ solution
$i+1$ as $i$};&\\
% row 11
&&\node [start] (end){End};&&\\
};
\begin{scope}[every path/.style=line]
\path [line] (start)-- (measurement);
\path [line] (measurement) -| (reg status);
\path [line] (reg status) -- node[decision answer] {Yes} (update goodness);
\path [line] (update goodness) -- (line pass);
\path [line] (line pass) -- node[decision answer] {Yes} (update beta_k);
\path [line] (line pass) -- node[decision answer] {No} (Reg False);
\path [line] (Reg False) -- (create replica);
\end{scope}
\end{tikzpicture}
\end{document}

autooption to the line\tikzset{decision answer/.style={near start,color=black,auto}}instead of manually setting the labels. – Jake May 18 '11 at 12:18