amsmath 方程式之間對齊的下括號

amsmath 方程式之間對齊的下括號

我有一個\amsmath aligned包含一些與 對齊的方程式的環境&=。我希望能夠在方程式之間放置下大括號,以便可以輕鬆指定大括號的內容和“點”,並相應地對齊/移動方程式的其餘部分。支撐和方程式之間的間距應該是均勻的。這是我想要的模型行之間用大括號括起來

我需要能夠堆疊任意數量的此類方程式/大括號。下一行是&= 3帶有下括號的 ,表示 1+2 減少到 3。

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}
  $\begin{aligned}
    1 + 1 + 1 &= 1 + 1 + 1 \\
              &= 1 + 2
  \end{aligned}$
\end{document}

答案1

以下是關於分組的另一種觀點,您可能會感興趣:

在此輸入影像描述

\documentclass{article}
\usepackage{mathtools,calc}
\begin{document}
\[
  %\setlength{\jot}{.5\jot} Adjust to bring the equations closer vertically
  \begin{aligned}
    1 + 1 + 1 &= 1 + \underbrace{1 + 1} \\
              &= \mathrlap{\underbrace{\phantom{1+\hspace{1.9em}}}}1 + \makebox[\widthof{$1+1$}]{$2$} \\
              &= \makebox[\widthof{$1+\hspace{1.9em}$}]{3}
  \end{aligned}
\]
\end{document}

-and-friends中的行間距align是根據 定義的\jot。因此,您可以考慮調整它以滿足您的需求。

答案2

只要我們新增的單密碼數字不太多,就可以達到所有密碼寬度相同的效果。它提供了比前任解決方案更通用的解決方案。

\documentclass[a4paper]{article}
\usepackage{amsmath}

\begin{document}

\[
\begin{array}{r@{{}={}}c}
   1 + 1 + 1 +1& 1 + 1+ \underbrace{1 + 1} \\
              &1+\underbrace{1 + 2}\\
       &\underbrace{1+3}\\
      &4
\end{array}
\]



\end{document}

在此輸入影像描述

答案3

只要您始終將右側的內容分組,您就可以透過使右側右對齊(使用環境alignat)來實現此目的,然後在右側添加適當的空間量以在右側對齊支撐。此技術對於左側分組也同樣有效。

漸進分組方程

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}\noindent
Grouping on the right:
\begin{alignat*}{2}
  6! 
  &={} & 6 \times 5 \times 4 \times 3 \times \underbrace{2 \times 1}
  \\&={} & 6 \times 5 \times 4 \times \underbrace{3 \times 2}      \mspace{16mu}
  \\&={} & 6 \times 5 \times \underbrace{4 \times 6}               \mspace{32mu}
  \\&={} & 6 \times \underbrace{5 \times 24}                       \mspace{44mu}
  \\&={} & \underbrace{6 \times 120}                               \mspace{56mu}
  \\&={} & 720                                                     \mspace{72mu}
\end{alignat*}
Grouping on the left:
\begin{align*}
  6!
  &=                 \underbrace{6 \times 5} \times 4 \times 3 \times 2 \times 1
  \\&= \mspace{10mu} \underbrace{30 \times 4} \times 3 \times 2 \times 1
  \\&= \mspace{20mu} \underbrace{120 \times 3} \times 2 \times 1
  \\&= \mspace{35mu} \underbrace{360 \times 2} \times 1
  \\&= \mspace{50mu} \underbrace{720 \times 1}
  \\&= \mspace{65mu} 720
\end{align*}
\end{document}

答案4

如果這是您需要的,您可以使用陣列而不是對齊:

    \documentclass[a4paper]{article}  
    \usepackage{amsmath}  

\begin{document}  
  $$\begin{array}{rcc}  
    1 + 1 + 1 &= &1 + 1 + 1 \\  
              &= &\underbrace{1 + 2}\\  
              &=&3  
    \end{array}$$  
\end{document}  

在此輸入影像描述

相關內容