-1

Can we reproduce this image in LaTeX? I have some idea using

\usepackage{tikz}
\usetikzlibrary{positioning,fit,shapes.geometric,backgrounds,matrix,calc,shapes}

Imaging

but so far I can't achieve this, as I am new to LaTeX.

    \documentclass{standalone}
    \usepackage{tikz}
    \usetikzlibrary{matrix,calc,decorations.pathreplacing,shapes.misc}
    \tikzset{
        module/.style={draw, rectangle, fill=white, minimum size=1em,outer sep=0,inner sep=0},
        mycross/.style={path picture={
            \draw[#1] (path picture bounding box.south west) rectangle (path picture bounding box.north east);
            \draw[#1] (path picture bounding box.south west) --  (path picture bounding box.north east);
            \draw[#1] (path picture bounding box.south east) -- (path picture bounding box.north west);
        }}
    }
    \begin{document}
        \begin{tikzpicture}
        \tikzset{column align/.style 2 args={column #1/.append style={nodes={execute at begin
                        node={\setbox\matrixcellbox=\hbox\bgroup},
                        execute at end
                        node={\egroup\eqmakebox[\tikzmatrixname\the\pgfmatrixcurrentcolumn][#2]{\copy\matrixcellbox}}}}}}
        \matrix[fill=black!20, matrix of nodes, nodes={module,anchor=center}, 
        row sep=-\pgflinewidth,column sep=-\pgflinewidth
        ]
        {
            Y & Y & Y \\
            Y & Y & |[mycross]|  \\
            Y & Y & Y \\
        };
        \end{tikzpicture} 
\end{document}
  

Current result:

enter image description here

1
  • 1
    Welcome. // Looks, like you're miles away. 2 suggestion: 1) Have a look into the short intro here and look up more details in the big manual: ctan.org/pkg/pgf . 3) Have a look into the tikz gallery, visit drawings and their code: texample.net/tikz/examples/feature/nodes-and-shapes (Don't be intimidated: it's easier in the end ...) . 3) Have a look to the right, at the links presented, centered around this question.
    – MS-SPO
    Jun 20 at 8:45

1 Answer 1

1

Don't need any of those library. Start from simple node path.

\documentclass{standalone}
\usepackage{tikz}
\tikzset{
mynode/.style args={#1/#2/#3/#4/#5}{
#1,
fill=#2,
rounded corners=#5,
minimum height=#3,
minimum width=#4,
font=\sffamily\Large,
},
}
\begin{document}
\begin{tikzpicture}
    \node (a) [mynode=/gray!15/3cm/18cm/10pt] {};
    \node (b) [mynode={white,right=1cm}/blue/2cm/5.5cm/0pt] at (a.west) {Data File};
    \coordinate (tmp) at (b.east);
    \foreach \word/\col in {Parameter\\file/green,Control\\ File/green!50!black,Password\\File/blue!30,Archive Log\\File/purple}
        \node (tmp) [mynode={white,anchor=west,right=3pt,align=center}/\col/2cm/2.5cm/0pt] at (tmp.east) {\word};
\end{tikzpicture}
\end{document}

enter image description here

2
  • i really wonder can we write a nested loop? how can I go for that memory part.
    – CADENTIC
    Jun 20 at 11:30
  • @CADENTIC Loop for different size and location nodes is kind of hard, you could draw them individually.
    – Tom
    Jun 20 at 17:46

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.