双重对齐更接近对齐*,这样只有一个方程式被编号,并且方程式可以拆分到不同的页面中

双重对齐更接近对齐*,这样只有一个方程式被编号,并且方程式可以拆分到不同的页面中

当我在笔记中写一些长公式时,我会这样写

    \begin{align}
    a & =  a \cdot 1 \nonumber % this not numbered  \\
      & = a \cdot (1+0)  \nonumber % this not numbered \\  
      & = a \cdot 1+a\cdot 0  % say, I do want this numbered \\   
      & = a +a\cdot 0 \nonumber  % this not numbered 
    \end{align}

是否存在一种双重align命令(比如说),它比更alignsinglenumbered接近于,在某种意义上align*align

    \begin{alignsinglenumbered} 
    a & =  a \cdot 1  % this not numbered  \\
      & = a \cdot (1+0)   % this not numbered \\  
      & = a \cdot 1+a\cdot 0 \numbered  % say, I do want this numbered \\   
      & = a +a\cdot 0     % this not numbered  
        \end{alignsinglenumbered}

产生与上面相同的输出align?由于这些方程很长,人们希望allowdisplaybreaks 工作,但如果写成

\begin{align}
\begin{split}
        a & =  a \cdot 1   \\
          & = a \cdot (1+0)   \\
          & = a \cdot 1+a\cdot 0  \\   
          & = a +a\cdot 0   
\end{split}
\end{align} 

答案1

对于方程式集合的编号,你可以使用以下组合

\begin{equation}
  \begin{aligned}
    % <your equations here)
  \end{aligned}
\end{equation}

或者,如果您对 -like 环境内的单个方程感兴趣,该align环境作为 s 字符串的补充\nonumber,则可以使用以下定义:

在此处输入图片描述

\documentclass{article}

\usepackage{amsmath}

\newcommand{\numbered}{\refstepcounter{equation}\tag{\theequation}}

\newenvironment{alignsinglenumbered}
  {\csname align*\endcsname}
  {\csname endalign*\endcsname}

\begin{document}

\begin{align}
a & = a \cdot 1             \nonumber \\ % this is not numbered 
  & = a \cdot (1 + 0)       \nonumber \\ % this is not numbered
  & = a \cdot 1 + a \cdot 0           \\ % say, I do want this numbered
  & = a \cdot 1 + 0         \nonumber \\ % this is not numbered
  & = a \cdot 1             \nonumber \\ % this is not numbered
  & = a                     \nonumber
\end{align}

\noindent\hrulefill

\begin{alignsinglenumbered}
  a & = a \cdot 1                       \\
    & = a \cdot (1 + 0)                 \\
    & = a \cdot 1 + a \cdot 0 \numbered \\ % say, I do want this numbered  
    & = a \cdot 1 + 0                   \\
    & = a \cdot 1                       \\
    & = a      
\end{alignsinglenumbered}

\end{document}

相关内容