4

I'd like to use curly braces to demarcate parts of an equation. Right now I'm trying to do so using multirow. Is there a better way, ideally one that is compatible with automatic sizing?

\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}
generic_user
  • 721
  • 1
  • 6
  • 12
  • 2
    Could you please post a complete minimal (working) example starting with \documentclass... and ending with \end{document}? It will help the solvers. – Malipivo Apr 03 '14 at 22:58
  • Done. Also, how do I get latex to render on this forum? In crossvalidated I can use $$ $$... – generic_user Apr 04 '14 at 00:32

2 Answers2

4

The following code borrows from How do I put a side brace around several lines in the align* environment?

screenshot

% 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}
cmhughes
  • 100,947
2

The blkarray package could be a solution. However it has some drawbacks, in particular, the array won't be centred and you'll have to make some manual adjustment. The curly braces are vertically aligned.

\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} 

enter image description here

Bernard
  • 271,350