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)?

5
  • 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, 2011 at 0: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. Mar 13, 2011 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, 2011 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? Jul 21, 2013 at 3:54
  • This is Claudio's answer referenced by QrrBrBirlbel.
    – Ignasi
    Jan 20, 2014 at 20:45

4 Answers 4

37

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

4
  • 4
    +1: the rectangle split is very nice!
    – morbusg
    Mar 9, 2011 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 9, 2011 at 14:19
  • I'm installing texlive from scratch using the script provided on the site. I hope it will be ok!
    – andrasi
    Mar 9, 2011 at 14:42
  • indeed, rectangle split is nice.
    – percusse
    Aug 21, 2011 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

2
  • Interesting to see that a "trapezium" isn't quite what I used to think it was! Mar 9, 2011 at 12:00
  • @Andrew: It seems also to be a BE versus AE question. Personally, I'm happy with "trapezium" since I see two parallel sides. Mar 9, 2011 at 12:57
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.

2
  • 2
    Caveat: This will also slant the node text
    – Jake
    Feb 5, 2013 at 13:57
  • Right, xslant is a canvas transformation, not a coordinate transformation.
    – Turion
    Feb 22, 2013 at 22:17
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .