1

=>Here's my code......

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,geometric,arrows}


\tikzstyle{startstop} = [rectangle, draw, text width=13cm, text centered, rounded corners, minimum height=1em]
\tikzstyle{io}  = [trapezium, draw, text width=3.5cm, text centered, minimum height=1em]
\tikzstyle{process} = [rectangle, draw, text width=5cm, text centered, minimum height=1em]
\tikzstyle{decision} = [diamond, draw, text width=3.5cm, text centered, minimum height=1em]
\tikzstyle{arrow}=[thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
%middle boxes
\node(Start)[startstop]{start};
\node(in1)[io,below of=start]{Read fingerprint,distance,date,time};
\node(pro1)[process,below of=in1]{Result=new ValidationResult()};
\node(pro2)[process,below of=pro1]{Generate template from fingerprint};
\node(pro3)[process,below of=pro2]{Search local storage for a matching template};
\node(dec1)[decision,below of=pro3,yshift=-1cm]{Match exists?};
\node(pro2a)[process,left of=dec1,xshift=-2cm,yshift=-2cm]{Details <- helpPost(server,fingerprint)};
\node(pro2b)[process,right of=dec1,xshift=5cm,yshift=-2cm]{Update the pending transaction==matching file name with the current as exit details};
\node(pro3a)[process,below of=pro2b,xshift=1em]{Queue transaction for insertion in the database};
\node(pro3b)[process,below of=pro3a,xshift=1cm]{};
\node(dec2) [decision,below of=pro2a,yshift=-1cm]{Details=Null?};
\node(pro4a)[process,left of=dec2,xshift=-2cm,yshift=-1.5cm]{Result=ValidateUser(details)};
\node(pro4b)[process,right of=dec2,xshift=1cm,yshift=-1.5cm]{Result=Result.Unknown};
\node(dec3)[decision,below of=pro4a,yshift=-1cm]{Result=Result.valid?};
\node(pro5a)[process,left of=dec3,yshift=-1cm]{Store the fingerprint template in the local file system};




\end{tikzpicture}

\end{document}
Torbjørn T.
  • 206,688

1 Answers1

3

It should be shapes.geometric, not shapes,geometric. Period, not comma.

You could also say just shapes, which I think loads all the various shape libraries.

Some other comments about your diagram:

  • You need \usepackage[T1]{fontenc} for the < to be rendered correctly.

  • You've called the first node Start, but the next node is placed relative to start, so that throws an error. Node names are case sensitive.

  • The <position> of=<othernode> syntax you've used is actually deprecated, it is recommended to load the positioning library, and use <position>=of <othernode> instead. See Difference between "right of=" and "right=of" in PGF/TikZ

    If you want the node distances to be calculated between the centre points of nodes, add the on grid option to the node settings.

  • It is also generally recommended to use

    \tikzstyle{<stylename>/.style={<settings>}}
    

    instead of

    \tikzstyle{<stylename>}=[<settings>]
    

    See Should \tikzset or \tikzstyle be used to define TikZ styles? for some discussion.

  • An alternative to having xshift/yshift in addition to e.g. below=of .. is to write e.g.

    below left=1cm and 3cm of someothernode
    

    The first value (1cm) is the vertical distance, and the second (3cm) is horizontal distance.

  • Your diagram is far too wide for a standard page, so you'll need to compress it. For example by reducing the space between nodes, reducing text widths, and reducing font size. I did all of that here, and as it is now the diagram fits within the margins of a standard article page.

    It doesn't look like you're entirely done though, so you might have to tweak things more.

output of code

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{
  shapes.geometric,
  positioning 
}

\tikzset{
  startstop/.style={rectangle, draw, text width=7cm, text centered, rounded corners, minimum height=1em},
  io/.style={trapezium, draw, text width=1.5cm, text centered, minimum height=1em},
  process/.style={rectangle, draw, text width=3cm, text centered, minimum height=1em]},
  decision/.style={diamond, draw, text width=1.2cm, text centered, minimum height=1em},
  arrow/.style={thick,->,>=stealth}
}
\begin{document}
\begin{center}
\begin{tikzpicture}[
  node distance=3mm and 1mm,
  every node/.append style={font=\scriptsize} % reduce font size of all nodes
]
%middle boxes
\node [startstop]                       (start) {start};
\node [io,below=of start]               (in1)   {Read fingerprint, distance, date, time};
\node [process,below=of in1]            (pro1)  {Result = new ValidationResult()};
\node [process,below=of pro1]           (pro2)  {Generate template from fingerprint};
\node [process,below=of pro2]           (pro3)  {Search local storage for a matching template}; 
\node [decision,below=of pro3]          (dec1)  {Match exists?};
\node [process, 
       below left=1cm and 1mm of dec1]  (pro2a) {Details <- helpPost(server,fingerprint)};
\node [process,
       below right=1cm and 2cm of dec1] (pro2b) {Update the pending transaction == matching file name with the current as exit details};
\node [process,below=of pro2b]          (pro3a) {Queue transaction for insertion in the database};
\node [process,below=of pro3a]          (pro3b) {};
\node [decision,below=1cm of pro2a]     (dec2)  {Details = Null?};
\node [process,
       below left=1cm and 1mm of dec2]  (pro4a) {Result = ValidateUser(details)};
\node [process,
       below right=1cm and 1mm of dec2] (pro4b) {Result = Result.Unknown};
\node [decision,below=of pro4a]         (dec3)  {Result = Result.valid?};
\node [process,below=of dec3]           (pro5a) {Store the fingerprint template in the local file system};
\end{tikzpicture}
\end{center}

\end{document}
Torbjørn T.
  • 206,688