37

I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins.

One is for data and the other for a predefined process. They look like this:

blockdiagram-flowchart-symbols

Does anyone know how could I draw those two shapes (maybe using TikZ)?

azetina
  • 28,884
andrasi
  • 887
  • 3
  • 9
  • 9
  • Hi! Welcome to TeX.SX! If you post your question as an “answer” to an other question, not many people will see it (in fact, the answer space should be reserved for real answers to the question at hand). For follow-up questions please post a new question (use the “Ask Question” link at the top right) and add a link to this one. – Caramdir Mar 11 '11 at 00:42
  • @KArla Palma: I converted your post to a comment to keep the answer list tidy. Feel free to open a new question as Caramdir suggested. – Martin Scharrer Mar 13 '11 at 10:25
  • @KArla Palma: Make sure you have the correct tikz libraries included, e.g. \usetikzlibrary{shapes, shapes.multipart, shapes.geometric}. – Turion Jun 25 '11 at 18:06
  • I’ll retract my duplicate vote. The linked question seems like a duplicate but the original image is different, though Claudio’s answer is much more organized than the answers here. Shall we merge the answers anyway? – Qrrbrbirlbel Jul 21 '13 at 03:54
  • This is Claudio's answer referenced by QrrBrBirlbel. – Ignasi Jan 20 '14 at 20:45

4 Answers4

38

The double side margin rectangle can be created using a rectangle split, the parallelogram using a trapezium:

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.multipart}
\begin{document}

\begin{tikzpicture}
\node [draw,trapezium,trapezium left angle=70,trapezium right angle=-70,minimum height=1cm] {Data};

\node at (0,-2)[draw,rectangle split, rectangle split horizontal,rectangle split parts=3,minimum height=1cm] {\nodepart{two}\shortstack{Predefined\\Process}};

\end{tikzpicture}
\end{document}

parallelogram, split rectangle

Jake
  • 232,450
  • 4
    +1: the rectangle split is very nice! – morbusg Mar 09 '11 at 12:08
  • Unfortunately it seems that my TikZ version could be older, because I get the following error: ! Package tikz Error: I do not know what to do with the option ``trapezium''. I'm using Kile on Mandriva Linux 2010.2 64 bit, with tetex package version 3.0. – andrasi Mar 09 '11 at 14:19
  • I'm installing texlive from scratch using the script provided on the site. I hope it will be ok! – andrasi Mar 09 '11 at 14:42
  • indeed, rectangle split is nice. – percusse Aug 21 '11 at 10:27
10

You could use a trapezium for the data:

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[datashape/.style={
  trapezium, draw, trapezium left angle=60,
  trapezium right angle=-60}]
\node[datashape] {Data};
\end{tikzpicture}
\end{document}

trapezoid

morbusg
  • 25,490
  • 4
  • 81
  • 162
6

A very easy way for the parallelogram "data" is using the xslant option:

\node [rectangle, draw, xslant=0.4] at (0,0) {Data};

Don't forget the draw option for borders. This way doesn't even need the shapes library and is shorter than the trapezium variant.

Turion
  • 4,622
1

Have a look at What is the easiest way to draw 3D cube with TikZ? (and my answer to it) to see how to define new node shapes in PGF. It should not be too hard to adapt a rectangle shape to get your predefined process node.

I am on a bus right now so I can't do it for you, maybe later.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195