11

How can I add the big bracket at the side of my equations, just like in the photo? Below is my code for the equations.

\begin{align}
\frac{dS_d}{dt}&= A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \nonumber \\
\frac{dE_d}{dt}&= \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \nonumber \\
\frac{dI_d}{dt}&= \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \nonumber \\
\frac{dV_d}{dt}&= k_dS_d -(m_d+\lambda_d)V_d \nonumber \\
\frac{dS_h}{dt}&= B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
\frac{dE_h}{dt}&= \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \nonumber \\
\frac{dI_h}{dt}&= \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \nonumber \\
\frac{dV_h}{dt}&= k_hE_h -(m_h+\lambda_h)V_h \nonumber \\
\end{align}

enter image description here

Ella Taib
  • 113
  • 1
    @Ella_Taib I think that such huge parenthesis will soon lead you into trouble (unless your document is one page long only. See my alternative construct. – Denis Oct 04 '19 at 15:22

7 Answers7

16

Add \left( and \right., but using equation and aligned:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\left(
\begin{aligned}
\frac{dS_d}{dt}&= A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \\[0.5ex]
\frac{dE_d}{dt}&= \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \\[0.5ex]
\frac{dI_d}{dt}&= \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \\[0.5ex]
\frac{dV_d}{dt}&= k_dS_d -(m_d+\lambda_d)V_d \\[0.5ex]
\frac{dS_h}{dt}&= B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\[0.5ex]
\frac{dE_h}{dt}&= \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \\[0.5ex]
\frac{dI_h}{dt}&= \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \\[0.5ex]
\frac{dV_h}{dt}&= k_hE_h -(m_h+\lambda_h)V_h
\end{aligned}
\right.
\end{equation}

\end{document}

enter image description here

As you see, the equation number is centered without any guesswork.

egreg
  • 1,121,712
  • May I know what is the purpose of adding the [0.5ex] ? – Ella Taib Oct 04 '19 at 18:47
  • It is to slightly increase the vertical spacing between rows (ex is a typographical unit, which is the height of the letter x in the current font). – Bernard Oct 04 '19 at 18:54
  • @EllaTaib As Bernard says; I added it because otherwise the fractions would almost collide. – egreg Oct 04 '19 at 19:35
  • thank you so much guys. I realized the difference now! – Ella Taib Oct 04 '19 at 21:02
  • @egreg I see that your output is a little 'bolder'/'blacker' than Bernard's screenshot (as seen on an Android phone on SE app). Can you tell which PDF viewer do you use? – Apoorv Potnis Oct 06 '19 at 08:31
7

Use the empheq package, you can meet your expectation:

\documentclass{article}
\usepackage{empheq}
\begin{document}

\begin{empheq}[left=\empheqbiglparen]{align}
\frac{dS_d}{dt}&= A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \nonumber \\
\frac{dE_d}{dt}&= \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \nonumber \\
\frac{dI_d}{dt}&= \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \nonumber \\
\frac{dV_d}{dt}&= k_dS_d -(m_d+\lambda_d)V_d \nonumber \\
\frac{dS_h}{dt}&= B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
\frac{dE_h}{dt}&= \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \nonumber \\
\frac{dI_h}{dt}&= \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \nonumber \\
\frac{dV_h}{dt}&= k_hE_h -(m_h+\lambda_h)V_h \nonumber
\end{empheq}

\end{document}

enter image description here

MadyYuvi
  • 13,693
6

Another variant, also based on empheq (which loads mathtools), but with a less tight rows spacing with the spreadlines environment.

B.t.w., don't end your multilined environments with a \\; if the environment is numbered, it adds a number for an empty row, and an unwanted vertical spacing.

\documentclass{article}

\usepackage{empheq}

\begin{document}

\begin{spreadlines}{8pt}
\begin{empheq}[left =\empheqlparen]{equation}
\begin{aligned}
\frac{dS_d}{dt}&= A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \\
\frac{dE_d}{dt}&= \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \\
\frac{dI_d}{dt}&= \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \\
\frac{dV_d}{dt}&= k_dS_d -(m_d+\lambda_d)V_d \\
\frac{dS_h}{dt}&= B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
\frac{dE_h}{dt}&= \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \\
\frac{dI_h}{dt}&= \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \\
\frac{dV_h}{dt}&= k_hE_h -(m_h+\lambda_h)V_h 
\end{aligned}
\end{empheq}
\end{spreadlines}

\end{document} 

enter image description here

Bernard
  • 271,350
  • I believe that all \nonumber are superfluous. – Zarko Oct 04 '19 at 16:10
  • @Zarko: Oh! yes. I copied the original code and forgot this point. Thanks! – Bernard Oct 04 '19 at 16:28
  • thank you so much! I excluded \ just like you said and it works wonderfully. – Ella Taib Oct 04 '19 at 18:41
  • @AndrewSwann: Sorry for this – I forgot to remove the \nonumbers from the O.P.'s, and it seems that a single of them within aligned removes the global equation number. That's fixed now. Thank you for pointing it! – Bernard Oct 09 '19 at 09:57
2

You can use the cases environment. You also don't need to add \nonumber to every line, you just need to wrap the equations in some environment that produces a single entity (see here: https://tex.stackexchange.com/a/17529/134574).

Output:

enter image description here

Code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
  \begin{cases}
    \frac{dS_d}{dt} & = A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \\
    \frac{dE_d}{dt} & = \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \\
    \frac{dI_d}{dt} & = \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \\
    \frac{dV_d}{dt} & = k_dS_d -(m_d+\lambda_d)V_d \\
    \frac{dS_h}{dt} & = B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
    \frac{dE_h}{dt} & = \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \\
    \frac{dI_h}{dt} & = \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \\
    \frac{dV_h}{dt} & = k_hE_h -(m_h+\lambda_h)V_h \\
  \end{cases}
\end{align}
\end{document}
LaTeXer
  • 1,492
2

Building on LaTeXer's answer, there is also the dcases environment provided by the mathtools package(which extends amsmath). Its advantage is that all equations are in display mode by default.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
  \begin{dcases}
    \frac{dS_d}{dt} = A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \\
    \frac{dE_d}{dt} = \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \\
    \frac{dI_d}{dt} = \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \\
    \frac{dV_d}{dt} = k_dS_d -(m_d+\lambda_d)V_d \\
    \frac{dS_h}{dt} = B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
    \frac{dE_h}{dt} = \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \\
    \frac{dI_h}{dt} = \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \\
    \frac{dV_h}{dt} = k_hE_h -(m_h+\lambda_h)V_h \\
  \end{dcases}
\end{align}
\end{document}

enter image description here

Franck Pastor
  • 18,756
0

IMHO, such displays are to be avoided whenever possible. Indeed, they are likely to create huge white space if a page break is needed.

I would write

\documentclass[12pt]{article}
\usepackage{amsmath}
\allowdisplaybreaks
\begin{document}

\vspace*{13cm}

\begin{subequations}\label{eq;globalname}
\begin{align}
    \frac{dS_d}{dt} & = A + \lambda_dR_d + \sigma_d(1-\gamma_d)E_d -\beta_dS_dI_d- (m_d+k_d+c_d)S_d \\
    \frac{dE_d}{dt} & = \beta_dS_dI_d -(m_d+\sigma_d+c_d)E_d \\
    \frac{dI_d}{dt} & = \sigma_d\gamma_dE_d -(m_d+\mu_d+c_d)I_d \\
    \frac{dV_d}{dt} & = k_dS_d -(m_d+\lambda_d)V_d \\
    \frac{dS_h}{dt} & = B + \lambda_hR_h + \sigma_h(1-\gamma_h)E_h -\beta_hS_hI_d- m_hS_h \\
    \frac{dE_h}{dt} & = \beta_hS_hI_d -(m_h+\sigma_h+k_h)E_h \\
    \frac{dI_h}{dt} & = \sigma_h\gamma_hE_h -(m_h+\mu_h)I_h \\
    \frac{dV_h}{dt} & = k_hE_h -(m_h+\lambda_h)V_h 
\end{align}
\end{subequations}
I often refer to Eq.\ \eqref{eq;globalname}
\end{document}
\end{document} 

which causes no trouble with page breaks.

Denis
  • 5,267
0

Use the code below.

Add \qquad or similar spacing if you'd like to adjust the lines centering. See photo how the code below looks like.

\begin{equation}
\left(\begin{array}{c}
\frac{dS_{d}}{dt}=A+\lambda_{d}R_{d}+\sigma_{d}(1-\gamma_{d})E_{d}-\beta_{d}S_{d}I_{d}-(m_{d}+k_{d}+c_{d})S_{d}\\
\qquad\frac{dE_{d}}{dt}=\beta_{d}S_{d}I_{d}-(m_{d}+\sigma_{d}+c_{d})E_{d}\\
\qquad\qquad\frac{dI_{d}}{dt}=\sigma_{d}\gamma_{d}E_{d}-(m_{d}+\mu_{d}+c_{d})I_{d}\\
\frac{dV_{d}}{dt}=k_{d}S_{d}-(m_{d}+\lambda_{d})V_{d}\\
\frac{dS_{h}}{dt}=B+\lambda_{h}R_{h}+\sigma_{h}(1-\gamma_{h})E_{h}-\beta_{h}S_{h}I_{d}-m_{h}S_{h}\\
\qquad\frac{dE_{h}}{dt}=\beta_{h}S_{h}I_{d}-(m_{h}+\sigma_{h}+k_{h})E_{h}\\
\qquad\frac{dI_{h}}{dt}=\sigma_{h}\gamma_{h}E_{h}-(m_{h}+\mu_{h})I_{h}\\
\qquad\frac{dV_{h}}{dt}=k_{h}E_{h}-(m_{h}+\lambda_{h})V_{h}
\end{array}\right.
\end{equation}

Example output of equation