3

I am using the rcases environment inside align and would like to have equal signs aligned. How can I achieve that?

Here is what my current tex code looks like

\begin{align} \begin{split} &\boldsymbol{d}^{\left( 0\right)} = 0 \\ &\boldsymbol{\phi}^{\left( 0\right)} = \boldsymbol{\phi}^k \\ &\begin{rcases} \boldsymbol{d}^{\left( m\right)} = \beta_m \boldsymbol{D}\boldsymbol{\phi}^{\left(m-1\right)} + \left( 1 - \beta_m \right) \boldsymbol{d}^{\left( m-1\right)} \\ \boldsymbol{\phi}^{\left( m\right)} = \boldsymbol{\phi}^{\left( 0\right)} + a_m \mathcal{P} \left( \boldsymbol{f} - \boldsymbol{C} \phi^{\left( m-1\right)} - \boldsymbol{d}^{\left( m\right)} - V\frac{3\boldsymbol{\phi}_n^{\left( m-1\right)}-4\boldsymbol{\phi}_{n-1}+\boldsymbol{\phi}_{n-2}}{2\Delta t}\right) \end{rcases} m =1,2,\dots, 5 \\ &\boldsymbol{\phi}^{k+1} = \boldsymbol{\phi}^{\left( 5\right)} \end{split} \end{align} 

And here is the not so nicely aligned result:

Not correctly aligned

1
  • 1
    welcome to tex.sx. please provide compilable code, beginning with \documentclass and ending with \end{document}. (this expression is too wide for article, so you must be using something else.) also, not material to the question, instead of the combination of align and split, a more "conventional" combination would be equation and aligned, although it doesn't improve the alignment. Commented Apr 12, 2017 at 12:44

2 Answers 2

3

It's ugly, but does the job. It breaks up the rcases environment content, so that an alignment point can be added around the equals sign. That, in and of itself causes issues that have to be remedied with the nonstandard use of ={}& rather than &=, as well as the addition of \mkern-5mu to undo rcases horizontal padding.

However, in addition, a magic \vphantom has to be added to get the aligned to the left side of the equation to have the same vertical spacing as the rcases on the right side.

EDITED to take Mico's suggestion of removing the excessive \left...\right syntax, and of using the bm package.

\documentclass{article} \usepackage{amsmath,mathtools,bm} \usepackage[margin=2.5cm]{geometry} \begin{document} \begin{equation} \begin{split} \bm{d}^{(0)} ={}& 0 \\ \bm{\phi}^{( 0)} ={}& \bm{\phi}^k \\ \begin{aligned} \bm{d}^{(m)} ={}\\ \bm{\phi}^{(m)} ={}\vphantom{\Bigl(} \end{aligned} & \mkern-5mu\begin{rcases} \beta_m \bm{D}\bm{\phi}^{(m-1)} + ( 1 - \beta_m) \bm{d}^{( m-1)} \\ \bm{\phi}^{(0)} + a_m \mathcal{P} \Bigl( \bm{f} - \bm{C} \phi^{(m-1)} - \bm{d}^{(m)} - V\frac{3\bm{\phi}_n^{(m-1)}-4\bm{\phi}_{n-1}+\bm{\phi}_{n-2}}{2\Delta t}\Bigr) \end{rcases} m =1,2,\dots, 5 \\ \bm{\phi}^{k+1} ={}& \bm{\phi}^{(5)} \end{split} \end{equation} \end{document} 

enter image description here

ORIGINAL ANSWER (for comparison))

