如何建立盒裝表數組

如何建立盒裝表數組

我正在嘗試複製所附圖像。但是,我不太確定要使用什麼類型的命令或環境。我不認為它只是一個簡單的表格或小型頁面環境。如果有人能幫助我,那就太好了。謝謝,麻煩您了。

在此輸入影像描述

答案1

使用基本工具的解決方案:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} 
\usepackage{array}
\setlength{\extrarowheight}{2pt}
\usepackage{makecell}

\newcommand*{\myhline}{\hline
\noalign{\vskip 1ex}
\hline}


\begin{document}

\bgroup\setlength{\arraycolsep}{2pt}
   \begin{alignat*}{3} \setcellgapes{4pt}\makegapedcells
   & \begin{array}{ | *{5}{c |}}
    \hline
E_1 & E_3 & E_3 & E_3 & E_4 \\
\myhline
E_1 & E_3 & E_3 & E_4 & E_3 \\
\myhline
E_1 & E_3 & E_4& E_3 & E_3 \\
\myhline
E_1 & E_4 & E_3& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_1 & E_3 & E_4 \\
\myhline
E_3 & E_3 & E_1 & E_4 & E_3 \\
\myhline
E_3& E_4 & E_1& E_3 & E_3 \\
\myhline
E_4 & E_3 & E_1& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_3 & E_4 & E_14 \\
\myhline
E_3 & E_3 & E_4 & E_3 & E_1 \\
\myhline
E_3& E_4 & E_3& E_3 & E_1 \\
\myhline
E_4 & E_3 & E_3& E_3 & E_1 \\
    \hline
    \end{array}
     \\[3ex]
%
    & \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_1 & E_3 & E_3 & E_4 \\
\myhline
E_3 & E_1 & E_3 & E_4 & E_3 \\
\myhline
E_3 & E_1 & E_4& E_3 & E_3 \\
\myhline
E_4 & E_1 & E_3& E_3 & E_3 \\
    \hline
    \end{array} &\quad &
   \begin{array}{ | *{5}{c |}}
    \hline
E_3 & E_3 & E_3 & E_1 & E_4 \\
\myhline
E_3 & E_3 & E_4 & E_1 & E_3 \\
\myhline
E_3& E_4 & E_3 & E_1 & E_3 \\
\myhline
E_4 & E_3 & E_3& E_1 & E_3 \\
    \hline
    \end{array}
 \end{alignat*}
\egroup

\end{document} 

在此輸入影像描述

答案2

在此輸入影像描述

繪製為tikzpicture、usingmatric和positioning`庫:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{matrix,
                positioning}
\tikzset{mymatrix/.style = {matrix of math nodes,
                            nodes={draw, minimum width=2em, minimum height=3ex,
                                    inner sep=0pt, outer sep=0pt, anchor=center},
                            column sep=-0.5\pgflinewidth,
                            row sep=1ex
                            }
        }

\begin{document}
\begin{tikzpicture}[node distance =2mm and 3mm]
  \matrix (m11) [mymatrix]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
  \matrix (m12) [mymatrix, right=of m11]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
  \matrix (m13) [mymatrix, right=of m12]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
   \matrix (m21) [mymatrix, below=of m11]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
   \matrix (m21) [mymatrix, right=of m21]
  {
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  E_1   & E_2   & E_3   & E_4   & E_5   \\
  };
\end{tikzpicture}
\end{document}

相關內容