Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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 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. –  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 3:54
    
This is Claudio's answer referenced by QrrBrBirlbel. –  Ignasi Jan 20 at 20:45
add comment

4 Answers

up vote 24 down vote accepted

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

share|improve this answer
2  
+1: the rectangle split is very nice! –  morbusg Mar 9 '11 at 12:08
    
Thank you very much! That's what I was looking for! –  andrasi Mar 9 '11 at 13:59
    
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 '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 9 '11 at 14:42
    
indeed, rectangle split is nice. –  percusse Aug 21 '11 at 10:27
add comment

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

share|improve this answer
    
Interesting to see that a "trapezium" isn't quite what I used to think it was! –  Loop Space Mar 9 '11 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. –  Hendrik Vogt Mar 9 '11 at 12:57
add comment

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.

share|improve this answer
1  
Caveat: This will also slant the node text –  Jake Feb 5 '13 at 13:57
    
Right, xslant is a canvas transformation, not a coordinate transformation. –  Turion Feb 22 '13 at 22:17
add comment

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.

share|improve this answer
add comment

protected by Martin Scharrer Aug 21 '11 at 9:20

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.