如何使用ShareLaTeX在beamer中生成表格如图所示

如何使用ShareLaTeX在beamer中生成表格如图所示

我正在尝试生成一个表,在其中插入数字,如图所示。

在此处输入图片描述

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) grid[step=2cm] (6,8);
\foreach \X [count=\x] in {0,...,3} 
{\foreach \Y [count=\y] in {0,...,4}
 {
 \ifnum\Y=0
  \node[anchor=north west] (X-\X-\Y) at (2*\X,2*\Y) {\y,\x};
 \else
  \ifnum\X=0
   \node[anchor=south east] (X-\X-\Y) at (2*\X,2*\Y) {\y,\x};
  \else
   \node[anchor=south west] (X-\X-\Y) at (2*\X,2*\Y) {\y,\x};
  \fi
 \fi
 }
}
\path (X-3-2.east) -- (X-3-3.east) node[midway,right=2pt]{$m_y=5$};
\path (X-1-0.south) -- (X-2-0.south) node[midway,below=2pt]{$m_x=4$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容