如何使数组的连续部分获得类似 \right\} 的效果?

如何使数组的连续部分获得类似 \right\} 的效果?

我想使用大括号(如 中出现的cases或 中的\right\})引用数组的累积行,将下表与下面示例中使用 制作的重复括号相结合drcases。如何引用具有效果的数组行的子集\left \right

\documentclass{article}

\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}
\begin{displaymath}
\left.
\begin{array}{c|c|c|}
\hline
&\multicolumn{2}{c}{\text{Process}}\vline\\
\hline
0 & \sigma_{0} & a(\phi_{0}')\\
1 & \sigma(\phi_{0}) & a(\phi_{1}')\\
2 & \sigma(\phi_{1}) & a(\phi_{2}')\\
3 & \sigma(\phi_{2}) & a(\phi_{3}')\\
4 & \sigma(\phi_{3}) & a(\phi_{4}')\\
5 & \sigma(\phi_{4}) & a(\phi_{5}')\\
\vdots & \vdots & \vdots
\end{array}
\right\} \rightarrow \phi \rightarrow
\end{displaymath}

\begin{displaymath}
\begin{drcases}
\begin{drcases}
\begin{drcases}
\begin{drcases}
\begin{drcases}
\begin{drcases}
\begin{drcases}
0  \sigma_{0}  a(\phi_{0}')
\end{drcases}\phi_{0}\\
1  \sigma(\phi_{0})  a(\phi_{1}')
\end{drcases}\phi_{1}\\
2  \sigma(\phi_{1})  a(\phi_{2}')
\end{drcases}\phi_{2}\\
3  \sigma(\phi_{2})  a(\phi_{3}')
\end{drcases}\phi_{3}\\
4  \sigma(\phi_{3})  a(\phi_{4}')
\end{drcases}\phi_{4}\\
5  \sigma(\phi_{4})  a(\phi_{5}')
\end{drcases}\phi_{5}\\
\vdots  \vdots  \vdots
\end{drcases}
\phi
\end{displaymath}
\end{document}

在此处输入图片描述

编辑:根据要求,这是我的目标的粗略想法。显然,这里的比例和指标不对。phi_{0} 应该只覆盖第一行,phi_{1} 应该只覆盖第一行和第二行,等等。

在此处输入图片描述

答案1

尝试这个(注意我删除\vline并使用了不同的\multicolumn说明符):

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand*\rightbrace[3][6]{%
  %  Optional argument  : Total number of rows, *excluding* header
  %                       and the last \vdots row. Default 6.
  % Mandatory argument 1: How many rows should the right brace span?
  % Mandatory argument 2: What is the label?
  %
  % We first measure the total height of a \vdots row
  \setbox\z@\vbox{\hbox{$\vdots$\strut}\vss}%
  % Now, \ht0 is the total height of the \vdots row
  \vcenter{%
    \kern\arrayrulewidth % top \hline
    \kern\baselineskip   % header
    \kern\arrayrulewidth % middle \hline
    % Next comes a box spanning #2 rows
    \vbox to#2\baselineskip{%
      \vss
      \hbox{$\left.\vcenter{\hrule height #2\baselineskip}\right\}#3\n@space$}%
      \vss
    }%
    \kern-#2\baselineskip % backup #2 rows
    \kern#1\baselineskip  % move down by #1 (total) rows
    \kern\ht\z@           % move down by total height of \vdots
  }%
}
\makeatother

\begin{document}

\[
\begin{array}{|c|c|c|}
\hline
&\multicolumn{2}{c|}{\text{Process}}\\
\hline
0&\sigma_{0}&a(\phi_{0}')\\
1&\sigma(\phi_{0})&a(\phi_{1}')\\
2&\sigma(\phi_{1})&a(\phi_{2}')\\
3&\sigma(\phi_{2})&a(\phi_{3}')\\
4&\sigma(\phi_{3})&a(\phi_{4}')\\
5&\sigma(\phi_{4})&a(\phi_{5}')\\
\vdots&\vdots&\vdots\\
\end{array}
\rightbrace{1}{\phi_0}
\rightbrace{2}{\phi_1}
\rightbrace{3}{\phi_2}
\rightbrace{4}{\phi_3}
\rightbrace{5}{\phi_4}
\rightbrace{6}{\phi_5}
\rightbrace{7.5}{\phi}
% Yes, the first mandatory argument can be bigger than the optional argument,
% and it also can be a non-integer.
\]

\end{document}

跨越括号

在这个特定的应用中,对齐应该是完美的。

答案2

以下是我的看法:

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs,array}

\begin{document}

\[
% measure the table header
\sbox0{\begin{tabular}[b]{c}\toprule P \\ \midrule\end{tabular}}
% an outer tabular for alignment
\begin{tabular}{@{}c@{}c@{}}
% the table proper
\begin{tabular}[t]{ c *{2}{>{$}c<{$}}}
\toprule
& \multicolumn{2}{c}{Process} \\
\cmidrule{2-3}
0 & \sigma_0       & a(\phi_0') \\
1 & \sigma(\phi_0) & a(\phi_1') \\
2 & \sigma(\phi_1) & a(\phi_2') \\
3 & \sigma(\phi_2) & a(\phi_3') \\
4 & \sigma(\phi_3) & a(\phi_4') \\
5 & \sigma(\phi_4) & a(\phi_5') \\
$\vdots$ & \vdots & \vdots \\
\addlinespace
\bottomrule
\end{tabular} &
% now the braces
\newcommand{\rb}[2]{%
  \raisebox{-\ht0}{\raisebox{-\height}{%
    $\left.\vphantom{\begin{array}{c}#1\end{array}}\right\rbrace#2$%
  }}%
}
\rb{\phi_0'}{\phi_0}
\rb{\phi_0' \\ \phi_1'}{\phi_1}
\rb{\phi_0' \\ \phi_1' \\ \phi_2'}{\phi_2}
\rb{\phi_0' \\ \phi_1' \\ \phi_2' \\ \phi_3'}{\phi_3}
\rb{\phi_0' \\ \phi_1' \\ \phi_2' \\ \phi_3' \\ \phi_4'}{\phi_4}
\rb{\phi_0' \\ \phi_1' \\ \phi_2' \\ \phi_3' \\ \phi_4' \\ \phi_5' }{\phi_5}
\rb{\phi_0' \\ \phi_1' \\ \phi_2' \\ \phi_3' \\ \\ \phi_4' \\ \phi_5' \\ x}{\phi}
\end{tabular}
\]

\end{document}

在此处输入图片描述

相关内容