\documentclass{article} \usepackage{amsmath,mathtools} \usepackage[margin=2.5cm]{geometry} \begin{document} \begin{align} \begin{split} \boldsymbol{d}^{\left( 0\right)} ={}& 0 \\ \boldsymbol{\phi}^{\left( 0\right)} ={}& \boldsymbol{\phi}^k \\ \begin{aligned} \boldsymbol{d}^{\left( m\right)} ={}\\ \boldsymbol{\phi}^{\left( m\right)} ={}\vphantom{\left(\textstyle\frac{x_{n-1}^{(}}{}\right)} \end{aligned} & \mkern-5mu\begin{rcases} \beta_m \boldsymbol{D}\boldsymbol{\phi}^{\left(m-1\right)} + \left( 1 - \beta_m \right) \boldsymbol{d}^{\left( m-1\right)} \\ \boldsymbol{\phi}^{\left( 0\right)} + a_m \mathcal{P} \left( \boldsymbol{f} - \boldsymbol{C} \phi^{\left( m-1\right)} - \boldsymbol{d}^{\left( m\right)} - V\frac{3\boldsymbol{\phi}_n^{\left( m-1\right)}-4\boldsymbol{\phi}_{n-1}+\boldsymbol{\phi}_{n-2}}{2\Delta t}\right) \end{rcases} m =1,2,\dots, 5 \\ \boldsymbol{\phi}^{k+1} ={}& \boldsymbol{\phi}^{\left( 5\right)} \end{split} \end{align} \end{document} 

enter image description here

6
  • @giodan You are welcome. If this answer (if more than one answer are offered) best satisfies the needs of your question, you should consider clicking the check mark to the left of my answer. That will both give me some quantitative credit, as well as indicate to other readers that this approach you found to be the most suitable. Commented Apr 12, 2017 at 13:01
  • A litte too much: mkern -5mu is better. And you don't need split. Commented Apr 12, 2017 at 13:02
  • @Bernard I will incorporate your \mkern. However, the addition of split reduces the number of "numbered" equations from 5 to 1, so there is a difference in the result. Commented Apr 12, 2017 at 13:04
  • 1
    +1. I'd load the bm package and use \bm{...} instead of \boldsymbol{...}. Getting rid of all \left and \right directives may also be desirable. Commented Apr 12, 2017 at 13:08
  • @Steven B. Segletes: I didn't notice the numbering problem. Nevertheless, I find this sort of redundancy semantically disturbing. I'd prefer equation+split Commented Apr 12, 2017 at 15:05
2

I think using an rcases environment gives far too much visual prominence to the m=1,\dots,5 matter. I suggest using a singled aligned environment in an equation environment.

Oh, and do get rid of the \left and \right statements: they achieve nothing at all here except clutter up the code.

enter image description here

\documentclass{article} \usepackage{mathtools,bm} \usepackage[letterpaper,margin=1in]{geometry} % set page parameters appropriately \begin{document} \begin{equation} \begin{aligned} \bm{d}^{(0)} &= 0 \\ \bm{\phi}^{(0)} &= \bm{\phi}^k \\ \bm{d}^{(m)} &= \beta_m \bm{D}\bm{\phi}^{(m-1)} + ( 1 - \beta_m ) \bm{d}^{(m-1)},\ m=1,\dots,5 \\ \bm{\phi}^{(m)} &= \bm{\phi}^{(0)} + a_m \mathcal{P} \biggl( \bm{f} - \bm{C} \phi^{(m-1)} - \bm{d}^{(m)} - V\,\frac{3\bm{\phi}_n^{(m-1)}-4\bm{\phi}_{n-1} +\bm{\phi}_{n-2}}{2\Delta t}\biggr),\ m=1,\dots,5\\ \bm{\phi}^{k+1} &= \bm{\phi}^{(5)} \end{aligned} \end{equation} \end{document} 
2
  • +1 The spurious \left...\right statements do in fact add unwanted spacing effects to the equation, rather than simply doing nothing. Commented Apr 12, 2017 at 15:06
  • @AndrewSwann - Thanks! When I wrote "achieve nothing at all", I was thinking mainly about the effects of \left and \right on the vertical sizes of the associated parentheses. E.g., (0) and \left(0\right) generate the same vertical sizes for ( and ). I hadn't even thought about the noxious effects of \left and \right on horizontal spacing; those should definitely also be avoided. Very glad you pointed this out! Commented Apr 12, 2017 at 15:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.