![大花括号仅用于数组的某些行?](https://linux22.com/image/287626/%E5%A4%A7%E8%8A%B1%E6%8B%AC%E5%8F%B7%E4%BB%85%E7%94%A8%E4%BA%8E%E6%95%B0%E7%BB%84%E7%9A%84%E6%9F%90%E4%BA%9B%E8%A1%8C%EF%BC%9F.png)
我想使用花括号来划分方程式的各个部分。现在我正尝试使用多行来实现这一点。有没有更好的方法,最好是兼容自动调整大小的方法?
\documentclass[11pt]{article}
\usepackage{amsmath,multirow}
\begin{document}
\begin{equation}
\begin{array}{r l l}
y_{it} = & \alpha_i + v_i \times P_t & \multirow{4}{*}{\big\} parametric}\\
& + \beta_1 \left( \text{SR}_t \times \text{log(LM)}_i\right)\\
& + \beta_2 T_{it} + \beta_3 \left(T_{it} \times \text{SR}_i\right) + \beta_4 \left(T_{it} \times \text{log(LM)}_i\right) \\
& + \beta_5 \left(T_{it} \times \text{SR}_t \times \text{log(LM)}_i\right) \\
& + f_1\left(\text{F}_{it} \otimes \text{log(LM)}_i \times T_{it} \times SR_{t}\right) & \} nonparametric\\
& + \delta_1^i \text{F}_{it} + \delta_2^i \left(T_{it} \times \text{F}_{it}\right)& \} random \\
\end{array}
\end{equation}
\end{document}
答案1
该blkarray
软件包可能是一个解决方案。但是它有一些缺点,特别是,数组不会居中,您必须进行一些手动调整。花括号是垂直对齐的。
\documentclass[11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar, textwidth = 15cm]{geometry}
\usepackage{amsmath}
\usepackage{blkarray}
\usepackage{nccmath}
\usepackage{blkarray}
\begin{document}
\begin{equation}
\renewcommand{\arraystretch}{1.25}
\hspace{-6em} \begin{blockarray}{r l@{{} + {}} l}
y_{it} = & \alpha_i & v_i \times P_t\\
%
\begin{block}{r l@{{} + {}} l\Right{\}}{parametric}}
& & \beta_1 \left(\text{SR}_t \times \log(\text{LM})_i\right)\\
& & \beta_2 T_{it} + \beta_3 \left(T_{it} \times \text{SR}_i\right) + \beta_4 \left(T_{it} \times \log(\text{LM})_i\right) \\
\end{block}
%
& & \beta_5 \left(T_{it} \times \text{SR}_t \times \log(\text{LM})_i\right) \\
%
\begin{block}{r l@{{} + {}} l\Right{\}}{nonparametric}}
& & f_1\left(\text{F}_{it} \otimes \log(\text{LM})_i \times T_{it} \times SR_{t}\right) \\
\end{block}
%
\begin{block}{r l@{{} + {}} l\Right{\}}{random}}
& & \delta_1^i \text{F}_{it} + \delta_2^i \left(T_{it} \times \text{F}_{it}\right)\\
\end{block}
\end{blockarray}
\end{equation}
\end{document}
答案2
以下代码借用自如何在 align* 环境中将几行放在侧括号内?
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{array}{r@{\;}l}
\setlength{\jot}{4.5pt}
y_{it} & = \alpha_i + v_i \times P_t \\[\jot]
&
\begin{array}{ll}
& + \beta_1 \left( \text{SR}_t \times \text{log(LM)}_i\right) \\[\jot]
& + \beta_2 T_{it} + \beta_3 \left(T_{it} \times \text{SR}_i\right) + \beta_4 \left(T_{it} \times \text{log(LM)}_i\right) \\[\jot]
\end{array}
\smash{\left.\begin{array}{@{}c@{}}\\[\jot]\\[\jot]\end{array}\right\}} \text{parametric}\\[\jot]
&
\begin{array}{ll}
& + \beta_5 \left(T_{it} \times \text{SR}_t \times \text{log(LM)}_i\right) \\[\jot]
& + f_1\left(\text{F}_{it} \otimes \text{log(LM)}_i \times T_{it} \times SR_{t}\right) \\[\jot]
\end{array}
\smash{\left.\begin{array}{@{}c@{}}\\[\jot]\\[\jot]\end{array}\right\}} \text{non-parametric}\\[\jot]
&
+ \delta_1^i \text{F}_{it} + \delta_2^i \left(T_{it} \times \text{F}_{it}\right)\}\text{random}
\end{array}
\end{equation}
\end{document}