
Aqui está o meu 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}
Saída:
Por alguma razão, quando uso align
, o número da equação (1) é listado abaixo da respectiva equação, em vez de logo ao lado dela, em comparação com o número da equação (3). Existe uma maneira de fixar o align
ambiente de forma que os números das equações fiquem ao lado de suas respectivas equações?
Responder1
O principal problema não é o uso do align
meio ambiente. Em vez disso, é o uso abundante de \left
e \right
para dimensionar automaticamente parênteses e colchetes. \left
e \right
não apenas falham em redimensionar qualquer um de seus argumentos (o que não é surpreendente, na verdade, já que o material que eles encerram não é alto nem profundo), mas também inserem espaços em branco antes de cada parêntese de abertura e após cada parêntese de fechamento.
A solução mais fácil – e melhor, IMNSHO – consiste em se livrar de todas \left
as \right
instruções. Veja as equações (3) e (4) abaixo.
Se, por algum motivo, você não consegue abandonar o cobertor de segurança \left
/ \right
(possivelmente porque aprendeu LaTeX com um professor de TOC que foi criado para acreditar falsamente que é necessário incluir expressões entre parênteses em pares \left
/ \right
?), faça um favor a si mesmo e (a) carregar o mleftright
pacote e (b) substituir todas as instâncias de \left
e \right
por \mleft
e \mright
. Isso também eliminará o problema de espaçamento excessivo. Ah, se você gostar do efeito produzido por \mleft
e \mright
, poderá emitir a instrução \mleftright
no preâmbulo e daqui em diante \left
e \right
se comportará como \mleft
e \mright
se comporta.
Em um tópico separado: assumindo que todos esses símbolos T sobrescritos denotam transposição, eu empregaria um símbolo separado para essa ação. No código abaixo, proponho uma macro chamada \transp
para o trabalho. Claro, você está livre para usar outro símbolo além de \top
.
\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}