0

I want boxes A,C,D and E have the same color as box B. Also I want the arrow between A and E point from E to A. I also want the arrow from B to A to be of color blue. Below is the MWE that I adopted from smartdiagram tabular inside additions nodes:

 \documentclass[12pt,a4paper,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usetikzlibrary{mindmap,arrows}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\begin{document}
    \definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
    \resetcolorseries[12]{colours}
    \smartdiagramset{%
        back arrow disabled=true,
        module minimum width=4cm,
        module minimum height=4cm,
        module x sep=5cm,
        text width=4cm,
        arrow style=<-,
        additions={
            additional item offset=1cm,
            additional item fill color=orange!36,
            additional item border color=blue,
            additional arrow color=blue,
            additional item width=4cm,
            additional item height=4cm,
            additional item text width=4cm,
            additional item bottom color=orange!36,
            additional item shadow=drop shadow,
        }
    }
    \vspace*{50mm}
    \newsavebox\outputbox
    \sbox\outputbox{%
        \begin{tabular}{c}
            E \\ \hline
            
        \end{tabular}%
    }
    \smartdiagramadd[flow diagram:horizontal]{
        \begin{tabular}{c}
            B \\ \hline
            \\
            \\
            \\
        \end{tabular}, A
    }{%
        below of module2/ \usebox\outputbox,
        right of module2/\underline{D}, above of module2/C
    }
    \smartdiagramconnect{->}{module2/additional-module1}        \smartdiagramconnect{->}{additional-module2/module2}
    \smartdiagramconnect{->}{additional-module3/module2}
\end{document}
1
  • Do you really need to use a smartdiagram for this? Mar 24, 2023 at 14:19

1 Answer 1

2

You could do the following:

\documentclass[12pt,a4paper]{report}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}

\begin{document}
    \smartdiagramset{%
        back arrow disabled=true,
        module minimum width=4cm,
        module minimum height=4cm,
        module x sep=5cm,
        text width=4cm,
        arrow style=<-,
        uniform arrow color=true,
        arrow color=blue,
        uniform color list={red!50 for 2 items},
        additions={
            additional item offset=1cm,
            additional item border color=blue,
            additional arrow color=blue,
            additional item width=4cm,
            additional item height=4cm,
            additional item text width=4cm,
            additional item bottom color=red!50,
            additional item shadow=drop shadow,
        }
    }
    \vspace*{50mm}
    \newsavebox\outputboxx
    \sbox\outputboxx{%
        \begin{tabular}{c}
            E \\ \hline
            
        \end{tabular}%
    }
    \smartdiagramadd[flow diagram:horizontal]{
        \begin{tabular}{c}
            B \\ \hline
            \\
            \\
            \\
        \end{tabular}, A
    }{%
        below of module2/\usebox\outputboxx,
        right of module2/\underline{D}, above of module2/C
    }
    \smartdiagramconnect{<-}{module2/additional-module1}        
    \smartdiagramconnect{->}{additional-module2/module2}
    \smartdiagramconnect{->}{additional-module3/module2}
\end{document}

enter image description here

However, the distance between A and B is not the same as the distance between the other boxes and also, boxes C, D and E have a blue border. I am not sure whether you want it this way.


I think that it is at least as easy to directly draw this using TikZ which also makes it easier to exactly position things (while at the same time having as much flexibility as possible):

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning, shadows}

\begin{document}
    \begin{tikzpicture}[
        mybox/.style={
            minimum width=4cm,
            minimum height=4cm,
            rounded corners,
            draw=gray,
            top color=red!0,
            bottom color=red!50,
            drop shadow,
        },
        myconnect/.style={
            -latex,
            ultra thick,
            blue,
        }]

        \node[mybox] at (0,0) (A) {
            A
        };

        \node[mybox, left=7.5mm of A] (B) {
            \begin{tabular}{c}
                B \\ \hline
                \\
                \\
                \\
            \end{tabular}
        };

        \node[mybox, above=7.5mm of A] (C) {
            C
        };

        \node[mybox, right=7.5mm of A] (D) {
            \underline{D}
        };

        \node[mybox, below=7.5mm of A] (E) {
            \begin{tabular}{c}
                E \\ \hline
            \end{tabular}
        };
    
        \draw[myconnect] (B) -- (A);        
        \draw[myconnect] (C) -- (A);        
        \draw[myconnect] (D) -- (A);        
        \draw[myconnect] (E) -- (A);        
    \end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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