我尝试使用对齐将方程编号放入方程的每一列中。为此,我编写了以下代码-
\begin{align}
\label{equn:rotation}
\begin{split}
W^+_\mu=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{split} & & \begin{split}
Z^0_\mu=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{split}
\end{align}
但我无法做到这一点。有人能帮我吗?
答案1
我建议使用环境 minipage 的解决方案。希望这对您有所帮助。备注:对于 = 符号的对齐,我认为最好在 split 环境中使用 &=
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{minipage}{0.45\linewidth}
\begin{equation}
\begin{split}
W^+_\mu&=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu&=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{split}
\end{equation}%
\end{minipage}%
\hfill%
\begin{minipage}{0.45\linewidth}
\begin{equation}
\begin{split}
Z^0_\mu&=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu&=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{split}
\end{equation}%
\end{minipage}%
\end{document}
答案2
我会aligned
一起使用mathtools
而不是split
。
\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{minipage}{0.45\linewidth}
\begin{equation}
\begin{aligned}
W^+_\mu &= \frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu &= \frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{aligned}
\end{equation}%
\end{minipage}%
\hfill%
\begin{minipage}{0.45\linewidth}
\begin{equation}
\begin{aligned}
Z^0_\mu &= \cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu &= \sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{aligned}
\end{equation}%
\end{minipage}%
\end{document}
答案3
您可以测量这两个部分,为方程式编号添加一些空间,然后使用小页面排版。
可选参数doubleequation
用于左缩进。
另一方面,最后一种方式,align
看起来更清晰。
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % for context
\ExplSyntaxOn
\NewDocumentEnvironment{doubleequation}{O{2em}b}
{
\anirban_doubleequation:nn { #1 } { #2 }
}
{}
\seq_new:N \l__anirban_doubleequation_seq
\dim_new:N \l__anirban_doubleequation_a_dim
\dim_new:N \l__anirban_doubleequation_b_dim
\box_new:N \l__anirban_doubleequation_a_box
\box_new:N \l__anirban_doubleequation_b_box
\box_new:N \l__anirban_doubleequation_eqnum_box
\cs_new_protected:Nn \anirban_doubleequation:nn
{
$$ % yes!
\seq_set_split:Nnn \l__anirban_doubleequation_seq { \nextequation } { #2 }
\hbox_set:Nn \l__anirban_doubleequation_eqnum_box { \theequation }
\hbox_set:Nn \l__anirban_doubleequation_a_box
{
$\displaystyle\seq_item:Nn \l__anirban_doubleequation_seq { 1 }$
}
\dim_set:Nn \l__anirban_doubleequation_a_dim
{ \box_wd:N \l__anirban_doubleequation_a_box + 4em + \box_wd:N \l__anirban_doubleequation_eqnum_box }
\hbox_set:Nn \l__anirban_doubleequation_b_box
{
$\displaystyle\seq_item:Nn \l__anirban_doubleequation_seq { 2 }$
}
\dim_set:Nn \l__anirban_doubleequation_b_dim
{ \box_wd:N \l__anirban_doubleequation_b_box + 4em + \box_wd:N \l__anirban_doubleequation_eqnum_box }
\hspace{#1}
\begin{minipage}{\l__anirban_doubleequation_a_dim}
\noindent
\begin{equation}
\hspace{0pt}
\seq_item:Nn \l__anirban_doubleequation_seq { 1 }
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}
\hspace{10000pt minus 1fil}
\begin{minipage}{\l__anirban_doubleequation_b_dim}
\noindent
\begin{equation}
\hspace{0pt}
\seq_item:Nn \l__anirban_doubleequation_seq { 2 }
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}
$$
}
\ExplSyntaxOff
\begin{document}
\eqref{A} and \eqref{B}
\lipsum[1][1-5]
\begin{doubleequation}
\begin{aligned}
W^+_\mu&=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu&=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{aligned}\label{A}
\nextequation
\begin{aligned}
Z^0_\mu&=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu&=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{aligned}\label{B}
\end{doubleequation}
\lipsum[2][1-5]\setcounter{equation}{123}
\begin{doubleequation}[1em]
\begin{aligned}
W^+_\mu&=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu&=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{aligned}
\nextequation
\begin{aligned}
Z^0_\mu&=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu&=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{aligned}
\end{doubleequation}
\lipsum[3][1-5]
\begin{align}
& W^+_\mu=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}
&& W^-_\mu=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\\[1ex]
& Z^0_\mu=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu
&& A_\mu=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{align}
\lipsum[4][1-5]
\end{document}
使用了一些技巧……