我正在创建一个 Beamer 演示文稿,其中方程式环境中的一条线应填满整个屏幕,而不应仅以等号为中心。我认为这看起来更美观,观众也更容易阅读。实际上,只使用\multline
一行就可以实现这一点。我如何在\align
或任何其他“方程式对齐”环境中实现这种行为?这是一个比较,我想通过如下所示的对齐来实现上述效果:
\documentclass{beamer}
\usepackage{amsmath}
\usepackage[thicklines]{cancel}
\usepackage{color}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}
\begin{document}
\begin{frame}
\begin{multline*}
\frac{\partial s_{\mu}}{\partial x_\mu}=
A \;[\ccancel{ \frac{\partial \phi^*}{\partial x_{\mu}}
\frac{\partial \phi}{\partial x_{\mu}}}{Red}
-\ccancel{\vphantom{\frac{1}{1}}(\square \phi^*)\phi}{Blue}
+\ccancel{\vphantom{\frac{1}{1}(kk)}\phi^* \square\phi}{Blue}
-\ccancel{\frac{\partial \phi^*}{\partial x_{\mu}}
\frac{\partial \phi}{\partial x_{\mu}}}{Red}]
\end{multline*}
\\[2em]
\begin{align*}
\frac{\partial s_{\mu}}{\partial x_\mu} & = A \;[\ccancel{ \frac{\partial \phi^*}{\partial x_{\mu}}
\frac{\partial \phi}{\partial x_{\mu}}}{Red}
-\ccancel{\vphantom{\frac{1}{1}}(\square \phi^*)\phi}{Blue}
+\ccancel{\vphantom{\frac{1}{1}(kk)}\phi^* \square\phi}{Blue}
-\ccancel{\frac{\partial \phi^*}{\partial x_{\mu}}
\frac{\partial \phi}{\partial x_{\mu}}}{Red}] \\
& = 0
\end{align*}
\end{frame}
\end{document}
答案1
我不太喜欢取消符号。不过这里有一个建议;请注意,我定义了两个新命令:一个用于简化输入,另一个用于获得拉普拉斯算子的正确间距。
\documentclass{beamer}
\usepackage{amsmath}
\usepackage[thicklines]{cancel}
\usepackage{color}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}
\newcommand{\pder}[2]{\frac{\partial#1}{\partial#2}}
\DeclareMathOperator{\lapl}{\square}
\begin{document}
\begin{frame}
\begin{align*}
\pder{s_{\mu}}{x_\mu} &=
A\biggl[
\ccancel{\pder{\phi^*}{x_{\mu}}\pder{\phi}{x_{\mu}}}{Red}
-\ccancel{\vphantom{\dfrac{1}{1}}\bigl(\lapl\phi^*\bigr)\phi}{Blue}
+\!\ccancel{\hphantom{\big(}\vphantom{\dfrac{1}{1}}\phi^*\lapl\phi\hphantom{\big)}}{Blue}\!
-\ccancel{\pder{\phi^*}{x_{\mu}}\pder{\phi}{x_{\mu}}}{Red}
\biggr]
\\[3ex]
&=0
\end{align*}
\end{frame}
\end{document}
我还做了一些调整以获得与蓝色条相同的倾斜度。
答案2
我必须同意 Herbert 的观点,原因有二:i)术语的位置确实可能更具可读性,但也更模糊;ii)小括号看起来像是使部分表达式等于的条件,A
而你提醒它类似于a(t)=b(t) [almost everywhere]
我建议以下做法,其中取消效果稍微明显一些并且无颜色。
\documentclass{beamer}
\usepackage{mathtools,lmodern,xcolor}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\ccancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\bcancel{#1}}
\begin{document}
\begin{frame}
\begin{align*}
\frac{\partial s_{\mu}}{\partial x_\mu} & = A \left(
\underbracket[0.5pt][3pt]{\frac{\partial \phi^*}{\partial x_{\mu}}\frac{\partial \phi}{\partial x_{\mu}}
-\underbracket[0.5pt][3pt]{\vphantom{\frac{\partial}{\partial_\mu}}\square \phi^*\phi+\phi^* \square\phi}_{0}{}
-\frac{\partial \phi^*}{\partial x_{\mu}}\frac{\partial \phi}{\partial x_{\mu}}}_{0}\right) \\[2em]
& = 0
\end{align*}
\end{frame}
\end{document}