LaTeX forum ⇒ Graphics, Figures & TablesProblem compiling an example from texample for tikz

Information and discussion about graphics, figures & tables in LaTeX documents.
teotjunk
Posts: 17
Joined: Fri Sep 19, 2008 5:28 pm

Problem compiling an example from texample for tikz

Postby teotjunk » Mon Jul 15, 2013 9:11 am

I copied an example from texexample for tikz. But have problems compiling it. This is the latex code
  1. % Data flow diagram
  2. % Author: David Fokkema
  3. \documentclass{article}
  4. \usepackage{tikz}
  5. %%%<
  6. \usepackage{verbatim}
  7. \usepackage[active,tightpage]{preview}
  8. \PreviewEnvironment{center}
  9. \setlength\PreviewBorder{10pt}%
  10. %%%>
  11. \begin{comment}
  12. :Title: Data flow diagram
  13. :Tags: Nodes and shapes;Matrices;Styles;Computer science
  14. :Author: David Fokkema
  15. :Slug: data-flow-diagram
  16.  
  17. Data flow diagrams depict the flow of information in a system. This
  18. figure shows experimental data being recorded, processed and ultimately
  19. stored. This figure is a minor revision of the one included in
  20. [my PhD thesis](http://dx.doi.org/10.3990/1.9789036534383).
  21. \end{comment}
  22. \usetikzlibrary{arrows}
  23.  
  24. % Defines a `datastore' shape for use in DFDs. This inherits from a
  25. % rectangle and only draws two horizontal lines.
  26. \makeatletter
  27. \pgfdeclareshape{datastore}{
  28. \inheritsavedanchors[from=rectangle]
  29. \inheritanchorborder[from=rectangle]
  30. \inheritanchor[from=rectangle]{center}
  31. \inheritanchor[from=rectangle]{base}
  32. \inheritanchor[from=rectangle]{north}
  33. \inheritanchor[from=rectangle]{north east}
  34. \inheritanchor[from=rectangle]{east}
  35. \inheritanchor[from=rectangle]{south east}
  36. \inheritanchor[from=rectangle]{south}
  37. \inheritanchor[from=rectangle]{south west}
  38. \inheritanchor[from=rectangle]{west}
  39. \inheritanchor[from=rectangle]{north west}
  40. \backgroundpath{
  41. % store lower right in xa/ya and upper right in xb/yb
  42. \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
  43. \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
  44. \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
  45. \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
  46. \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@yb}}
  47. \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
  48. }
  49. }
  50. \makeatother
  51.  
  52. \begin{document}
  53. \begin{center}
  54. \begin{tikzpicture}[
  55. font=\sffamily,
  56. source/.style={draw,thick,rounded corners,fill=yellow!20,inner sep=.3cm},
  57. process/.style={draw,thick,circle,fill=blue!20},
  58. sink/.style={source,fill=green!20},
  59. datastore/.style={draw,very thick,shape=datastore,inner sep=.3cm},
  60. dots/.style={gray,scale=2},
  61. to/.style={->,>=stealth',shorten >=1pt,semithick,font=\sffamily\footnotesize},
  62. every node/.style={align=center}]
  63. % Position the nodes using a matrix layout
  64. \end{tikzpicture}
  65. \end{center}
  66. \end{document}




And this is the error messsage

  1. tikz: I do not know what to do with the option ``source/.style={draw,thick,rounded corners,fill=yellow!20,inner sep=.3cm}''. every node/.style={align=center}]
  2. tikz: I do not know what to do with the option ``process/.style={draw,thick,circle,fill=blue!20}''. every node/.style={align=center}]
  3. tikz: I do not know what to do with the option ``sink/.style={source,fill=green!20}''. every node/.style={align=center}]
  4. tikz: I do not know what to do with the option ``datastore/.style={draw,very thick,shape=datastore,inner sep=.3cm}''. every node/.style={align=center}]
  5. tikz: I do not know what to do with the option ``dots/.style={gray,scale=2}''. every node/.style={align=center}]
  6. Missing \endcsname inserted every node/.style={align=center}]
  7. Extra }, or forgotten \endgroup every node/.style={align=center}]
  8. Extra \endcsname every node/.style={align=center}]
  9. Missing \endcsname inserted every node/.style={align=center}]
  10. Extra }, or forgotten \endgroup every node/.style={align=center}]
  11. Extra \endcsname every node/.style={align=center}]
  12. tikz: I do not know what to do with the option ``to/.style={->,
  13. tikz: I do not know what to do with the option ``every node/.style={align=center}''. every node/.style={align=center}]
Last edited by teotjunk on Mon Jul 15, 2013 9:57 am, edited 1 time in total.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Jul 15, 2013 9:32 am

The example is not complete. A matrix and several \draw commands are missing in your copy of the original example.

Please use the "Code" button for marking inserted code, to make it readable. Usually I correct it when I see people forgot it. This time I did not, so you don't think somebody removed that piece of code.

Stefan
Site admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests