答案1
这是使用 tikz 矩阵的版本:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newlength{\myboxlength}
\begin{document}
\setlength{\myboxlength}{1cm}
\begin{tikzpicture}
\matrix(table)[
matrix of nodes,
row sep = 0.2\myboxlength,
column sep = 0.2\myboxlength,
nodes={ fill=none, draw=black},
column 1/.style={minimum width=5\myboxlength},
column 2/.style={minimum width=1\myboxlength},
row 1/.style={minimum height=3\myboxlength},
row 2/.style={minimum height=1\myboxlength},
]
{A & B \\
C & 0 \\
};
\end{tikzpicture}
\bigskip
\setlength{\myboxlength}{5mm}
\begin{tikzpicture}
\matrix(table)[
matrix of nodes,
row sep = 0.2\myboxlength,
column sep = 0.2\myboxlength,
nodes={ fill=none, draw=black},
column 1/.style={minimum width=5\myboxlength},
column 2/.style={minimum width=1\myboxlength},
row 1/.style={minimum height=3\myboxlength},
row 2/.style={minimum height=1\myboxlength},
]
{A & B \\
C & 0 \\
};
\end{tikzpicture}
\end{document}
答案2
\def\mybox#1#2#3{\vrule height#2\vbox to#2{\dimen0=#1\advance\dimen0by-.8pt
\hrule width\dimen0\vfil\hbox to\dimen0{\strut\hfil#3\hfil}\vfil\hrule width\dimen0}\vrule height#2\relax}
\def\mykern{\kern1pt}
\vbox{\hbox{\mybox{5pc}{3pc}{A}\mykern\mybox{1pc}{3pc}{b}}
\mykern
\hbox{\mybox{5pc}{1pc}{c}\mykern\mybox{1pc}{1pc}{0}}}