Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
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 3 at 22:58
    
Done. Also, how do I get latex to render on this forum? In crossvalidated I can use $$ $$... –  ACD Apr 4 at 0:32

2 Answers 2

up vote 2 down vote accepted

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

share|improve this answer

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}
share|improve this answer
    
Thanks! That's almost what I want -- is it possible to have the curly braces vertically aligned? –  ACD Apr 4 at 0:31
    
@ACD: You probably mean "horizontally" aligned...? –  Werner Apr 4 at 0:35
    
Yup! That's dyslexia for you. –  ACD Apr 4 at 0:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.