投影仪幻灯片上对齐的方程式和图像

投影仪幻灯片上对齐的方程式和图像

我正在尝试制作一个投影仪幻灯片,其中包含一些矩阵方程和一张图片。这是我的尝试:

\begin{frame}\frametitle{Transportation polytope constraints}
A $\nu$-index transportation polytope is a polytope with constraint equation $Ax = b$
with the entries of $b$ the $S^j_{m_j}$ sums along hyperplane slices, 
and each column of $A$ has $\nu$ ones and the remainder of the entries are zero.

{\small
\begin{tabular}{p{2.5cm} l}
\includegraphics[keepaspectratio=true,width=.2\paperwidth{Presentation/BetterCubicPolytope.png} &
\[A = \left( \begin{array}{c c c c c c c c}
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1\\
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0\\
0 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0\\
0 & 0 & 1 & 1 & 0 & 0 & 1 & 1
\end{array}  \right)\qquad b = \left(\begin{array}{c}
14\\ 19\\ 20\\ 13\\26\\ 7 \end{array} \right) \]\end{tabular}}
\end{frame}

最终看起来的是: 巴德伯默幻灯片

相关的可能是,当我编译时,它会抱怨 end{frame} 错误(但仍会渲染幻灯片)。当我用某种文本替换图形时,它会正确排列方程式环境,但我仍然会收到错误。

良好的投影仪幻灯片

答案1

图像的参考点位于其底部边缘,表格或数组的默认参考点是其垂直中心,这就是为什么您的图像显示图像的底部边缘与数组的中心一致。

使用\begin{array}[b]使数组的参考点位于其底行,或使用\raisebox移动图像的参考点。在这种情况下,您可能希望使用\raisebox以免更改 的对齐方式=

 \raisebox{-.5\height}{\includegraphics...

我无法详细评论您所说的文档生成的错误,因为您没有提供生成这些错误的测试文档,片段并不像完整文档那么有用,但您似乎错误地理解了表格规范,这\[是一个显示环境,因此可以在一p列中但不能在一l列中,而\includegraphics最好在一列中l

答案2

另一个选择是加载\usepackage[export]{adjustbox}valign=c使用

\includegraphics[keepaspectratio=true,width=.2\paperwidth,valign=c]{example-image-a}

代码:

\documentclass{beamer}
\usepackage[export]{adjustbox}
\begin{document}
  \begin{frame}\frametitle{Transportation polytope constraints}
A $\nu$-index transportation polytope is a polytope with constraint equation $Ax = b$
with the entries of $b$ the $S^j_{m_j}$ sums along hyperplane slices,
and each column of $A$ has $\nu$ ones and the remainder of the entries are zero.

{\small
\begin{tabular}{p{2.5cm} l}
\includegraphics[keepaspectratio=true,width=.2\paperwidth,valign=c]{example-image-a} &
\[A = \left( \begin{array}{c c c c c c c c}
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1\\
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0\\
0 & 1 & 0 & 1 & 0 & 1 & 0 & 1\\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0\\
0 & 0 & 1 & 1 & 0 & 0 & 1 & 1
\end{array}  \right)\qquad b = \left(\begin{array}{c}
14\\ 19\\ 20\\ 13\\26\\ 7 \end{array} \right) \]\end{tabular}}
\end{frame}
\end{document}

在此处输入图片描述

相关内容