
コード:
\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}
出力:
2 行目の最初のプラス記号を 1 行目の 1 と揃えるにはどうすればよいですか?
答え1
\phantom{{}=1}
これは、設定に基づいて、2 行目の最初の記号の前に挿入することで機能するソリューションです。配置+
に関しては「機能」しますが、方程式が少し広すぎて、方程式の番号が適切に収まりません。
いずれにせよ、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]
か、省略して方程式番号を移動することができます。ロード中なので、いくつかのandをおよびにmleftright
置き換えましたが、ここでは省略できます。個人的には、関数を区切るために細いスペースも追加します (2 番目のバージョンを参照)。\left
\right
\mleft
\mright