如何在对齐环境下将一组对齐的方程式单独编号为两列?

如何在对齐环境下将一组对齐的方程式单独编号为两列?

我对只对整个方程组进行一次编号感到困难。目前,有两个数字,每个数字代表一行。我需要在行的中间仅显示一个数字:

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{nccmath,amsmath}
\usepackage{mathtools}

\begin{document}

Blabla bla:
    \begin{align}
        x_1 &= \ell \sin \theta_1,
        &y_1 &= \ell \cos  \theta_1, \\
        x_2 &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &y_2 &= \ell \cos \theta_1 + \ell \cos \theta_2.
    \end{align}

\end{document}

通常我会使用方程环境周围对齐环境,但我需要减少垂直空间。我不知道该怎么做。我可以使用\nonumber \\ \\ \nonumber而不是单个\\,但这是一种 hack!

答案1

评论太多了。你可以使用split,我对 有强烈的个人偏好subequations

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{nccmath,amsmath}
\usepackage{mathtools}
\usepackage{tensor}
%\newcommand{\tensor}[1]{\ensuremath{\boldsymbol{#1}}}
\begin{document}

Original \texttt{align*}
    \begin{align}
        x_1 &= \ell \sin \theta_1,
        &y_1 &= \ell \cos  \theta_1, \\
        x_2 &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &y_2 &= \ell \cos \theta_1 + \ell \cos \theta_2.
    \end{align}

Naive \texttt{aligned}:
\begin{equation}\label{eq:aligned}
    \begin{aligned}
        x_1 &= \ell \sin \theta_1,
        &y_1 &= \ell \cos  \theta_1, \\
        x_2 &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &y_2 &= \ell \cos \theta_1 + \ell \cos \theta_2.
    \end{aligned}
\end{equation}
We can refer here to the combined equations \eqref{eq:aligned}.

With \texttt{split}:
\begin{align}\label{eq:splittensors}
    \begin{split}
        \tensor{x}{_1} &= \ell \sin \theta_1,\\
        \tensor{x}{_2} &= \ell \sin \theta_1 + \ell \sin \theta_2,
    \end{split} 
    &
    \begin{split}
        \tensor{y}{_1} &= \ell \cos  \theta_1, \\
        \tensor{y}{_2} &= \ell \cos \theta_1 + \ell \cos \theta_2.
    \end{split}
\end{align}
We can refer here to the combined equations \eqref{eq:splittensors} as well.


With \texttt{subequations}:
\begin{subequations}\label{eq:tensors}
    \begin{align}
        \tensor{x}{_1} &= \ell \sin \theta_1,
        &\tensor{y}{_1} &= \ell \cos  \theta_1,\label{eq:tensor_1} \\
        \tensor{x}{_2} &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &\tensor{y}{_2} &= \ell \cos \theta_1 + \ell \cos \theta_2.\label{eq:tensor_2}
    \end{align}
\end{subequations}
We can refer to the combined equations \eqref{eq:tensors}, \emph{and} to its
subequations, \eqref{eq:tensor_1} and \eqref{eq:tensor_2}.


One problem with \texttt{split} and \texttt{aligned} is that it can be ambiguous.
\begin{align}\label{eq:splittensors2}
    \begin{split}
        \tensor{x}{_1} &= \ell \sin \theta_1,\\
        \tensor{x}{_2} &= \ell \sin \theta_1 + \ell \sin \theta_2,\\
        \tensor{x}{_3} &= \ell \sin \theta_1 - \ell \sin \theta_2,
    \end{split} 
    &
    \begin{split}
        \tensor{y}{_1} &= \ell \cos  \theta_1, \\
        \tensor{y}{_2} &= \ell \cos \theta_1 + \ell \cos \theta_2,\\
        \tensor{y}{_3} &= \ell \cos \theta_1 - \ell \cos \theta_2.
    \end{split}
\end{align}
When one now refers to \eqref{eq:splittensors2}, it could either mean the
equations in the middle or all of them.

Some like to add a brace
\begin{equation}
\left.    \begin{aligned}
        \tensor{x}{_1} &= \ell \sin \theta_1,
        &\tensor{y}{_1} &= \ell \cos  \theta_1, \\
        \tensor{x}{_2} &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &\tensor{y}{_2} &= \ell \cos \theta_1 + \ell \cos \theta_2,\\
        \tensor{x}{_3} &= \ell \sin \theta_1 - \ell \sin \theta_2,
        &\tensor{y}{_3} &= \ell \cos \theta_1 - \ell \cos \theta_2.
    \end{aligned}\quad\right\}
\end{equation}

With \texttt{subequations} there is no ambiguity:
\begin{subequations}\label{eq:moretensors}
    \begin{align}
        \tensor{x}{_1} &= \ell \sin \theta_1,
        &\tensor{y}{_1} &= \ell \cos  \theta_1, \\
        \tensor{x}{_2} &= \ell \sin \theta_1 + \ell \sin \theta_2,
        &\tensor{y}{_2} &= \ell \cos \theta_1 + \ell \cos \theta_2,\\
        \tensor{x}{_3} &= \ell \sin \theta_1 - \ell \sin \theta_2,
        &\tensor{y}{_3} &= \ell \cos \theta_1 - \ell \cos \theta_2.
    \end{align}
\end{subequations}
We can refer to the combined equations \eqref{eq:moretensors} without ambiguity.
\end{document}

在此处输入图片描述

相关内容