Como alinhar o sinal de mais abaixo de 1?

Como alinhar o sinal de mais abaixo de 1?

Código:

\documentclass[12 pt,handout,notheorems]{beamer}
\usepackage{amsmath}
\usepackage{bm} %For making Greek letters bold
\usepackage{pgfpages}
\usepackage{mleftright}
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usetheme{Boadilla}

\renewcommand{\left}{\mleft}
\renewcommand{\right}{\mright}
\begin{document}
    \begin{frame}
        \setcounter{equation}{9}    
        \begin{equation}
            \begin{aligned}
                \mathcal{H}\left(\mathbf{x}\left(t\right), u\left(t\right), \bm{\lambda}\left(t\right) \right) ={}& 1 + \lambda_1\left(t\right)x_2\left(t\right) \\ &+ \lambda_2\left(t\right)\left[-g - \frac{k}{x_3\left(t\right)}u\left(t\right)\right]+ \lambda_3\left(t\right)u\left(t\right).
            \end{aligned}
        \end{equation}
    \end{frame}
\end{document}

Saída:

insira a descrição da imagem aqui

Como faço para alinhar o primeiro sinal de mais na segunda linha com o 1 na primeira linha?

Responder1

Aqui está uma solução que se baseia na sua configuração e funciona inserindo \phantom{{}=1}antes do primeiro +símbolo na linha 2. Ela "funciona" em termos de alinhamento, mas agora a equação é um pouco larga demais para permitir que o número da equação se ajuste corretamente.

De qualquer forma, não acho que seja tão importante alinhar os dois +símbolos. Um ambiente simples multline*faz um trabalho melhor, na minha opinião.

insira a descrição da imagem aqui

\documentclass[12pt,handout,notheorems]{beamer}
\usepackage{amsmath}
\usepackage{bm} %For making Greek letters bold
\usepackage{pgfpages}
\usepackage{mleftright}
\mleftright % no need to redefine '\left' and '\right'
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usetheme{Boadilla}

\begin{document}
\begin{frame}
\setcounter{equation}{9}
\begin{equation}
\begin{aligned}[b]
\mathcal{H}\left(\mathbf{x}\left(t\right), 
 u\left(t\right), \bm{\lambda}\left(t\right) \right) 
&= 1 + \lambda_1\left(t\right)x_2\left(t\right) \\ 
&\phantom{{}=1}+ \lambda_2\left(t\right)\left[-g - \frac{k}{x_3\left(t\right)}u\left(t\right)\right]+ \lambda_3\left(t\right)u\left(t\right).
\end{aligned}
\end{equation}

\begin{multline}
%% also replaced all 10 [!] instances of '\left(t\right)' with '(t)'.
\mathcal{H}\left(\mathbf{x}(t), u(t), \bm{\lambda}(t) \right) 
= 1 + \lambda_1(t)x_2(t) \\ 
+ \lambda_2(t)\left[-g - \frac{k}{x_3(t)}u(t)\right]+ \lambda_3(t)u(t).
\end{multline}
\end{frame}
\end{document}

Responder2

aligned, que você está usando, permite que você faça isso.

\documentclass[12 pt,handout,notheorems]{beamer}
\usepackage{amsmath}
\usepackage{bm} %For making Greek letters bold
\usepackage{pgfpages}
\usepackage{mleftright}
\pgfpagesuselayout{resize to}[a4paper,landscape]
\usetheme{Boadilla}

\renewcommand{\left}{\mleft}
\renewcommand{\right}{\mright}
\begin{document}
    \begin{frame}
        \setcounter{equation}{9}    
        \begin{equation}
            \begin{aligned}[b]
                \mathcal{H}\left(\mathbf{x}\mleft(t\mright), u\mleft(t\mright), 
                \bm{\lambda}\mleft(t\mright) \right) = 1 &+ \lambda_1\mleft(t\mright)x_2\mleft(t\mright) \\
                 &+ \lambda_2\mleft(t\mright)\left[-g -\frac{k}{x_3\mleft(t\mright)}u\mleft(t\mright)\right]\\
                 &+ \lambda_3\mleft(t\mright)u\mleft(t\mright).
            \end{aligned}
        \end{equation}
        or
        \begin{equation}
            \begin{aligned}[b]
                \mathcal{H}\bigl(\mathbf{x}(t), u(t), 
                \bm{\lambda}(t) \bigr) 
                = 1 &+ \lambda_1(t)\,x_2(t) \\
                 &+ \lambda_2(t)\,\left[-g -\frac{k}{x_3(t)}u(t)\right]\\
                 &+ \lambda_3(t)\,u(t)\;.
            \end{aligned}
        \end{equation}
    \end{frame}
\end{document}

insira a descrição da imagem aqui

Você pode alterar o alinhamento [t]ou deixá-lo de fora para mover o número da equação. Já que você está carregando, mleftrightaproveitei para substituir alguns \lefte \rights por \mlefte \mrights, mas você pode simplesmente deixá-los aqui. Pessoalmente, eu também adicionaria espaços finos para separar as funções (veja a segunda versão).

informação relacionada