1

I have a line on which there are an equation and a system of equations. How can I align the equations of the system (vertical alignment of = symbols)?

\documentclass{article}

\usepackage{amsmath}

\newenvironment{sistema}%
{\left\lbrace\begin{array}{@{}l@{}}}%
{\end{array}\right.}

\begin{document}

\begin{equation*}
TTR(t) = TTR_{PLATEAU} \left( 1 - e^{- k \, t} \right) \hspace{0.5cm} con \hspace{0.2cm} \begin{sistema}
    TTR_{PLATEAU} = \frac{ir}{R_a} \\
    k = \frac{R_a}{Q} 
  \end{sistema}
\end{equation*}

\end{document}

Thank you so much for your help.

2
  • How is the sistema environment defined?
    – Mico
    Dec 3 '17 at 8:18
  • Sorry @Mico, now I edit my question. Dec 3 '17 at 8:19
1

I can think of two solutions -- see below. Speaking for myself, I'd say the first solution, which doesn't perform alignment on the = symbols inside the "sistema", looks better. However, there's no arguing about tastes, right? Note that both solutions typeset the material of the systems in display-stye math mode.

Either way, do take care to properly typeset variable names, such as TTR and PLATEAU. The following example provides some suggestions in this regard.

enter image description here

\documentclass{article}
\usepackage{amsmath,array}
\newcolumntype{L}{>{\displaystyle}l} % left-aligned, automatic display-math style
\newcolumntype{R}{>{\displaystyle}r}
\newcolumntype{C}{>{{}}c<{{}}}

\newcommand\TTR{\textit{TTR}}
\newcommand{\PLATEAU}{\textsc{plateau}}

\newenvironment{sistema}%
   {\setlength\arraycolsep{0pt}
    \left\lbrace \begin{array}{L}}%
   {\end{array} \right.}

\newenvironment{sistemax}%
   {\setlength\arraycolsep{0pt}
    \left\lbrace \begin{array}{RCL}}%
   {\end{array} \right.}

\begin{document}

\begin{equation*}
\TTR(t) = \TTR_{\PLATEAU} ( 1 - e^{- kt}) \quad\text{con}\quad
\begin{sistema}
    \TTR_{\PLATEAU} = \frac{ir}{R_a} \\
    k = \frac{R_a}{Q} 
  \end{sistema}
\end{equation*}

\begin{equation*}
\TTR(t) = \TTR_{\PLATEAU} ( 1 - e^{- kt}) \quad\text{con}\quad
\begin{sistemax}
    \TTR_{\PLATEAU} &=& \frac{ir}{R_a} \\[2.5ex] % <-- need extra space
    k &=& \frac{R_a}{Q} 
  \end{sistemax}
\end{equation*}

\end{document}
3
  • Who down-voted both the query as well as both my answer and the one by @Cragfelt, all within the space of a few second? And, why? Care to enlighten us?
    – Mico
    Dec 3 '17 at 9:45
  • Is there any way to know who downvoted our answers and the question?
    – Cragfelt
    Dec 5 '17 at 10:08
  • @Cragfelt - Only the admins would know who the downvoter is. I left a note with the site admins on Sunday evening, pointing out that the query as well as two of the three answers got downvoted, all within a minute of each other. (Bernard's answer was spared, I suppose, because he didn't post it until after the downvoting vandal had done his/her "work".) I also asked the admins to look into whether this was the work of a serial downvoter and, if so, to take appropriate countermeasures. I haven't heard back from them yet, though.
    – Mico
    Dec 5 '17 at 10:14
1

Needless to define a new environment: the dcases environment from mathtools (which loads amsmath) does the job.

Three other possibilities for the alignment of the = sign in the system (personally, I find the first solution nicer)

\documentclass{article}

\usepackage{empheq}
\usepackage{delarray}

\newcommand{\TTR}{\textit{TTR}}

\begin{document}

