![将数组插入到图中](https://linux22.com/image/393740/%E5%B0%86%E6%95%B0%E7%BB%84%E6%8F%92%E5%85%A5%E5%88%B0%E5%9B%BE%E4%B8%AD.png)
假设我有一张这种形式的图表:
\documentclass[11pt]{beamer}
\usepackage{pgfpages,amsmath,amssymb,mathtools,color, graphicx, amsfonts, braket}
\usepackage{subfig}
\usetheme{Madrid}
\usepackage{empheq}
\usepackage{multicol}
\begin{document}
\begin{frame}
\[
\begin{pmatrix}
\begin{matrix} e \\ \text{John} \\ j \end{matrix} &
\begin{pmatrix}
e \to e \to t & e \\
\text{saw} & \text{Mary}\\
\operatorname{saw} & m
\end{pmatrix}
\end{pmatrix}
=
\begin{matrix}
t\\
\text{John saw Mary}\\
\operatorname{saw}(j, m)\\
\end{matrix}
\]
\end{frame}
\end{document}
假设我想插入下图,其中第一个埃位于上图中(在该图的左上角,或者假设我想将其插入到上图顶行的任意位置)
\documentclass[11pt]{beamer}
\usepackage{pgfpages,amsmath,amssymb,mathtools,color, graphicx, amsfonts, braket}
\usepackage{subfig}
\usetheme{Madrid}
\usepackage{empheq}
\usepackage{multicol}
\begin{document}
\begin{frame}
\[
\begin{array}{c|c}
A & B\\
\hline
A & B\\
\hline
\multicolumn{2}{c}{C}
\end{array}
\]
\end{frame}
\end{document}
我该怎么做?我尝试将第二张图直接复制并粘贴到第一张图中,但这会产生错误“错误的数学环境分隔符”。
答案1
您只需粘贴array
:
\documentclass{beamer}
\usetheme{Madrid}
\begin{document}
\begin{frame}
\[
\begin{pmatrix}
\begin{matrix} e \\ \text{John} \\ j \end{matrix} &
\begin{pmatrix}
\begin{array}{c|c}
A & B\\
\hline
A & B\\
\hline
\multicolumn{2}{c}{C}
\end{array}
\to e \to t & e \\
\text{saw} & \text{Mary}\\
\operatorname{saw} & m
\end{pmatrix}
\end{pmatrix}
=
\begin{matrix}
t\\
\text{John saw Mary}\\
\operatorname{saw}(j, m)\\
\end{matrix}
\]
\end{frame}
\end{document}