我有以下代码:
\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}