\begin{equation*}
\TTR(t) = \TTR_{\textrm{\tiny PLATEAU}} \bigl( 1 - e^{- k \, t} \bigr) \quad \text{con} \enspace \begin{dcases}
    \TTR_{\textrm{\tiny PLATEAU}} = \frac{ir}{R_a} \\
    k = \frac{R_a}{Q}
  \end{dcases}
\end{equation*}
\bigskip
\begin{empheq}[left = {\TTR(t) = \TTR_{\textrm{\tiny PLATEAU}} \bigl( 1 - e^{- k \, t} \bigr) \quad \text{con} \enspace\empheqlbrace}]{align*}
    \TTR_{\textrm{\tiny PLATEAU}} & = \smash[t]{\frac{ir}{R_a}} \\[0.5ex]
    k & = \frac{R_a}{Q}
\end{empheq}
\bigskip

\begin{equation*}
\TTR(t) = \TTR_{\textrm{\tiny PLATEAU}} \bigl( 1 - e^{- k \, t} \bigr) \quad \text{con} \enspace \begin{dcases}\begin{aligned}
    \TTR_{\textrm{\tiny PLATEAU}} & = \frac{ir}{R_a} \\[0.5ex]
    k & = \frac{R_a}{Q}
\end{aligned}
  \end{dcases}
\end{equation*}
\bigskip

\begin{equation*}
\TTR(t) = \TTR_{\textrm{\tiny PLATEAU}} \bigl( 1 - e^{- k \, t} \bigr) \quad \text{con} \enspace \begin{array}\{{@{}r@{{}={}}l@{}}. 
    \TTR_{\textrm{\tiny PLATEAU}} & \dfrac{ir}{R_a} \\[2ex]
    k & \dfrac{R_a}{Q}
\end{array}
\end{equation*}

\end{document} 

enter image description here

5
  • I think (though I'm not entirely sure) that one of the OP's objectives was to align the two = symbols inside the "sistema". Any suggestions for how to achieve this within the dcases framework? :-)
    – Mico
    Dec 3 '17 at 13:45
  • Hello @Mico, my goal is to align = symbols inside system of equations. Is possible to do it with your code? Dec 3 '17 at 17:02
  • @GennaroArguzzi -- Does the second form, "sistemax", help achieve your goal?
    – Mico
    Dec 3 '17 at 17:49
  • @Mico Yes, it's the right way. Dec 3 '17 at 18:20
  • @GennaroArguzzi: I've added 3 other solutions, with alignment of the equal signs.
    – Bernard
    Dec 3 '17 at 19:44
1

enter image description here

You need to add parameter r in the definition of your environment {r@{}l@{}}}.

\documentclass{article}

\usepackage{amsmath}

\newenvironment{sistema}%
{\left\lbrace\begin{array}{r@{}l@{}}}% <-- add "r"
{\end{array}\right.}

\begin{document}

\begin{equation*}
    TTR(t) = TTR_{PLATEAU} \left( 1 - e^{- k \, t} \right) \text{ con }
    \begin{sistema}
        TTR_{PLATEAU} = \dfrac{ir}{R_a} \\[3ex]
                    k = \dfrac{R_a}{Q} 
    \end{sistema}
\end{equation*}

\end{document}

I also made some changes:

  1. I replaced the long code \hspace{0.5cm} con \hspace{0.2cm} with \text{ con },
  2. put [3ex] after \\ to add extra vertical space between lines, and
  3. changed \frac to \dfrac (displaystyle fraction).

Edit

According to @barbara beeton's comment: "the spacing before the = sign in the image looks incorrect. are you sure that was produced with the & before the = sign?", there was a bad space produced by & so I removed it.

2
  • 1
    the spacing before the = sign in the image looks incorrect. are you sure that was produced with the & before the = sign? Dec 4 '17 at 17:42
  • @barbarabeeton You are right. I have not noticed it. I removed it and now it looks correct. Thank you for the advice.
    – Cragfelt
    Dec 5 '17 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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