I was inspired by how HAL is shown in this picture and would like to make something that is more or less the same in latex.

HALs place in the hierarchy of execution path

This is my current code:


\definecolor{white}{rgb}{1, 1, 1}

\tikzset{block/.style={rectangle, draw, fill=gray!50,
text width=10em, text centered, rounded corners=0pt, minimum height=0em}}

\date{February 2020}



        \node[block, minimum height=2cm, xshift=2cm] (task) {Tasks};
        \node[block, minimum height=2cm, fill=darkgray!150, below=of task, yshift=1cm] (executive) {Executive};
        \node[block, minimum height=3cm, yshift=1cm, below=of executive] (driver) {Drivers};
        \node[block, minimum height=1cm, below of=driver, xshift=0.53cm, text width=7em] (hal) {Hardware abstraction layer};
        \node[block, minimum height=2cm, below=of driver, yshift=1cm](hardware) {Hardware};


        \caption{\label{fig:Fig1_ecosystem}HALs place in the hierarchy of the executionpath}



This is the output: enter image description here

  • Can you show us what you've tried?
    – Werner
    Feb 27 '20 at 17:38
  • This can be done with a simple table using \rowcolor and \cellcolor. There a lot of questions using these commands. Search a bit.
    – Fran
    Feb 27 '20 at 19:19
  • @Werner I'm very new to latex and was kinda assuming I was doing it all wrong. But I have now added my code. Feb 27 '20 at 21:18
  • @Fran Didn't see your comment before now, but as you see in the edit I found a way, kinda. I was searching for the wrong things(boxes within boxes and whatnot) which were why I couldn't find anything, thus leading to my post. Would you suggest a more elegant solution? Feb 27 '20 at 21:23
  • @brynagutyes I added an answer. Mot sure if it is more elegant, but indeed is simpler.
    – Fran
    Feb 27 '20 at 22:07


\rowcolor{gray!20}\multicolumn{2}{c}{bla bla bla} \\
\rowcolor{gray}\multicolumn{2}{c}{bla bla bla} \\
\rowcolor{gray!20}\multicolumn{2}{c}{bla bla bla} \\
\rowcolor{gray!20}            & \cellcolor{gray!40}   bla bla bla bla bla bla     \\
\rowcolor{black}\multicolumn{2}{c}{\color{white} bla bla bla} \\
  • Thank you, this was much more elegant and very appreciated :) Feb 27 '20 at 22:11

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.