我怎样才能将这些表对齐到同一行?

我怎样才能将这些表对齐到同一行?

我有以下代码:

\begin{figure*}[h]
  \centering
\tabcolsep=0.5cm
\setlength{\tabcolsep}{13pt} 
\renewcommand{\arraystretch}{1.5} 
\begin{tabular}{ |c|c|c|c| } 
\hline
\cellcolor{white}1 &\cellcolor{white} 1 & \cellcolor{black}\color{white}0 \\
\hline
\cellcolor{black}\color{white}0& \cellcolor{blue!10}$P_0$ &\cellcolor{white}1 \\  
\hline
\cellcolor{black}\color{white}0&\cellcolor{black}\color{white} 0 &\cellcolor{white} 1 \\  
\hline
\end{tabular}
\begin{subfigure}[h]{0.2\textwidth}
$\mbox{\Huge$\rightarrow{}$}$
\resizebox{8cm}{!}{
\begin{tabular}{|r|r|r|r|r|r|r|r|r|}
\hline
\cellcolor{white}1 &\cellcolor{white} 1&\cellcolor{black}\color{white}0&\cellcolor{black}\color{white}0&\cellcolor{white}1&\cellcolor{black}\color{white}0&\cellcolor{black}\color{white} 0 &\cellcolor{black}\color{white} 0&\cellcolor{white} 1\\
\hline
\end{tabular}}
$\mbox{\Huge$\rightarrow{} 201$}_{10}$
\end{subfigure}
\caption{Calcularea numarului regulii de tranzitie}
\end{figure*}\par

输出如下所示:在此处输入图片描述

我想把矩阵放在同一行,矩阵后面应该有一个箭头,我想把数组放在后面,然后把箭头指向数字 201。我希望所有这些都在一行中对齐。我不知道该怎么做。

答案1

以下可能更接近预期的输出:

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage[table]{xcolor}
\begin{document}

\begin{figure*}[h]
  \centering
\setlength{\tabcolsep}{13pt} 
\renewcommand{\arraystretch}{1.5} 
\begin{tabular}{ |c|c|c|c| } 
\hline
\cellcolor{white}1 &\cellcolor{white} 1 & \cellcolor{black}\color{white}0 \\
\hline
\cellcolor{black}\color{white}0& \cellcolor{blue!10}$P_0$ &\cellcolor{white}1 \\  
\hline
\cellcolor{black}\color{white}0&\cellcolor{black}\color{white} 0 &\cellcolor{white} 1 \\  
\hline
\end{tabular}
$\rightarrow{}$
\begin{tabular}{|r|r|r|r|r|r|r|r|r|}
\hline
\cellcolor{white}1 &\cellcolor{white} 1&\cellcolor{black}\color{white}0&\cellcolor{black}\color{white}0&\cellcolor{white}1&\cellcolor{black}\color{white}0&\cellcolor{black}\color{white} 0 &\cellcolor{black}\color{white} 0&\cellcolor{white} 1\\
\hline
\end{tabular}
$\rightarrow{} 201_{10}$

\caption{Calcularea numarului regulii de tranzitie}
\end{figure*}\par

\end{document}

相关内容