Tell me more ×
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 am very new to the TikZ package, and I need to draw some flow chars by using the following shapes.

However I couldn't figure out how to draw the 4th and and 6th ones below. It would be very nice (for completeness) to help with all of the shapes in the list below.
Shapes

Your help will be greatly appreciated.

Note : I have visited Node shapes TikZ but it contains some other shapes.

share|improve this question
Hi bkarpuz. :) Note that you don't have to sign with your name since it automatically appears in the lower right corner of your post. – Claudio Fiandrino Dec 22 '12 at 14:12

1 Answer

up vote 17 down vote accepted

Following your list, here are a bunch of TikZ-styles to draw the nodes: feel free to customize colors and dimensions as needed. They are very basic styles, something one could write just by having a vague idea of the shapes present in pgfmanual. There are comments when special libraries should be loaded in the preamble.

Code:

\documentclass[a4paper,11pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,shapes.geometric,shapes.symbols,shapes.misc}

\tikzset{
    start-end/.style={
        draw,
        rectangle,
        rounded corners,
    },
    input/.style={ % requires library shapes.geometric
        draw,
        trapezium,
        trapezium left angle=60,
        trapezium right angle=120,
    },
    operation/.style={
        draw,
        rectangle
    },
    loop/.style={ % requires library shapes.misc
        draw,
        chamfered rectangle,
        chamfered rectangle xsep=2cm
    },
    decision/.style={ % requires library shapes.geometric
        draw,
        diamond,
        aspect=#1
    },
    decision/.default=1,
    print/.style={ % requires library shapes.symbols
        draw,
        tape,
        tape bend top=none
    },
    connection/.style={
        draw,
        circle,
        radius=5pt,
    },
    predefined process/.style={
        rectangle,
        draw,
        append after command={
          ($(\tikzlastnode.north west)!0.15!(\tikzlastnode.north)$)edge
          ($(\tikzlastnode.south west)!0.15!(\tikzlastnode.south)$)
          ($(\tikzlastnode.north east)!0.15!(\tikzlastnode.north)$)edge
          ($(\tikzlastnode.south east)!0.15!(\tikzlastnode.south)$)
        },
        text width=#1,
        align=center
    },
    predefined process/.default=2cm,
    man op/.style={ % requires library shapes.geometric
        draw,
        trapezium,
        shape border rotate=180,
        text width=2cm,
        align=center,
    },
    extract/.style={
        draw,
        isosceles triangle,
        isosceles triangle apex angle=60,
        shape border rotate=90
    },
    merge/.style={
        draw,
        isosceles triangle,
        isosceles triangle apex angle=60,
        shape border rotate=-90
    },
}

\begin{document}
\begin{tikzpicture}
\node[start-end] (start) {Start/End};
\node[below of=start,input](inp){Input};
\node[below of=inp,operation] (op) {Operation};
\node[below of=op,loop] (lp) {Loop};
\node[right= 10pt of lp,loop=1.6] (lp2) {Preparation};
\node[below= 5pt of lp,decision] (dec) {Decision};
\node[right= 10pt of dec,decision=1.6] (dec2) {Decision};
\node[right= 10pt of dec2,decision=2.5] (dec3) {Decision};
\node[below= 5pt of dec,print] (pr) {Print};
\node[below= 10pt of pr,predefined process] (prproc) {Predefined process};
\node[below= 10pt of prproc,man op] (manop) {Manual Operation};
\node[below of=manop,connection, label=below:Connection] (con) {};
\node[below of=con,extract, label=below:Extract] (extr) {};
\node[below of=extr,merge, label=below:Merge] (mrg) {};
\end{tikzpicture}
\end{document}

The result:

enter image description here

share|improve this answer
Thank you so much Claudio Fiandrino. – bkarpuz Dec 22 '12 at 22:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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