Ecuación y alineación en Beamer

Ecuación y alineación en Beamer

Aquí está mi código para beamer:

\documentclass[12 pt,handout,notheorems]{beamer}
\usepackage{amsmath}
\usepackage{bm} %For making Greek letters bold
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usetheme{Boadilla}
\begin{document}
    \begin{frame}{}
        Align:
        \begin{align}
            1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^*\right] &\leq 1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}\right].\\
            \rightarrow \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^* &\leq \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}.
        \end{align}
        Equation:    
        \begin{equation}a
            1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^*\right] \leq 1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}\right].
        \end{equation}
        \begin{equation}
            \rightarrow \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^* \leq \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}.
        \end{equation}
    \end{frame}
\end{document}

Producción:

ingrese la descripción de la imagen aquí

Por alguna razón, cuando uso align, el número de ecuación (1) aparece debajo de la ecuación respectiva en lugar de justo al lado, en comparación con el número de ecuación (3). ¿Hay alguna manera de arreglar el alignentorno de modo que los números de las ecuaciones estén justo al lado de sus respectivas ecuaciones?

Respuesta1

El principal problema no es el uso del alignmedio ambiente. En cambio, es el uso abundante de \lefty \rightpara ajustar automáticamente el tamaño de paréntesis y corchetes. \lefty \rightno sólo no cambian el tamaño de ninguno de sus argumentos (lo cual no es sorprendente, en realidad, ya que el material que incluyen no es ni alto ni profundo), sino que también insertan espacios en blanco antes de cada paréntesis de apertura y después de cada paréntesis de cierre.

La solución más fácil (y mejor, IMNSHO) consiste en deshacerse de todas \leftlas \rightinstrucciones. Consulte las ecuaciones (3) y (4) a continuación.

Si, por alguna razón, no puedes dejar de lado la manta de seguridad \left/ \right(¿posiblemente porque aprendiste LaTeX de un profesor de TOC que había sido criado para creer falsamente que es necesario encerrar la expresión entre paréntesis en pares \left/ \right?), hazte un favor y (a) cargar el mleftrightpaquete y (b) reemplazar todas las instancias de \leftand \rightcon \mleftand \mright. Eso también eliminará el problema del espacio excesivo. Oh, si te gusta el efecto producido por \mlefty \mright, puedes dar la instrucción \mleftrighten el preámbulo y de ahora en adelante te \leftcomportarás \rightcomo \mleftlo \mrighthaces.

En un tema aparte: suponiendo que todos esos símbolos de superíndice T denotan transposición, emplearía un símbolo separado para esa acción. En el código siguiente, propongo una macro llamada \transppara el trabajo. Por supuesto, eres libre de utilizar otro símbolo que no sea \top.

ingrese la descripción de la imagen aquí

\documentclass[12pt,handout,notheorems]{beamer}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{mleftright} % for \mleft and \mright macros
\usepackage{pgfpages}
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usetheme{Boadilla}
\newcommand\transp{{}^{\raisebox{2pt}{$\scriptscriptstyle\bm{\top}$}}}
\begin{document}
\begin{frame}{}
    Align with 8 instances of \texttt{\string\left} and \texttt{\string\right}:
    \begin{align}
    1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^*\right] 
    &\leq 1 + \bm{\lambda}^{*\text{T}}\left[\mathbf{f}\left(\mathbf{x}^*,t\right) + \mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}\right].\\
     \rightarrow \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}^* 
     &\leq \bm{\lambda}^{*\text{T}}\mathbf{g}\left(\mathbf{x}^*, t\right)\mathbf{u}.
    \end{align}
    Align without \texttt{\string\left} and \texttt{\string\right}:
    \begin{align}
    1 + \bm{\lambda}^*\transp  [\mathbf{f} (\mathbf{x}^*,t ) + \mathbf{g} (\mathbf{x}^*, t )\mathbf{u}^* ] 
    &\leq 1 + \bm{\lambda}^*\transp  [\mathbf{f} (\mathbf{x}^*,t ) + \mathbf{g} (\mathbf{x}^*, t )\mathbf{u} ].\\
    \rightarrow \bm{\lambda}^*\transp \mathbf{g} (\mathbf{x}^*, t )\mathbf{u}^* 
    &\leq \bm{\lambda}^*\transp \mathbf{g} (\mathbf{x}^*, t )\mathbf{u}.
    \end{align}
    Align with \texttt{\string\mleft} and \texttt{\string\mright}:
    \begin{align}
    1 + \bm{\lambda}^*\transp \mleft[\mathbf{f}\mleft(\mathbf{x}^*,t\mright) + \mathbf{g}\mleft(\mathbf{x}^*, t\mright)\mathbf{u}^*\mright] 
    &\leq 1 + \bm{\lambda}^*\transp \mleft[\mathbf{f}\mleft(\mathbf{x}^*,t\mright) + \mathbf{g}\mleft(\mathbf{x}^*, t\mright)\mathbf{u}\mright].\\
     \rightarrow \bm{\lambda}^*\transp \mathbf{g}\mleft(\mathbf{x}^*, t\mright)\mathbf{u}^* 
     &\leq \bm{\lambda}^*\transp \mathbf{g}\mleft(\mathbf{x}^*, t\mright)\mathbf{u}.
    \end{align}

\end{frame}
\end{document}

información relacionada