0

I want to draw the image attached below. I am trying with latex as per the code given below. I have been able to draw the tables but not getting how to put them side by side.

\documentclass{article}
\usepackage[utf8]{inputenc}


\begin{document}

\begin{table}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|}
\hline
*&$-1$&$-i$&$-j$ \\
\hline
$-1$&$1$&$i$&$j$\\
\hline
$-i$&$-1$&$-1$&$l$\\
\hline

\end{tabular}
\end{table}


\begin{table}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|}
\hline
*&$-1$&$-i$&$-j$ \\
\hline
$-1$&$1$&$i$&$j$\\
\hline
$-i$&$-1$&$-1$&$l$\\
\hline

\end{tabular}
\end{table}

\end{document}

enter image description here

Bernard
  • 271,350
nice guy
  • 411
  • 1
    See this question for how to put figures side by side. If you want the caption to be independent of the placement of the figures, you might find the \captionof command from the caption package helpful. After that, you can wrap the entire thing in a tcolorbox or mdframed environment. The horizontal rules above and below the text you can achieve with \rule or \hrule. – steve Apr 29 '20 at 10:17

1 Answers1

2

You can nest two tabulars inside a larger tabular, and put it in a figure environment if it has to be considered as such. Here is a way to do that, with the help of some packages.

To frame the whole figure, you can use a boxed minipage (width determined by trial and error) in the place of the figure environment, and use \captionof{figure}:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{array, booktabs}
\usepackage[math]{cellspace}

\usepackage{boxedminipage} \usepackage{caption}

\begin{document}

 \centering\setlength{\fboxsep}{2em}
    \fbox{\begin{minipage}{8.9cm}
    \setlength{\cellspacetoplimit}{6pt}
    \setlength{\cellspacebottomlimit}{6pt}
 \centering
    \begin{tabular}{@{}ccc@{}}
       \begin{tabular}{|*{4}{>{$}Sl<{$}|}}
        \hline at
        *&-1 & -i & -j \\
        \hline
        -1 & 1 & i & j \\
        \hline
        -i & -1 & -1 & l \\
        \hline
    \addlinespace
        \multicolumn{4}{c}{(G, * )}
        \end{tabular} & \qquad &
       \begin{tabular}{|*{4}{>{$}Sl<{$}|}@{}}
        \hline
        *& -1 & -i & -j \\
        \hline
         -1 & 1 & i & j \\
        \hline
         -i & -1 & -1 & l \\
        \hline
    \addlinespace
        \multicolumn{4}{c}{(H, + )}
        \end{tabular} \\[8ex]
    \midrule
        \multicolumn{3}{@{}l@{}}{\text{Some text}}\\
    \midrule
    \end{tabular}
  \captionof{figure}{Text}
 \end{minipage}}

\end{document} 

enter image description here

Bernard
  • 271,350