
암호:
\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}
산출:
두 번째 줄의 첫 번째 더하기 기호를 첫 번째 줄의 1에 맞추려면 어떻게 해야 합니까?
답변1
\phantom{{}=1}
다음은 설정을 기반으로 하고 라인 2의 첫 번째 기호 앞에 삽입하여 작동하는 솔루션입니다. +
정렬 측면에서 "작동"하지만 이제 방정식이 약간 너무 넓어서 방정식 번호를 제대로 맞출 수 없습니다.
어쨌든 두 기호를 정렬하는 것은 그다지 중요하지 않다고 생각합니다 +
. 제 생각에는 단순한 multline*
환경이 더 나은 역할을 합니다.
\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}
답변2
aligned
를 사용하면 그렇게 할 수 있습니다.
\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}
정렬을 로 변경 [t]
하거나 그대로 두어 방정식 번호를 이동할 수 있습니다. 로드 중이므로 일부 및 s를 및 s로 mleftright
교체할 기회를 얻었 지만 여기에는 그대로 두어도 됩니다. 나는 개인적으로 기능을 분리하기 위해 얇은 공백을 추가할 수도 있습니다(두 번째 버전 참조).\left
\right
\mleft
\mright