[Tex/LaTex] how to draw two boxes side by side in tikz

tikz-nodetikz-pgf

I want to draw two boxes with text inside, side by side in one "tikzpicture", since I'm a newbie in tikz, I managed to do this(MWE), could you please help me to achieve it, I would be grateful.

Here is MWE:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
    \node (example-align) [draw,very thick, align=left,text width=7.5em]{Machine \\ \hspace{0.4cm} variables \\\hspace{0.4cm} invariants \\\hspace{0.4cm} theorems \\\hspace{0.4cm} variant \\\hspace{0.4cm} events}; &
    \end{tikzpicture}
    \hspace{1.4cm}
        \begin{tikzpicture}
    \node (example-align) [draw,very thick, align=left,text width=7.5em] {Context \\ \hspace{0.4cm} carrier sets  \\\hspace{0.4cm} constants \\\hspace{0.4cm} axioms \\ \hspace{0.4cm} theorems};
    \end{tikzpicture}
\end{document}

Best Answer

one possibility as one tikzpicture which contain two boxes:

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{positioning}% for positioning of nodes

\begin{document}
    \begin{tikzpicture}[
node distance = 0mm and 12mm,% for distance between nodes
   box/.style = {draw, very thick, minimum width=5em}% nodes style
                        ]
\node (n1) [box] {\begin{tabular}{ll}% text in nodes write as table
                  \multicolumn{2}{l}{Machine}   \\
                  & variables                   \\
                  & invariants                  \\
                  & theorems                    \\
                  & variant                     \\
                  & events
                 \end{tabular}};
\node (n2) [box, below right=of n1.north east]
                {\begin{tabular}{ll}
                  \multicolumn{2}{l}{Context}   \\
                  & carrier sets                \\
                  & constants                   \\
                  & axioms                      \\
                  & theorems
                 \end{tabular}};
    \end{tikzpicture}
\end{document}