1

The fractions at the top row of the first diagram below are not aligned (and the fractions of the bottom aren't either), as the expressions of the top rows are in the second diagram. How can I align them?

\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}
\begin{matrix}
\cfrac{\ \rho \ }{\ \alpha \ }\\ \\
\texttt{left-exp}\\ \\
\cfrac{\ \operatorname{f[\;])}\ }{\ x\ }\\
\end{matrix}
\hspace{2cm}
\begin{matrix}
\cfrac{\ \rho \ }{\ \alpha \to \beta\ }\\ \\
\texttt{right-exp}\\ \\
\cfrac{\ \operatorname{g[\;])}\ }{\ y\ }\\
\end{matrix}
\end{matrix}
\end{pmatrix}
=
\begin{matrix}
\cfrac{\ \rho\ }{\ \beta\ }\\
\text{left-exp right-exp}\\
\cfrac{\ \operatorname{f[g[\;]])}\ }{\ A x y\ }\\
\end{matrix}
\]

\[
\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}
2

Rather than trying to build the top matrix as a collection of individual vectors, use the tabbed matrix approach, in order to achieve vertical alignment across the cells in a given row.

\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}
\cfrac{\ \rho \ }{\ \alpha \ }&\kern15pt&\cfrac{\ \rho \ }{\ \alpha \to \beta\ }\\ &&\\
\texttt{left-exp}&&\texttt{right-exp}\\ &&\\
\cfrac{\ \operatorname{f[\;])}\ }{\ x\ }&&\cfrac{\ \operatorname{g[\;])}\ }{\ y\ }
\end{matrix}
\end{pmatrix}
=
\begin{matrix}
\cfrac{\ \rho\ }{\ \beta\ }\\ \\
\text{left-exp right-exp}\\ \\
\cfrac{\ \operatorname{f[g[\;]])}\ }{\ A x y\ }
\end{matrix}
\]

\[
\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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.