我正在尝试写一个等式,其中右侧是图像,左侧是数学表达式。唯一的问题是表达式太长,必须用多行分隔。我希望最终结果是数学表达式相对于图像居中。我得到的最接近的输出是以下代码:
\begin{equation}
\vcenter{\hbox{\includegraphics[scale=0.2]{Image}}} =
\begin{split}
\frac{i k_g}{\Lambda}\;\delta^{a_1a_2}\bigg[\eta^{\nu\sigma}\Big(k_1^\mu k_2^\rho+k_1^\mu k_1^\rho\Big)+\eta^{\mu\sigma}\Big(k_1^\nu k_2^\rho+k_1^\nu k_1^\rho\Big)\\
&\eta^{\nu\rho}\Big(k_1^\sigma k_2^\mu+k_2^\sigma k_2^\mu\Big)+\eta^{\mu\rho}\Big(k_1^\sigma k_2^\nu+k_2^\sigma k_2^\nu\Big)\\
-\eta^{\rho\sigma}\Big(k_1^\mu k_2^\nu+k_1^\nu k_2^\mu\Big)-k_1\cdot k_2\Big(\eta^{\mu\rho}\eta^{\nu\sigma}+\eta^{\mu\sigma}\eta^{\nu\rho}\Big)\bigg].
\end{split}
\end{equation}
如您所见,表达式与图像没有真正对齐,并且第二行部分超出了页面。我该如何正确解决这个问题?
答案1
使用aligned
;可以使图片垂直居中gathered
,比 更简洁\vcenter
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\begin{document}
Text before.
\begin{equation}
\begin{gathered}
\includegraphics[width=4cm]{example-image}
\end{gathered}
=
\begin{aligned}[t]
&\frac{i k_g}{\Lambda}\delta^{a_1a_2}\bigl[
\eta^{\nu\sigma}(k_1^\mu k_2^\rho+k_1^\mu k_1^\rho)\\
&+\eta^{\mu\sigma}(k_1^\nu k_2^\rho+k_1^\nu k_1^\rho)
\eta^{\nu\rho}(k_1^\sigma k_2^\mu+k_2^\sigma k_2^\mu)\\
&+\eta^{\mu\rho}(k_1^\sigma k_2^\nu+k_2^\sigma k_2^\nu)
-\eta^{\rho\sigma}(k_1^\mu k_2^\nu+k_1^\nu k_2^\mu)\\
&-k_1\cdot k_2(\eta^{\mu\rho}\eta^{\nu\sigma}+
\eta^{\mu\sigma}\eta^{\nu\rho})\bigr].
\end{aligned}
\end{equation}
Text after.
\end{document}
adjustbox
如果您希望有不同的相对位置,则另一种可能性是使用。
\documentclass{article}
\usepackage{amsmath}
\usepackage[export]{adjustbox}
\usepackage{graphicx}
\begin{document}
Text before.
\begin{equation}
\begin{gathered}
\setlength{\adjboxvtop}{1.2\baselineskip}
\includegraphics[width=4cm,valign=t]{example-image}
=
\begin{aligned}[t]
&\frac{i k_g}{\Lambda}\delta^{a_1a_2}\bigl[
\eta^{\nu\sigma}(k_1^\mu k_2^\rho+k_1^\mu k_1^\rho)\\
&+\eta^{\mu\sigma}(k_1^\nu k_2^\rho+k_1^\nu k_1^\rho)
\eta^{\nu\rho}(k_1^\sigma k_2^\mu+k_2^\sigma k_2^\mu)\\
&+\eta^{\mu\rho}(k_1^\sigma k_2^\nu+k_2^\sigma k_2^\nu)
-\eta^{\rho\sigma}(k_1^\mu k_2^\nu+k_1^\nu k_2^\mu)\\
&-k_1\cdot k_2(\eta^{\mu\rho}\eta^{\nu\sigma}+
\eta^{\mu\sigma}\eta^{\nu\rho})\bigr].
\end{aligned}
\end{gathered}
\end{equation}
Text after.
\end{document}
答案2
它能完成split
. 编辑:哎呀!我忘了\smash[b]
拍照了……
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{amsmath}
\usepackage{mwe}
\begin{document}
Text before.
\begin{equation}
\begin{split}
\smash[b]{\vcenter{\hbox{\includegraphics[scale=0.2]{image}}}}
= {}&
\frac{i k_g}
{\Lambda}\;\delta^{a_1a_2}\biggl[\eta^{\nu\sigma}\Bigl(k_1^\mu
k_2^\rho+k_1^\mu k_1^\rho\Bigr)\\
&+\eta^{\mu\sigma}\Bigl(k_1^\nu k_2^\rho+k_1^\nu k_1^\rho\Bigr)
\cdot \eta^{\nu\rho}\Bigl(k_1^\sigma k_2^\mu
+k_2^\sigma k_2^\mu\Bigr)\\
&+\eta^{\mu\rho}
\Bigl(k_1^\sigma k_2^\nu+k_2^\sigma k_2^\nu\Bigr)\\
&-\eta^{\rho\sigma}\Bigl(k_1^\mu k_2^\nu+k_1^\nu k_2^\mu\Bigr)-
k_1\cdot k_2\Bigl(\eta^{\mu\rho}\eta^{\nu\sigma}+
\eta^{\mu\sigma}\eta^{\nu\rho}\Bigr)\biggr].
\end{split}
\end{equation}
Text after.
\end{document}
我选择了不同的点来打破方程式,在我看来,它们看起来好多了。还请注意,我已根据需要用 或 替换\Big
,\Bigl
对\Bigr
也一样\bigg
。最后,请注意如何指定对齐点。
这是输出:
添加
OP 澄清说,想要的是不同的输出,即
以我的拙见,这看起来比上面的代码产生的输出更差;无论如何,它也没有造成任何特殊问题:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{amsmath}
\usepackage{mwe}
\begin{document}
Text before.
\begin{equation}
\vcenter{\hbox{\includegraphics[scale=0.2]{image}}} =
\begin{aligned}
&\frac{i k_g}
{\Lambda}\;\delta^{a_1a_2}\biggl[\eta^{\nu\sigma}\Bigl(k_1^\mu
k_2^\rho+k_1^\mu k_1^\rho\Bigr)\\
&+\eta^{\mu\sigma}\Bigl(k_1^\nu k_2^\rho+k_1^\nu k_1^\rho\Bigr)
\cdot \eta^{\nu\rho}\Bigl(k_1^\sigma k_2^\mu
+k_2^\sigma k_2^\mu\Bigr)\\
&+\eta^{\mu\rho}
\Bigl(k_1^\sigma k_2^\nu+k_2^\sigma k_2^\nu\Bigr)\\
&-\eta^{\rho\sigma}\Bigl(k_1^\mu k_2^\nu+k_1^\nu k_2^\mu\Bigr)-
k_1\cdot k_2\Bigl(\eta^{\mu\rho}\eta^{\nu\sigma}+
\eta^{\mu\sigma}\eta^{\nu\rho}\Bigr)\biggr].
\end{aligned}
\end{equation}
Text after.
\end{document}