5

So far I have this code that generates 4 boxes side by side:

\documentclass{article}
\usepackage{tikz}
\tikzstyle{arw} = [retangle, minimum width=3cm,
                      minimum height=2cm,
                      text centered, 
                      fill=green!40]
\begin{document}
  \begin{tikzpicture}[node distance=3.2cm]
    \node (inicio)[arw] {inicio};
    \node (meio)[arw, right of=inicio] {meio};
    \node (outro meio)[arw, right of=meio] {outro meio};
    \node (fim) [arw, right of=outro meio] {fim};
  \end{tikzpicture}
\end{document}

but I want something like this: (nodes are the arrows)

+--------+.  +---------+.  +---------+.  +---------+
|  text     >  >  here    >  >  and    >  >  here  |
+--------+´  +---------+´  +---------+´  +---------+

Does anyone know how to accomplish this? Is there a way instead of using a rectangle, another command like "arrow" or something?

1
7

One easy option is to use a smartdiagram. The package documentation is here for more options.

\documentclass[a4paper]{article}
\usepackage{smartdiagram}

\begin{document}

\begin{center}
\smartdiagram[sequence diagram]{inicio, meio, outro meio, fim}
\end{center}

\end{document}

enter image description here

5

You were almost there. Such arrows come with the shapes.symbols library. Please note that the syntax right of is deprecated (and not even part of the pgfmanual any more), please use the positioning library with its syntax right=of.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.symbols}
\tikzset{arw/.style={signal, minimum width=3cm,
                      minimum height=2cm,signal from=west,
                      text centered,fill=#1                 }}
\begin{document}
  \begin{tikzpicture}[node distance=2pt]
    \node [arw=blue] (inicio) {inicio};
    \node [arw=red,right=of inicio](meio) {meio};
    \node [arw=green, right=of meio] (outro meio){outro meio};
    \node [arw=orange, right=of outro meio] (fim){fim};
  \end{tikzpicture}
\end{document}

enter image description here

1
  • 1
    I'd suggest to add signal from=east to ìnicio` and signal to=nowhere to fim in order to get the proposed example.
    – Ignasi
    Nov 27 '18 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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